OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/builds/tinderbox/XR-Mozilla1.8.0
-Release/WINNT_5.2_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 |
| 25 class NS_NO_VTABLE nsIDOMEventTarget : public nsISupports { |
| 26 public: |
| 27 |
| 28 NS_DEFINE_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_IMETHOD AddEventListener(const nsAString & type, nsIDOMEventListener *liste
ner, 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 listene
r, in boolean useCapture); */ |
| 88 NS_IMETHOD RemoveEventListener(const nsAString & type, nsIDOMEventListener *li
stener, 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_IMETHOD DispatchEvent(nsIDOMEvent *evt, PRBool *_retval) = 0; |
| 110 |
| 111 }; |
| 112 |
| 113 /* Use this macro when declaring classes that implement this interface. */ |
| 114 #define NS_DECL_NSIDOMEVENTTARGET \ |
| 115 NS_IMETHOD AddEventListener(const nsAString & type, nsIDOMEventListener *liste
ner, PRBool useCapture); \ |
| 116 NS_IMETHOD RemoveEventListener(const nsAString & type, nsIDOMEventListener *li
stener, PRBool useCapture); \ |
| 117 NS_IMETHOD DispatchEvent(nsIDOMEvent *evt, PRBool *_retval); |
| 118 |
| 119 /* Use this macro to declare functions that forward the behavior of this interfa
ce to another object. */ |
| 120 #define NS_FORWARD_NSIDOMEVENTTARGET(_to) \ |
| 121 NS_IMETHOD AddEventListener(const nsAString & type, nsIDOMEventListener *liste
ner, PRBool useCapture) { return _to AddEventListener(type, listener, useCapture
); } \ |
| 122 NS_IMETHOD RemoveEventListener(const nsAString & type, nsIDOMEventListener *li
stener, PRBool useCapture) { return _to RemoveEventListener(type, listener, useC
apture); } \ |
| 123 NS_IMETHOD DispatchEvent(nsIDOMEvent *evt, PRBool *_retval) { return _to Dispa
tchEvent(evt, _retval); } |
| 124 |
| 125 /* Use this macro to declare functions that forward the behavior of this interfa
ce to another object in a safe way. */ |
| 126 #define NS_FORWARD_SAFE_NSIDOMEVENTTARGET(_to) \ |
| 127 NS_IMETHOD AddEventListener(const nsAString & type, nsIDOMEventListener *liste
ner, PRBool useCapture) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddEventLis
tener(type, listener, useCapture); } \ |
| 128 NS_IMETHOD RemoveEventListener(const nsAString & type, nsIDOMEventListener *li
stener, PRBool useCapture) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveEv
entListener(type, listener, useCapture); } \ |
| 129 NS_IMETHOD DispatchEvent(nsIDOMEvent *evt, PRBool *_retval) { return !_to ? NS
_ERROR_NULL_POINTER : _to->DispatchEvent(evt, _retval); } |
| 130 |
| 131 #if 0 |
| 132 /* Use the code below as a template for the implementation class for this interf
ace. */ |
| 133 |
| 134 /* Header file */ |
| 135 class nsDOMEventTarget : public nsIDOMEventTarget |
| 136 { |
| 137 public: |
| 138 NS_DECL_ISUPPORTS |
| 139 NS_DECL_NSIDOMEVENTTARGET |
| 140 |
| 141 nsDOMEventTarget(); |
| 142 |
| 143 private: |
| 144 ~nsDOMEventTarget(); |
| 145 |
| 146 protected: |
| 147 /* additional members */ |
| 148 }; |
| 149 |
| 150 /* Implementation file */ |
| 151 NS_IMPL_ISUPPORTS1(nsDOMEventTarget, nsIDOMEventTarget) |
| 152 |
| 153 nsDOMEventTarget::nsDOMEventTarget() |
| 154 { |
| 155 /* member initializers and constructor code */ |
| 156 } |
| 157 |
| 158 nsDOMEventTarget::~nsDOMEventTarget() |
| 159 { |
| 160 /* destructor code */ |
| 161 } |
| 162 |
| 163 /* void addEventListener (in DOMString type, in nsIDOMEventListener listener, in
boolean useCapture); */ |
| 164 NS_IMETHODIMP nsDOMEventTarget::AddEventListener(const nsAString & type, nsIDOME
ventListener *listener, PRBool useCapture) |
| 165 { |
| 166 return NS_ERROR_NOT_IMPLEMENTED; |
| 167 } |
| 168 |
| 169 /* void removeEventListener (in DOMString type, in nsIDOMEventListener listener,
in boolean useCapture); */ |
| 170 NS_IMETHODIMP nsDOMEventTarget::RemoveEventListener(const nsAString & type, nsID
OMEventListener *listener, PRBool useCapture) |
| 171 { |
| 172 return NS_ERROR_NOT_IMPLEMENTED; |
| 173 } |
| 174 |
| 175 /* boolean dispatchEvent (in nsIDOMEvent evt) raises (DOMException); */ |
| 176 NS_IMETHODIMP nsDOMEventTarget::DispatchEvent(nsIDOMEvent *evt, PRBool *_retval) |
| 177 { |
| 178 return NS_ERROR_NOT_IMPLEMENTED; |
| 179 } |
| 180 |
| 181 /* End of implementation class template. */ |
| 182 #endif |
| 183 |
| 184 |
| 185 #endif /* __gen_nsIDOMEventTarget_h__ */ |
OLD | NEW |