PageRenderTime 83ms CodeModel.GetById 40ms app.highlight 4ms RepoModel.GetById 36ms app.codeStats 0ms

/gecko_api/include/nsIDOMEventTarget.h

http://firefox-mac-pdf.googlecode.com/
C++ Header | 187 lines | 64 code | 30 blank | 93 comment | 0 complexity | 5dfa5759bdb8500e29fe0d8f23cb5d0a MD5 | raw file
  1/*
  2 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/dom/public/idl/events/nsIDOMEventTarget.idl
  3 */
  4
  5#ifndef __gen_nsIDOMEventTarget_h__
  6#define __gen_nsIDOMEventTarget_h__
  7
  8
  9#ifndef __gen_domstubs_h__
 10#include "domstubs.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
 17
 18/* starting interface:    nsIDOMEventTarget */
 19#define NS_IDOMEVENTTARGET_IID_STR "1c773b30-d1cf-11d2-bd95-00805f8ae3f4"
 20
 21#define NS_IDOMEVENTTARGET_IID \
 22  {0x1c773b30, 0xd1cf, 0x11d2, \
 23    { 0xbd, 0x95, 0x00, 0x80, 0x5f, 0x8a, 0xe3, 0xf4 }}
 24
 25class NS_NO_VTABLE NS_SCRIPTABLE nsIDOMEventTarget : public nsISupports {
 26 public: 
 27
 28  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMEVENTTARGET_IID)
 29
 30  /**
 31 * The nsIDOMEventTarget interface is the interface implemented by all
 32 * event targets in the Document Object Model.
 33 *
 34 * For more information on this interface please see 
 35 * http://www.w3.org/TR/DOM-Level-2-Events/
 36 *
 37 * @status FROZEN
 38 */
 39/**
 40   * This method allows the registration of event listeners on the event target.
 41   * If an EventListener is added to an EventTarget while it is processing an
 42   * event, it will not be triggered by the current actions but may be 
 43   * triggered during a later stage of event flow, such as the bubbling phase.
 44   * 
 45   * If multiple identical EventListeners are registered on the same 
 46   * EventTarget with the same parameters the duplicate instances are 
 47   * discarded. They do not cause the EventListener to be called twice 
 48   * and since they are discarded they do not need to be removed with the 
 49   * removeEventListener method.
 50   *
 51   * @param   type The event type for which the user is registering
 52   * @param   listener The listener parameter takes an interface 
 53   *                   implemented by the user which contains the methods 
 54   *                   to be called when the event occurs.
 55   * @param   useCapture If true, useCapture indicates that the user 
 56   *                     wishes to initiate capture. After initiating 
 57   *                     capture, all events of the specified type will be 
 58   *                     dispatched to the registered EventListener before 
 59   *                     being dispatched to any EventTargets beneath them 
 60   *                     in the tree. Events which are bubbling upward 
 61   *                     through the tree will not trigger an 
 62   *                     EventListener designated to use capture.
 63   */
 64  /* void addEventListener (in DOMString type, in nsIDOMEventListener listener, in boolean useCapture); */
 65  NS_SCRIPTABLE NS_IMETHOD AddEventListener(const nsAString & type, nsIDOMEventListener *listener, PRBool useCapture) = 0;
 66
 67  /**
 68   * This method allows the removal of event listeners from the event 
 69   * target. If an EventListener is removed from an EventTarget while it 
 70   * is processing an event, it will not be triggered by the current actions. 
 71   * EventListeners can never be invoked after being removed.
 72   * Calling removeEventListener with arguments which do not identify any 
 73   * currently registered EventListener on the EventTarget has no effect.
 74   *
 75   * @param   type Specifies the event type of the EventListener being 
 76   *               removed.
 77   * @param   listener The EventListener parameter indicates the 
 78   *                   EventListener to be removed.
 79   * @param   useCapture Specifies whether the EventListener being 
 80   *                     removed was registered as a capturing listener or 
 81   *                     not. If a listener was registered twice, one with 
 82   *                     capture and one without, each must be removed 
 83   *                     separately. Removal of a capturing listener does 
 84   *                     not affect a non-capturing version of the same 
 85   *                     listener, and vice versa.
 86   */
 87  /* void removeEventListener (in DOMString type, in nsIDOMEventListener listener, in boolean useCapture); */
 88  NS_SCRIPTABLE NS_IMETHOD RemoveEventListener(const nsAString & type, nsIDOMEventListener *listener, PRBool useCapture) = 0;
 89
 90  /**
 91   * This method allows the dispatch of events into the implementations 
 92   * event model. Events dispatched in this manner will have the same 
 93   * capturing and bubbling behavior as events dispatched directly by the 
 94   * implementation. The target of the event is the EventTarget on which 
 95   * dispatchEvent is called.
 96   *
 97   * @param   evt Specifies the event type, behavior, and contextual 
 98   *              information to be used in processing the event.
 99   * @return  Indicates whether any of the listeners which handled the 
100   *          event called preventDefault. If preventDefault was called 
101   *          the value is false, else the value is true.
102   * @throws  UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was 
103   *              not specified by initializing the event before 
104   *              dispatchEvent was called. Specification of the Event's 
105   *              type as null or an empty string will also trigger this 
106   *              exception.
107   */
108  /* boolean dispatchEvent (in nsIDOMEvent evt)  raises (DOMException); */
109  NS_SCRIPTABLE NS_IMETHOD DispatchEvent(nsIDOMEvent *evt, PRBool *_retval) = 0;
110
111};
112
113  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMEventTarget, NS_IDOMEVENTTARGET_IID)
114
115/* Use this macro when declaring classes that implement this interface. */
116#define NS_DECL_NSIDOMEVENTTARGET \
117  NS_SCRIPTABLE NS_IMETHOD AddEventListener(const nsAString & type, nsIDOMEventListener *listener, PRBool useCapture); \
118  NS_SCRIPTABLE NS_IMETHOD RemoveEventListener(const nsAString & type, nsIDOMEventListener *listener, PRBool useCapture); \
119  NS_SCRIPTABLE NS_IMETHOD DispatchEvent(nsIDOMEvent *evt, PRBool *_retval); 
120
121/* Use this macro to declare functions that forward the behavior of this interface to another object. */
122#define NS_FORWARD_NSIDOMEVENTTARGET(_to) \
123  NS_SCRIPTABLE NS_IMETHOD AddEventListener(const nsAString & type, nsIDOMEventListener *listener, PRBool useCapture) { return _to AddEventListener(type, listener, useCapture); } \
124  NS_SCRIPTABLE NS_IMETHOD RemoveEventListener(const nsAString & type, nsIDOMEventListener *listener, PRBool useCapture) { return _to RemoveEventListener(type, listener, useCapture); } \
125  NS_SCRIPTABLE NS_IMETHOD DispatchEvent(nsIDOMEvent *evt, PRBool *_retval) { return _to DispatchEvent(evt, _retval); } 
126
127/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
128#define NS_FORWARD_SAFE_NSIDOMEVENTTARGET(_to) \
129  NS_SCRIPTABLE NS_IMETHOD AddEventListener(const nsAString & type, nsIDOMEventListener *listener, PRBool useCapture) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddEventListener(type, listener, useCapture); } \
130  NS_SCRIPTABLE NS_IMETHOD RemoveEventListener(const nsAString & type, nsIDOMEventListener *listener, PRBool useCapture) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveEventListener(type, listener, useCapture); } \
131  NS_SCRIPTABLE NS_IMETHOD DispatchEvent(nsIDOMEvent *evt, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->DispatchEvent(evt, _retval); } 
132
133#if 0
134/* Use the code below as a template for the implementation class for this interface. */
135
136/* Header file */
137class nsDOMEventTarget : public nsIDOMEventTarget
138{
139public:
140  NS_DECL_ISUPPORTS
141  NS_DECL_NSIDOMEVENTTARGET
142
143  nsDOMEventTarget();
144
145private:
146  ~nsDOMEventTarget();
147
148protected:
149  /* additional members */
150};
151
152/* Implementation file */
153NS_IMPL_ISUPPORTS1(nsDOMEventTarget, nsIDOMEventTarget)
154
155nsDOMEventTarget::nsDOMEventTarget()
156{
157  /* member initializers and constructor code */
158}
159
160nsDOMEventTarget::~nsDOMEventTarget()
161{
162  /* destructor code */
163}
164
165/* void addEventListener (in DOMString type, in nsIDOMEventListener listener, in boolean useCapture); */
166NS_IMETHODIMP nsDOMEventTarget::AddEventListener(const nsAString & type, nsIDOMEventListener *listener, PRBool useCapture)
167{
168    return NS_ERROR_NOT_IMPLEMENTED;
169}
170
171/* void removeEventListener (in DOMString type, in nsIDOMEventListener listener, in boolean useCapture); */
172NS_IMETHODIMP nsDOMEventTarget::RemoveEventListener(const nsAString & type, nsIDOMEventListener *listener, PRBool useCapture)
173{
174    return NS_ERROR_NOT_IMPLEMENTED;
175}
176
177/* boolean dispatchEvent (in nsIDOMEvent evt)  raises (DOMException); */
178NS_IMETHODIMP nsDOMEventTarget::DispatchEvent(nsIDOMEvent *evt, PRBool *_retval)
179{
180    return NS_ERROR_NOT_IMPLEMENTED;
181}
182
183/* End of implementation class template. */
184#endif
185
186
187#endif /* __gen_nsIDOMEventTarget_h__ */