PageRenderTime 53ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/gecko_api/include/nsIDOMEvent.h

http://firefox-mac-pdf.googlecode.com/
C Header | 305 lines | 124 code | 48 blank | 133 comment | 0 complexity | 527566bc42e82badf81e3c7be105b827 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/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 NS_SCRIPTABLE nsIDOMEvent : public nsISupports {
  20. public:
  21. NS_DECLARE_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_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE NS_IMETHOD InitEvent(const nsAString & eventTypeArg, PRBool canBubbleArg, PRBool cancelableArg) = 0;
  143. };
  144. NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMEvent, NS_IDOMEVENT_IID)
  145. /* Use this macro when declaring classes that implement this interface. */
  146. #define NS_DECL_NSIDOMEVENT \
  147. NS_SCRIPTABLE NS_IMETHOD GetType(nsAString & aType); \
  148. NS_SCRIPTABLE NS_IMETHOD GetTarget(nsIDOMEventTarget * *aTarget); \
  149. NS_SCRIPTABLE NS_IMETHOD GetCurrentTarget(nsIDOMEventTarget * *aCurrentTarget); \
  150. NS_SCRIPTABLE NS_IMETHOD GetEventPhase(PRUint16 *aEventPhase); \
  151. NS_SCRIPTABLE NS_IMETHOD GetBubbles(PRBool *aBubbles); \
  152. NS_SCRIPTABLE NS_IMETHOD GetCancelable(PRBool *aCancelable); \
  153. NS_SCRIPTABLE NS_IMETHOD GetTimeStamp(DOMTimeStamp *aTimeStamp); \
  154. NS_SCRIPTABLE NS_IMETHOD StopPropagation(void); \
  155. NS_SCRIPTABLE NS_IMETHOD PreventDefault(void); \
  156. NS_SCRIPTABLE NS_IMETHOD InitEvent(const nsAString & eventTypeArg, PRBool canBubbleArg, PRBool cancelableArg);
  157. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  158. #define NS_FORWARD_NSIDOMEVENT(_to) \
  159. NS_SCRIPTABLE NS_IMETHOD GetType(nsAString & aType) { return _to GetType(aType); } \
  160. NS_SCRIPTABLE NS_IMETHOD GetTarget(nsIDOMEventTarget * *aTarget) { return _to GetTarget(aTarget); } \
  161. NS_SCRIPTABLE NS_IMETHOD GetCurrentTarget(nsIDOMEventTarget * *aCurrentTarget) { return _to GetCurrentTarget(aCurrentTarget); } \
  162. NS_SCRIPTABLE NS_IMETHOD GetEventPhase(PRUint16 *aEventPhase) { return _to GetEventPhase(aEventPhase); } \
  163. NS_SCRIPTABLE NS_IMETHOD GetBubbles(PRBool *aBubbles) { return _to GetBubbles(aBubbles); } \
  164. NS_SCRIPTABLE NS_IMETHOD GetCancelable(PRBool *aCancelable) { return _to GetCancelable(aCancelable); } \
  165. NS_SCRIPTABLE NS_IMETHOD GetTimeStamp(DOMTimeStamp *aTimeStamp) { return _to GetTimeStamp(aTimeStamp); } \
  166. NS_SCRIPTABLE NS_IMETHOD StopPropagation(void) { return _to StopPropagation(); } \
  167. NS_SCRIPTABLE NS_IMETHOD PreventDefault(void) { return _to PreventDefault(); } \
  168. NS_SCRIPTABLE NS_IMETHOD InitEvent(const nsAString & eventTypeArg, PRBool canBubbleArg, PRBool cancelableArg) { return _to InitEvent(eventTypeArg, canBubbleArg, cancelableArg); }
  169. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  170. #define NS_FORWARD_SAFE_NSIDOMEVENT(_to) \
  171. NS_SCRIPTABLE NS_IMETHOD GetType(nsAString & aType) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetType(aType); } \
  172. NS_SCRIPTABLE NS_IMETHOD GetTarget(nsIDOMEventTarget * *aTarget) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTarget(aTarget); } \
  173. NS_SCRIPTABLE NS_IMETHOD GetCurrentTarget(nsIDOMEventTarget * *aCurrentTarget) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCurrentTarget(aCurrentTarget); } \
  174. NS_SCRIPTABLE NS_IMETHOD GetEventPhase(PRUint16 *aEventPhase) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEventPhase(aEventPhase); } \
  175. NS_SCRIPTABLE NS_IMETHOD GetBubbles(PRBool *aBubbles) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBubbles(aBubbles); } \
  176. NS_SCRIPTABLE NS_IMETHOD GetCancelable(PRBool *aCancelable) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCancelable(aCancelable); } \
  177. NS_SCRIPTABLE NS_IMETHOD GetTimeStamp(DOMTimeStamp *aTimeStamp) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTimeStamp(aTimeStamp); } \
  178. NS_SCRIPTABLE NS_IMETHOD StopPropagation(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->StopPropagation(); } \
  179. NS_SCRIPTABLE NS_IMETHOD PreventDefault(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->PreventDefault(); } \
  180. NS_SCRIPTABLE NS_IMETHOD InitEvent(const nsAString & eventTypeArg, PRBool canBubbleArg, PRBool cancelableArg) { return !_to ? NS_ERROR_NULL_POINTER : _to->InitEvent(eventTypeArg, canBubbleArg, cancelableArg); }
  181. #if 0
  182. /* Use the code below as a template for the implementation class for this interface. */
  183. /* Header file */
  184. class nsDOMEvent : public nsIDOMEvent
  185. {
  186. public:
  187. NS_DECL_ISUPPORTS
  188. NS_DECL_NSIDOMEVENT
  189. nsDOMEvent();
  190. private:
  191. ~nsDOMEvent();
  192. protected:
  193. /* additional members */
  194. };
  195. /* Implementation file */
  196. NS_IMPL_ISUPPORTS1(nsDOMEvent, nsIDOMEvent)
  197. nsDOMEvent::nsDOMEvent()
  198. {
  199. /* member initializers and constructor code */
  200. }
  201. nsDOMEvent::~nsDOMEvent()
  202. {
  203. /* destructor code */
  204. }
  205. /* readonly attribute DOMString type; */
  206. NS_IMETHODIMP nsDOMEvent::GetType(nsAString & aType)
  207. {
  208. return NS_ERROR_NOT_IMPLEMENTED;
  209. }
  210. /* readonly attribute nsIDOMEventTarget target; */
  211. NS_IMETHODIMP nsDOMEvent::GetTarget(nsIDOMEventTarget * *aTarget)
  212. {
  213. return NS_ERROR_NOT_IMPLEMENTED;
  214. }
  215. /* readonly attribute nsIDOMEventTarget currentTarget; */
  216. NS_IMETHODIMP nsDOMEvent::GetCurrentTarget(nsIDOMEventTarget * *aCurrentTarget)
  217. {
  218. return NS_ERROR_NOT_IMPLEMENTED;
  219. }
  220. /* readonly attribute unsigned short eventPhase; */
  221. NS_IMETHODIMP nsDOMEvent::GetEventPhase(PRUint16 *aEventPhase)
  222. {
  223. return NS_ERROR_NOT_IMPLEMENTED;
  224. }
  225. /* readonly attribute boolean bubbles; */
  226. NS_IMETHODIMP nsDOMEvent::GetBubbles(PRBool *aBubbles)
  227. {
  228. return NS_ERROR_NOT_IMPLEMENTED;
  229. }
  230. /* readonly attribute boolean cancelable; */
  231. NS_IMETHODIMP nsDOMEvent::GetCancelable(PRBool *aCancelable)
  232. {
  233. return NS_ERROR_NOT_IMPLEMENTED;
  234. }
  235. /* readonly attribute DOMTimeStamp timeStamp; */
  236. NS_IMETHODIMP nsDOMEvent::GetTimeStamp(DOMTimeStamp *aTimeStamp)
  237. {
  238. return NS_ERROR_NOT_IMPLEMENTED;
  239. }
  240. /* void stopPropagation (); */
  241. NS_IMETHODIMP nsDOMEvent::StopPropagation()
  242. {
  243. return NS_ERROR_NOT_IMPLEMENTED;
  244. }
  245. /* void preventDefault (); */
  246. NS_IMETHODIMP nsDOMEvent::PreventDefault()
  247. {
  248. return NS_ERROR_NOT_IMPLEMENTED;
  249. }
  250. /* void initEvent (in DOMString eventTypeArg, in boolean canBubbleArg, in boolean cancelableArg); */
  251. NS_IMETHODIMP nsDOMEvent::InitEvent(const nsAString & eventTypeArg, PRBool canBubbleArg, PRBool cancelableArg)
  252. {
  253. return NS_ERROR_NOT_IMPLEMENTED;
  254. }
  255. /* End of implementation class template. */
  256. #endif
  257. #endif /* __gen_nsIDOMEvent_h__ */