/gecko_api/include/nsIContextMenuListener.h

http://firefox-mac-pdf.googlecode.com/ · C Header · 151 lines · 56 code · 34 blank · 61 comment · 0 complexity · 7f0756e6567a55105db6ace938221513 MD5 · raw file

  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/embedding/browser/webBrowser/nsIContextMenuListener.idl
  3. */
  4. #ifndef __gen_nsIContextMenuListener_h__
  5. #define __gen_nsIContextMenuListener_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. /* starting interface: nsIContextMenuListener */
  16. #define NS_ICONTEXTMENULISTENER_IID_STR "3478b6b0-3875-11d4-94ef-0020183bf181"
  17. #define NS_ICONTEXTMENULISTENER_IID \
  18. {0x3478b6b0, 0x3875, 0x11d4, \
  19. { 0x94, 0xef, 0x00, 0x20, 0x18, 0x3b, 0xf1, 0x81 }}
  20. /**
  21. * An optional interface for embedding clients wishing to receive
  22. * notifications for context menu events (e.g. generated by
  23. * a user right-mouse clicking on a link). The embedder implements
  24. * this interface on the web browser chrome object associated
  25. * with the window that notifications are required for. When a context
  26. * menu event, the browser will call this interface if present.
  27. *
  28. * @see nsIDOMNode
  29. * @see nsIDOMEvent
  30. *
  31. * @status FROZEN
  32. */
  33. class NS_NO_VTABLE NS_SCRIPTABLE nsIContextMenuListener : public nsISupports {
  34. public:
  35. NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTEXTMENULISTENER_IID)
  36. /** Flag. No context. */
  37. enum { CONTEXT_NONE = 0U };
  38. /** Flag. Context is a link element. */
  39. enum { CONTEXT_LINK = 1U };
  40. /** Flag. Context is an image element. */
  41. enum { CONTEXT_IMAGE = 2U };
  42. /** Flag. Context is the whole document. */
  43. enum { CONTEXT_DOCUMENT = 4U };
  44. /** Flag. Context is a text area element. */
  45. enum { CONTEXT_TEXT = 8U };
  46. /** Flag. Context is an input element. */
  47. enum { CONTEXT_INPUT = 16U };
  48. /**
  49. * Called when the browser receives a context menu event (e.g. user is right-mouse
  50. * clicking somewhere on the document). The combination of flags, event and node
  51. * provided in the call indicate where and what was clicked on.
  52. *
  53. * The following table describes what context flags and node combinations are
  54. * possible.
  55. *
  56. * <TABLE>
  57. * <TR><TD><B>aContextFlag</B></TD><TD>aNode</TD></TR>
  58. * <TR><TD>CONTEXT_LINK</TD><TD>&lt;A&gt;</TD></TR>
  59. * <TR><TD>CONTEXT_IMAGE</TD><TD>&lt;IMG&gt;</TD></TR>
  60. * <TR><TD>CONTEXT_IMAGE | CONTEXT_LINK</TD><TD>&lt;IMG&gt;
  61. * with an &lt;A&gt; as an ancestor</TD></TR>
  62. * <TR><TD>CONTEXT_INPUT</TD><TD>&lt;INPUT&gt;</TD></TR>
  63. * <TR><TD>CONTEXT_TEXT</TD><TD>&lt;TEXTAREA&gt;</TD></TR>
  64. * <TR><TD>CONTEXT_DOCUMENT</TD><TD>&lt;HTML&gt;</TD></TR>
  65. * </TABLE>
  66. *
  67. * @param aContextFlags Flags indicating the kind of context.
  68. * @param aEvent The DOM context menu event.
  69. * @param aNode The DOM node most relevant to the context.
  70. *
  71. * @return <CODE>NS_OK</CODE> always.
  72. */
  73. /* void onShowContextMenu (in unsigned long aContextFlags, in nsIDOMEvent aEvent, in nsIDOMNode aNode); */
  74. NS_SCRIPTABLE NS_IMETHOD OnShowContextMenu(PRUint32 aContextFlags, nsIDOMEvent *aEvent, nsIDOMNode *aNode) = 0;
  75. };
  76. NS_DEFINE_STATIC_IID_ACCESSOR(nsIContextMenuListener, NS_ICONTEXTMENULISTENER_IID)
  77. /* Use this macro when declaring classes that implement this interface. */
  78. #define NS_DECL_NSICONTEXTMENULISTENER \
  79. NS_SCRIPTABLE NS_IMETHOD OnShowContextMenu(PRUint32 aContextFlags, nsIDOMEvent *aEvent, nsIDOMNode *aNode);
  80. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  81. #define NS_FORWARD_NSICONTEXTMENULISTENER(_to) \
  82. NS_SCRIPTABLE NS_IMETHOD OnShowContextMenu(PRUint32 aContextFlags, nsIDOMEvent *aEvent, nsIDOMNode *aNode) { return _to OnShowContextMenu(aContextFlags, aEvent, aNode); }
  83. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  84. #define NS_FORWARD_SAFE_NSICONTEXTMENULISTENER(_to) \
  85. NS_SCRIPTABLE NS_IMETHOD OnShowContextMenu(PRUint32 aContextFlags, nsIDOMEvent *aEvent, nsIDOMNode *aNode) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnShowContextMenu(aContextFlags, aEvent, aNode); }
  86. #if 0
  87. /* Use the code below as a template for the implementation class for this interface. */
  88. /* Header file */
  89. class nsContextMenuListener : public nsIContextMenuListener
  90. {
  91. public:
  92. NS_DECL_ISUPPORTS
  93. NS_DECL_NSICONTEXTMENULISTENER
  94. nsContextMenuListener();
  95. private:
  96. ~nsContextMenuListener();
  97. protected:
  98. /* additional members */
  99. };
  100. /* Implementation file */
  101. NS_IMPL_ISUPPORTS1(nsContextMenuListener, nsIContextMenuListener)
  102. nsContextMenuListener::nsContextMenuListener()
  103. {
  104. /* member initializers and constructor code */
  105. }
  106. nsContextMenuListener::~nsContextMenuListener()
  107. {
  108. /* destructor code */
  109. }
  110. /* void onShowContextMenu (in unsigned long aContextFlags, in nsIDOMEvent aEvent, in nsIDOMNode aNode); */
  111. NS_IMETHODIMP nsContextMenuListener::OnShowContextMenu(PRUint32 aContextFlags, nsIDOMEvent *aEvent, nsIDOMNode *aNode)
  112. {
  113. return NS_ERROR_NOT_IMPLEMENTED;
  114. }
  115. /* End of implementation class template. */
  116. #endif
  117. #endif /* __gen_nsIContextMenuListener_h__ */