nsIDOMEvent.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/dom/public/idl/events/nsIDOMEvent.idl
  3. */
  4. #ifndef __gen_nsIDOMEvent_h__
  5. #define __gen_nsIDOMEvent_h__
  6. #ifndef __gen_domstubs_h__
  7. #include "domstubs.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 nsIDOMEventTarget; /* forward declaration */
  14. /* starting interface: nsIDOMEvent */
  15. #define NS_IDOMEVENT_IID_STR "a66b7b80-ff46-bd97-0080-5f8ae38add32"
  16. #define NS_IDOMEVENT_IID \
  17. {0xa66b7b80, 0xff46, 0xbd97, \
  18. { 0x00, 0x80, 0x5f, 0x8a, 0xe3, 0x8a, 0xdd, 0x32 }}
  19. class NS_NO_VTABLE nsIDOMEvent : public nsISupports {
  20. public:
  21. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDOMEVENT_IID)
  22. /**
  23. * The nsIDOMEvent interface is the primary datatype for all events in
  24. * the Document Object Model.
  25. *
  26. * For more information on this interface please see
  27. * http://www.w3.org/TR/DOM-Level-2-Events/
  28. *
  29. * @status FROZEN
  30. */
  31. /**
  32. * The current event phase is the capturing phase.
  33. */
  34. enum { CAPTURING_PHASE = 1U };
  35. /**
  36. * The event is currently being evaluated at the target EventTarget.
  37. */
  38. enum { AT_TARGET = 2U };
  39. /**
  40. * The current event phase is the bubbling phase.
  41. */
  42. enum { BUBBLING_PHASE = 3U };
  43. /**
  44. * The name of the event (case-insensitive). The name must be an XML
  45. * name.
  46. */
  47. /* readonly attribute DOMString type; */
  48. NS_IMETHOD GetType(nsAString & aType) = 0;
  49. /**
  50. * Used to indicate the EventTarget to which the event was originally
  51. * dispatched.
  52. */
  53. /* readonly attribute nsIDOMEventTarget target; */
  54. NS_IMETHOD GetTarget(nsIDOMEventTarget * *aTarget) = 0;
  55. /**
  56. * Used to indicate the EventTarget whose EventListeners are currently
  57. * being processed. This is particularly useful during capturing and
  58. * bubbling.
  59. */
  60. /* readonly attribute nsIDOMEventTarget currentTarget; */
  61. NS_IMETHOD GetCurrentTarget(nsIDOMEventTarget * *aCurrentTarget) = 0;
  62. /**
  63. * Used to indicate which phase of event flow is currently being
  64. * evaluated.
  65. */
  66. /* readonly attribute unsigned short eventPhase; */
  67. NS_IMETHOD GetEventPhase(PRUint16 *aEventPhase) = 0;
  68. /**
  69. * Used to indicate whether or not an event is a bubbling event. If the
  70. * event can bubble the value is true, else the value is false.
  71. */
  72. /* readonly attribute boolean bubbles; */
  73. NS_IMETHOD GetBubbles(PRBool *aBubbles) = 0;
  74. /**
  75. * Used to indicate whether or not an event can have its default action
  76. * prevented. If the default action can be prevented the value is true,
  77. * else the value is false.
  78. */
  79. /* readonly attribute boolean cancelable; */
  80. NS_IMETHOD GetCancelable(PRBool *aCancelable) = 0;
  81. /**
  82. * Used to specify the time (in milliseconds relative to the epoch) at
  83. * which the event was created. Due to the fact that some systems may
  84. * not provide this information the value of timeStamp may be not
  85. * available for all events. When not available, a value of 0 will be
  86. * returned. Examples of epoch time are the time of the system start or
  87. * 0:0:0 UTC 1st January 1970.
  88. */
  89. /* readonly attribute DOMTimeStamp timeStamp; */
  90. NS_IMETHOD GetTimeStamp(DOMTimeStamp *aTimeStamp) = 0;
  91. /**
  92. * The stopPropagation method is used prevent further propagation of an
  93. * event during event flow. If this method is called by any
  94. * EventListener the event will cease propagating through the tree. The
  95. * event will complete dispatch to all listeners on the current
  96. * EventTarget before event flow stops. This method may be used during
  97. * any stage of event flow.
  98. */
  99. /* void stopPropagation (); */
  100. NS_IMETHOD StopPropagation(void) = 0;
  101. /**
  102. * If an event is cancelable, the preventDefault method is used to
  103. * signify that the event is to be canceled, meaning any default action
  104. * normally taken by the implementation as a result of the event will
  105. * not occur. If, during any stage of event flow, the preventDefault
  106. * method is called the event is canceled. Any default action associated
  107. * with the event will not occur. Calling this method for a
  108. * non-cancelable event has no effect. Once preventDefault has been
  109. * called it will remain in effect throughout the remainder of the
  110. * event's propagation. This method may be used during any stage of
  111. * event flow.
  112. */
  113. /* void preventDefault (); */
  114. NS_IMETHOD PreventDefault(void) = 0;
  115. /**
  116. * The initEvent method is used to initialize the value of an Event
  117. * created through the DocumentEvent interface. This method may only be
  118. * called before the Event has been dispatched via the dispatchEvent
  119. * method, though it may be called multiple times during that phase if
  120. * necessary. If called multiple times the final invocation takes
  121. * precedence. If called from a subclass of Event interface only the
  122. * values specified in the initEvent method are modified, all other
  123. * attributes are left unchanged.
  124. *
  125. * @param eventTypeArg Specifies the event type. This type may be
  126. * any event type currently defined in this
  127. * specification or a new event type.. The string
  128. * must be an XML name.
  129. * Any new event type must not begin with any
  130. * upper, lower, or mixed case version of the
  131. * string "DOM". This prefix is reserved for
  132. * future DOM event sets. It is also strongly
  133. * recommended that third parties adding their
  134. * own events use their own prefix to avoid
  135. * confusion and lessen the probability of
  136. * conflicts with other new events.
  137. * @param canBubbleArg Specifies whether or not the event can bubble.
  138. * @param cancelableArg Specifies whether or not the event's default
  139. * action can be prevented.
  140. */
  141. /* void initEvent (in DOMString eventTypeArg, in boolean canBubbleArg, in boolean cancelableArg); */
  142. NS_IMETHOD InitEvent(const nsAString & eventTypeArg, PRBool canBubbleArg, PRBool cancelableArg) = 0;
  143. };
  144. /* Use this macro when declaring classes that implement this interface. */
  145. #define NS_DECL_NSIDOMEVENT \
  146. NS_IMETHOD GetType(nsAString & aType); \
  147. NS_IMETHOD GetTarget(nsIDOMEventTarget * *aTarget); \
  148. NS_IMETHOD GetCurrentTarget(nsIDOMEventTarget * *aCurrentTarget); \
  149. NS_IMETHOD GetEventPhase(PRUint16 *aEventPhase); \
  150. NS_IMETHOD GetBubbles(PRBool *aBubbles); \
  151. NS_IMETHOD GetCancelable(PRBool *aCancelable); \
  152. NS_IMETHOD GetTimeStamp(DOMTimeStamp *aTimeStamp); \
  153. NS_IMETHOD StopPropagation(void); \
  154. NS_IMETHOD PreventDefault(void); \
  155. NS_IMETHOD InitEvent(const nsAString & eventTypeArg, PRBool canBubbleArg, PRBool cancelableArg);
  156. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  157. #define NS_FORWARD_NSIDOMEVENT(_to) \
  158. NS_IMETHOD GetType(nsAString & aType) { return _to GetType(aType); } \
  159. NS_IMETHOD GetTarget(nsIDOMEventTarget * *aTarget) { return _to GetTarget(aTarget); } \
  160. NS_IMETHOD GetCurrentTarget(nsIDOMEventTarget * *aCurrentTarget) { return _to GetCurrentTarget(aCurrentTarget); } \
  161. NS_IMETHOD GetEventPhase(PRUint16 *aEventPhase) { return _to GetEventPhase(aEventPhase); } \
  162. NS_IMETHOD GetBubbles(PRBool *aBubbles) { return _to GetBubbles(aBubbles); } \
  163. NS_IMETHOD GetCancelable(PRBool *aCancelable) { return _to GetCancelable(aCancelable); } \
  164. NS_IMETHOD GetTimeStamp(DOMTimeStamp *aTimeStamp) { return _to GetTimeStamp(aTimeStamp); } \
  165. NS_IMETHOD StopPropagation(void) { return _to StopPropagation(); } \
  166. NS_IMETHOD PreventDefault(void) { return _to PreventDefault(); } \
  167. NS_IMETHOD InitEvent(const nsAString & eventTypeArg, PRBool canBubbleArg, PRBool cancelableArg) { return _to InitEvent(eventTypeArg, canBubbleArg, cancelableArg); }
  168. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  169. #define NS_FORWARD_SAFE_NSIDOMEVENT(_to) \
  170. NS_IMETHOD GetType(nsAString & aType) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetType(aType); } \
  171. NS_IMETHOD GetTarget(nsIDOMEventTarget * *aTarget) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTarget(aTarget); } \
  172. NS_IMETHOD GetCurrentTarget(nsIDOMEventTarget * *aCurrentTarget) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCurrentTarget(aCurrentTarget); } \
  173. NS_IMETHOD GetEventPhase(PRUint16 *aEventPhase) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEventPhase(aEventPhase); } \
  174. NS_IMETHOD GetBubbles(PRBool *aBubbles) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBubbles(aBubbles); } \
  175. NS_IMETHOD GetCancelable(PRBool *aCancelable) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCancelable(aCancelable); } \
  176. NS_IMETHOD GetTimeStamp(DOMTimeStamp *aTimeStamp) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTimeStamp(aTimeStamp); } \
  177. NS_IMETHOD StopPropagation(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->StopPropagation(); } \
  178. NS_IMETHOD PreventDefault(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->PreventDefault(); } \
  179. NS_IMETHOD InitEvent(const nsAString & eventTypeArg, PRBool canBubbleArg, PRBool cancelableArg) { return !_to ? NS_ERROR_NULL_POINTER : _to->InitEvent(eventTypeArg, canBubbleArg, cancelableArg); }
  180. #if 0
  181. /* Use the code below as a template for the implementation class for this interface. */
  182. /* Header file */
  183. class nsDOMEvent : public nsIDOMEvent
  184. {
  185. public:
  186. NS_DECL_ISUPPORTS
  187. NS_DECL_NSIDOMEVENT
  188. nsDOMEvent();
  189. private:
  190. ~nsDOMEvent();
  191. protected:
  192. /* additional members */
  193. };
  194. /* Implementation file */
  195. NS_IMPL_ISUPPORTS1(nsDOMEvent, nsIDOMEvent)
  196. nsDOMEvent::nsDOMEvent()
  197. {
  198. /* member initializers and constructor code */
  199. }
  200. nsDOMEvent::~nsDOMEvent()
  201. {
  202. /* destructor code */
  203. }
  204. /* readonly attribute DOMString type; */
  205. NS_IMETHODIMP nsDOMEvent::GetType(nsAString & aType)
  206. {
  207. return NS_ERROR_NOT_IMPLEMENTED;
  208. }
  209. /* readonly attribute nsIDOMEventTarget target; */
  210. NS_IMETHODIMP nsDOMEvent::GetTarget(nsIDOMEventTarget * *aTarget)
  211. {
  212. return NS_ERROR_NOT_IMPLEMENTED;
  213. }
  214. /* readonly attribute nsIDOMEventTarget currentTarget; */
  215. NS_IMETHODIMP nsDOMEvent::GetCurrentTarget(nsIDOMEventTarget * *aCurrentTarget)
  216. {
  217. return NS_ERROR_NOT_IMPLEMENTED;
  218. }
  219. /* readonly attribute unsigned short eventPhase; */
  220. NS_IMETHODIMP nsDOMEvent::GetEventPhase(PRUint16 *aEventPhase)
  221. {
  222. return NS_ERROR_NOT_IMPLEMENTED;
  223. }
  224. /* readonly attribute boolean bubbles; */
  225. NS_IMETHODIMP nsDOMEvent::GetBubbles(PRBool *aBubbles)
  226. {
  227. return NS_ERROR_NOT_IMPLEMENTED;
  228. }
  229. /* readonly attribute boolean cancelable; */
  230. NS_IMETHODIMP nsDOMEvent::GetCancelable(PRBool *aCancelable)
  231. {
  232. return NS_ERROR_NOT_IMPLEMENTED;
  233. }
  234. /* readonly attribute DOMTimeStamp timeStamp; */
  235. NS_IMETHODIMP nsDOMEvent::GetTimeStamp(DOMTimeStamp *aTimeStamp)
  236. {
  237. return NS_ERROR_NOT_IMPLEMENTED;
  238. }
  239. /* void stopPropagation (); */
  240. NS_IMETHODIMP nsDOMEvent::StopPropagation()
  241. {
  242. return NS_ERROR_NOT_IMPLEMENTED;
  243. }
  244. /* void preventDefault (); */
  245. NS_IMETHODIMP nsDOMEvent::PreventDefault()
  246. {
  247. return NS_ERROR_NOT_IMPLEMENTED;
  248. }
  249. /* void initEvent (in DOMString eventTypeArg, in boolean canBubbleArg, in boolean cancelableArg); */
  250. NS_IMETHODIMP nsDOMEvent::InitEvent(const nsAString & eventTypeArg, PRBool canBubbleArg, PRBool cancelableArg)
  251. {
  252. return NS_ERROR_NOT_IMPLEMENTED;
  253. }
  254. /* End of implementation class template. */
  255. #endif
  256. #endif /* __gen_nsIDOMEvent_h__ */