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