|
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/. */ |
|
6 |
|
7 #ifndef nsContextMenuInfo_h__ |
|
8 #define nsContextMenuInfo_h__ |
|
9 |
|
10 #include "nsCOMPtr.h" |
|
11 #include "nsIContextMenuListener2.h" |
|
12 #include "nsIDOMNode.h" |
|
13 #include "nsIDOMEvent.h" |
|
14 #include "imgIContainer.h" |
|
15 #include "imgIRequest.h" |
|
16 |
|
17 class ChromeContextMenuListener; |
|
18 class imgRequestProxy; |
|
19 |
|
20 //***************************************************************************** |
|
21 // class nsContextMenuInfo |
|
22 // |
|
23 // Helper class for implementors of nsIContextMenuListener2 |
|
24 //***************************************************************************** |
|
25 |
|
26 class nsContextMenuInfo : public nsIContextMenuInfo |
|
27 { |
|
28 friend class ChromeContextMenuListener; |
|
29 |
|
30 public: |
|
31 nsContextMenuInfo(); |
|
32 |
|
33 NS_DECL_ISUPPORTS |
|
34 NS_DECL_NSICONTEXTMENUINFO |
|
35 |
|
36 private: |
|
37 virtual ~nsContextMenuInfo(); |
|
38 |
|
39 void SetMouseEvent(nsIDOMEvent *aEvent) |
|
40 { mMouseEvent = aEvent; } |
|
41 |
|
42 void SetDOMNode(nsIDOMNode *aNode) |
|
43 { mDOMNode = aNode; } |
|
44 |
|
45 void SetAssociatedLink(nsIDOMNode *aLink) |
|
46 { mAssociatedLink = aLink; } |
|
47 |
|
48 nsresult GetImageRequest(nsIDOMNode *aDOMNode, |
|
49 imgIRequest **aRequest); |
|
50 |
|
51 bool HasBackgroundImage(nsIDOMNode *aDOMNode); |
|
52 |
|
53 nsresult GetBackgroundImageRequest(nsIDOMNode *aDOMNode, |
|
54 imgRequestProxy **aRequest); |
|
55 |
|
56 nsresult GetBackgroundImageRequestInternal(nsIDOMNode *aDOMNode, |
|
57 imgRequestProxy **aRequest); |
|
58 |
|
59 private: |
|
60 nsCOMPtr<nsIDOMEvent> mMouseEvent; |
|
61 nsCOMPtr<nsIDOMNode> mDOMNode; |
|
62 nsCOMPtr<nsIDOMNode> mAssociatedLink; |
|
63 |
|
64 }; // class nsContextMenuInfo |
|
65 |
|
66 |
|
67 #endif // nsContextMenuInfo_h__ |