PageRenderTime 102ms CodeModel.GetById 60ms app.highlight 4ms RepoModel.GetById 36ms app.codeStats 1ms

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