Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsContextMenuInfo_h__
8 #define nsContextMenuInfo_h__
10 #include "nsCOMPtr.h"
11 #include "nsIContextMenuListener2.h"
12 #include "nsIDOMNode.h"
13 #include "nsIDOMEvent.h"
14 #include "imgIContainer.h"
15 #include "imgIRequest.h"
17 class ChromeContextMenuListener;
18 class imgRequestProxy;
20 //*****************************************************************************
21 // class nsContextMenuInfo
22 //
23 // Helper class for implementors of nsIContextMenuListener2
24 //*****************************************************************************
26 class nsContextMenuInfo : public nsIContextMenuInfo
27 {
28 friend class ChromeContextMenuListener;
30 public:
31 nsContextMenuInfo();
33 NS_DECL_ISUPPORTS
34 NS_DECL_NSICONTEXTMENUINFO
36 private:
37 virtual ~nsContextMenuInfo();
39 void SetMouseEvent(nsIDOMEvent *aEvent)
40 { mMouseEvent = aEvent; }
42 void SetDOMNode(nsIDOMNode *aNode)
43 { mDOMNode = aNode; }
45 void SetAssociatedLink(nsIDOMNode *aLink)
46 { mAssociatedLink = aLink; }
48 nsresult GetImageRequest(nsIDOMNode *aDOMNode,
49 imgIRequest **aRequest);
51 bool HasBackgroundImage(nsIDOMNode *aDOMNode);
53 nsresult GetBackgroundImageRequest(nsIDOMNode *aDOMNode,
54 imgRequestProxy **aRequest);
56 nsresult GetBackgroundImageRequestInternal(nsIDOMNode *aDOMNode,
57 imgRequestProxy **aRequest);
59 private:
60 nsCOMPtr<nsIDOMEvent> mMouseEvent;
61 nsCOMPtr<nsIDOMNode> mDOMNode;
62 nsCOMPtr<nsIDOMNode> mAssociatedLink;
64 }; // class nsContextMenuInfo
67 #endif // nsContextMenuInfo_h__