PageRenderTime 57ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/mozilla/mozilla/dist/include/webbrwsr/nsIContextMenuListener2.h

http://kmbrasil.codeplex.com
C++ Header | 333 lines | 145 code | 69 blank | 119 comment | 0 complexity | 6e78c331e831777f8c831c0bb0cd8cd9 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, GPL-2.0
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM h:/projects/mozilla/mozilla/embedding/browser/webBrowser/nsIContextMenuListener2.idl
  3. */
  4. #ifndef __gen_nsIContextMenuListener2_h__
  5. #define __gen_nsIContextMenuListener2_h__
  6. #ifndef __gen_nsISupports_h__
  7. #include "nsISupports.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. class nsIDOMEvent; /* forward declaration */
  14. class nsIDOMNode; /* forward declaration */
  15. class imgIContainer; /* forward declaration */
  16. class nsIURI; /* forward declaration */
  17. class nsIContextMenuInfo; /* forward declaration */
  18. /* starting interface: nsIContextMenuListener2 */
  19. #define NS_ICONTEXTMENULISTENER2_IID_STR "7fb719b3-d804-4964-9596-77cf924ee314"
  20. #define NS_ICONTEXTMENULISTENER2_IID \
  21. {0x7fb719b3, 0xd804, 0x4964, \
  22. { 0x95, 0x96, 0x77, 0xcf, 0x92, 0x4e, 0xe3, 0x14 }}
  23. /**
  24. * nsIContextMenuListener2
  25. *
  26. * This is an extended version of nsIContextMenuListener
  27. * It provides a helper class, nsIContextMenuInfo, to allow access to
  28. * background images as well as various utilities.
  29. *
  30. * @see nsIContextMenuListener
  31. * @see nsIContextMenuInfo
  32. *
  33. * @status UNDER_REVIEW
  34. */
  35. class NS_NO_VTABLE nsIContextMenuListener2 : public nsISupports {
  36. public:
  37. NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICONTEXTMENULISTENER2_IID)
  38. /** Flag. No context. */
  39. enum { CONTEXT_NONE = 0U };
  40. /** Flag. Context is a link element. */
  41. enum { CONTEXT_LINK = 1U };
  42. /** Flag. Context is an image element. */
  43. enum { CONTEXT_IMAGE = 2U };
  44. /** Flag. Context is the whole document. */
  45. enum { CONTEXT_DOCUMENT = 4U };
  46. /** Flag. Context is a text area element. */
  47. enum { CONTEXT_TEXT = 8U };
  48. /** Flag. Context is an input element. */
  49. enum { CONTEXT_INPUT = 16U };
  50. /** Flag. Context is a background image. */
  51. enum { CONTEXT_BACKGROUND_IMAGE = 32U };
  52. /**
  53. * Called when the browser receives a context menu event (e.g. user is right-mouse
  54. * clicking somewhere on the document). The combination of flags, along with the
  55. * attributes of <CODE>aUtils</CODE>, indicate where and what was clicked on.
  56. *
  57. * The following table describes what context flags and node combinations are
  58. * possible.
  59. *
  60. * aContextFlags aUtils.targetNode
  61. *
  62. * CONTEXT_LINK <A>
  63. * CONTEXT_IMAGE <IMG>
  64. * CONTEXT_IMAGE | CONTEXT_LINK <IMG> with <A> as an ancestor
  65. * CONTEXT_INPUT <INPUT>
  66. * CONTEXT_INPUT | CONTEXT_IMAGE <INPUT> with type=image
  67. * CONTEXT_TEXT <TEXTAREA>
  68. * CONTEXT_DOCUMENT <HTML>
  69. * CONTEXT_BACKGROUND_IMAGE <HTML> with background image
  70. *
  71. * @param aContextFlags Flags indicating the kind of context.
  72. * @param aUtils Context information and helper utilities.
  73. *
  74. * @see nsIContextMenuInfo
  75. */
  76. /* void onShowContextMenu (in unsigned long aContextFlags, in nsIContextMenuInfo aUtils); */
  77. NS_IMETHOD OnShowContextMenu(PRUint32 aContextFlags, nsIContextMenuInfo *aUtils) = 0;
  78. };
  79. /* Use this macro when declaring classes that implement this interface. */
  80. #define NS_DECL_NSICONTEXTMENULISTENER2 \
  81. NS_IMETHOD OnShowContextMenu(PRUint32 aContextFlags, nsIContextMenuInfo *aUtils);
  82. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  83. #define NS_FORWARD_NSICONTEXTMENULISTENER2(_to) \
  84. NS_IMETHOD OnShowContextMenu(PRUint32 aContextFlags, nsIContextMenuInfo *aUtils) { return _to OnShowContextMenu(aContextFlags, aUtils); }
  85. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  86. #define NS_FORWARD_SAFE_NSICONTEXTMENULISTENER2(_to) \
  87. NS_IMETHOD OnShowContextMenu(PRUint32 aContextFlags, nsIContextMenuInfo *aUtils) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnShowContextMenu(aContextFlags, aUtils); }
  88. #if 0
  89. /* Use the code below as a template for the implementation class for this interface. */
  90. /* Header file */
  91. class nsContextMenuListener2 : public nsIContextMenuListener2
  92. {
  93. public:
  94. NS_DECL_ISUPPORTS
  95. NS_DECL_NSICONTEXTMENULISTENER2
  96. nsContextMenuListener2();
  97. private:
  98. ~nsContextMenuListener2();
  99. protected:
  100. /* additional members */
  101. };
  102. /* Implementation file */
  103. NS_IMPL_ISUPPORTS1(nsContextMenuListener2, nsIContextMenuListener2)
  104. nsContextMenuListener2::nsContextMenuListener2()
  105. {
  106. /* member initializers and constructor code */
  107. }
  108. nsContextMenuListener2::~nsContextMenuListener2()
  109. {
  110. /* destructor code */
  111. }
  112. /* void onShowContextMenu (in unsigned long aContextFlags, in nsIContextMenuInfo aUtils); */
  113. NS_IMETHODIMP nsContextMenuListener2::OnShowContextMenu(PRUint32 aContextFlags, nsIContextMenuInfo *aUtils)
  114. {
  115. return NS_ERROR_NOT_IMPLEMENTED;
  116. }
  117. /* End of implementation class template. */
  118. #endif
  119. /* starting interface: nsIContextMenuInfo */
  120. #define NS_ICONTEXTMENUINFO_IID_STR "2f977d56-5485-11d4-87e2-0010a4e75ef2"
  121. #define NS_ICONTEXTMENUINFO_IID \
  122. {0x2f977d56, 0x5485, 0x11d4, \
  123. { 0x87, 0xe2, 0x00, 0x10, 0xa4, 0xe7, 0x5e, 0xf2 }}
  124. class NS_NO_VTABLE nsIContextMenuInfo : public nsISupports {
  125. public:
  126. NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICONTEXTMENUINFO_IID)
  127. /**
  128. * nsIContextMenuInfo
  129. *
  130. * A helper object for implementors of nsIContextMenuListener2.
  131. *
  132. * @status UNDER_REVIEW
  133. */
  134. /**
  135. * The DOM context menu event.
  136. */
  137. /* readonly attribute nsIDOMEvent mouseEvent; */
  138. NS_IMETHOD GetMouseEvent(nsIDOMEvent * *aMouseEvent) = 0;
  139. /**
  140. * The DOM node most relevant to the context.
  141. */
  142. /* readonly attribute nsIDOMNode targetNode; */
  143. NS_IMETHOD GetTargetNode(nsIDOMNode * *aTargetNode) = 0;
  144. /**
  145. * Given the <CODE>CONTEXT_LINK</CODE> flag, <CODE>targetNode</CODE> may not
  146. * nescesarily be a link. This returns the anchor from <CODE>targetNode</CODE>
  147. * if it has one or that of its nearest ancestor if it does not.
  148. */
  149. /* readonly attribute AString associatedLink; */
  150. NS_IMETHOD GetAssociatedLink(nsAString & aAssociatedLink) = 0;
  151. /**
  152. * Given the <CODE>CONTEXT_IMAGE</CODE> flag, these methods can be
  153. * used in order to get the image for viewing, saving, or for the clipboard.
  154. *
  155. * @return <CODE>NS_OK</CODE> if successful, otherwise <CODE>NS_ERROR_FAILURE</CODE> if no
  156. * image was found, or NS_ERROR_NULL_POINTER if an internal error occurs where we think there
  157. * is an image, but for some reason it cannot be returned.
  158. */
  159. /* readonly attribute imgIContainer imageContainer; */
  160. NS_IMETHOD GetImageContainer(imgIContainer * *aImageContainer) = 0;
  161. /* readonly attribute nsIURI imageSrc; */
  162. NS_IMETHOD GetImageSrc(nsIURI * *aImageSrc) = 0;
  163. /**
  164. * Given the <CODE>CONTEXT_BACKGROUND_IMAGE</CODE> flag, these methods can be
  165. * used in order to get the image for viewing, saving, or for the clipboard.
  166. *
  167. * @return <CODE>NS_OK</CODE> if successful, otherwise <CODE>NS_ERROR_FAILURE</CODE> if no background
  168. * image was found, or NS_ERROR_NULL_POINTER if an internal error occurs where we think there is a
  169. * background image, but for some reason it cannot be returned.
  170. */
  171. /* readonly attribute imgIContainer backgroundImageContainer; */
  172. NS_IMETHOD GetBackgroundImageContainer(imgIContainer * *aBackgroundImageContainer) = 0;
  173. /* readonly attribute nsIURI backgroundImageSrc; */
  174. NS_IMETHOD GetBackgroundImageSrc(nsIURI * *aBackgroundImageSrc) = 0;
  175. };
  176. /* Use this macro when declaring classes that implement this interface. */
  177. #define NS_DECL_NSICONTEXTMENUINFO \
  178. NS_IMETHOD GetMouseEvent(nsIDOMEvent * *aMouseEvent); \
  179. NS_IMETHOD GetTargetNode(nsIDOMNode * *aTargetNode); \
  180. NS_IMETHOD GetAssociatedLink(nsAString & aAssociatedLink); \
  181. NS_IMETHOD GetImageContainer(imgIContainer * *aImageContainer); \
  182. NS_IMETHOD GetImageSrc(nsIURI * *aImageSrc); \
  183. NS_IMETHOD GetBackgroundImageContainer(imgIContainer * *aBackgroundImageContainer); \
  184. NS_IMETHOD GetBackgroundImageSrc(nsIURI * *aBackgroundImageSrc);
  185. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  186. #define NS_FORWARD_NSICONTEXTMENUINFO(_to) \
  187. NS_IMETHOD GetMouseEvent(nsIDOMEvent * *aMouseEvent) { return _to GetMouseEvent(aMouseEvent); } \
  188. NS_IMETHOD GetTargetNode(nsIDOMNode * *aTargetNode) { return _to GetTargetNode(aTargetNode); } \
  189. NS_IMETHOD GetAssociatedLink(nsAString & aAssociatedLink) { return _to GetAssociatedLink(aAssociatedLink); } \
  190. NS_IMETHOD GetImageContainer(imgIContainer * *aImageContainer) { return _to GetImageContainer(aImageContainer); } \
  191. NS_IMETHOD GetImageSrc(nsIURI * *aImageSrc) { return _to GetImageSrc(aImageSrc); } \
  192. NS_IMETHOD GetBackgroundImageContainer(imgIContainer * *aBackgroundImageContainer) { return _to GetBackgroundImageContainer(aBackgroundImageContainer); } \
  193. NS_IMETHOD GetBackgroundImageSrc(nsIURI * *aBackgroundImageSrc) { return _to GetBackgroundImageSrc(aBackgroundImageSrc); }
  194. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  195. #define NS_FORWARD_SAFE_NSICONTEXTMENUINFO(_to) \
  196. NS_IMETHOD GetMouseEvent(nsIDOMEvent * *aMouseEvent) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMouseEvent(aMouseEvent); } \
  197. NS_IMETHOD GetTargetNode(nsIDOMNode * *aTargetNode) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTargetNode(aTargetNode); } \
  198. NS_IMETHOD GetAssociatedLink(nsAString & aAssociatedLink) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAssociatedLink(aAssociatedLink); } \
  199. NS_IMETHOD GetImageContainer(imgIContainer * *aImageContainer) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetImageContainer(aImageContainer); } \
  200. NS_IMETHOD GetImageSrc(nsIURI * *aImageSrc) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetImageSrc(aImageSrc); } \
  201. NS_IMETHOD GetBackgroundImageContainer(imgIContainer * *aBackgroundImageContainer) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBackgroundImageContainer(aBackgroundImageContainer); } \
  202. NS_IMETHOD GetBackgroundImageSrc(nsIURI * *aBackgroundImageSrc) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBackgroundImageSrc(aBackgroundImageSrc); }
  203. #if 0
  204. /* Use the code below as a template for the implementation class for this interface. */
  205. /* Header file */
  206. class nsContextMenuInfo : public nsIContextMenuInfo
  207. {
  208. public:
  209. NS_DECL_ISUPPORTS
  210. NS_DECL_NSICONTEXTMENUINFO
  211. nsContextMenuInfo();
  212. private:
  213. ~nsContextMenuInfo();
  214. protected:
  215. /* additional members */
  216. };
  217. /* Implementation file */
  218. NS_IMPL_ISUPPORTS1(nsContextMenuInfo, nsIContextMenuInfo)
  219. nsContextMenuInfo::nsContextMenuInfo()
  220. {
  221. /* member initializers and constructor code */
  222. }
  223. nsContextMenuInfo::~nsContextMenuInfo()
  224. {
  225. /* destructor code */
  226. }
  227. /* readonly attribute nsIDOMEvent mouseEvent; */
  228. NS_IMETHODIMP nsContextMenuInfo::GetMouseEvent(nsIDOMEvent * *aMouseEvent)
  229. {
  230. return NS_ERROR_NOT_IMPLEMENTED;
  231. }
  232. /* readonly attribute nsIDOMNode targetNode; */
  233. NS_IMETHODIMP nsContextMenuInfo::GetTargetNode(nsIDOMNode * *aTargetNode)
  234. {
  235. return NS_ERROR_NOT_IMPLEMENTED;
  236. }
  237. /* readonly attribute AString associatedLink; */
  238. NS_IMETHODIMP nsContextMenuInfo::GetAssociatedLink(nsAString & aAssociatedLink)
  239. {
  240. return NS_ERROR_NOT_IMPLEMENTED;
  241. }
  242. /* readonly attribute imgIContainer imageContainer; */
  243. NS_IMETHODIMP nsContextMenuInfo::GetImageContainer(imgIContainer * *aImageContainer)
  244. {
  245. return NS_ERROR_NOT_IMPLEMENTED;
  246. }
  247. /* readonly attribute nsIURI imageSrc; */
  248. NS_IMETHODIMP nsContextMenuInfo::GetImageSrc(nsIURI * *aImageSrc)
  249. {
  250. return NS_ERROR_NOT_IMPLEMENTED;
  251. }
  252. /* readonly attribute imgIContainer backgroundImageContainer; */
  253. NS_IMETHODIMP nsContextMenuInfo::GetBackgroundImageContainer(imgIContainer * *aBackgroundImageContainer)
  254. {
  255. return NS_ERROR_NOT_IMPLEMENTED;
  256. }
  257. /* readonly attribute nsIURI backgroundImageSrc; */
  258. NS_IMETHODIMP nsContextMenuInfo::GetBackgroundImageSrc(nsIURI * *aBackgroundImageSrc)
  259. {
  260. return NS_ERROR_NOT_IMPLEMENTED;
  261. }
  262. /* End of implementation class template. */
  263. #endif
  264. #endif /* __gen_nsIContextMenuListener2_h__ */