interfaces/DOM_events.idl Source File

DOM_events.idl
Go to the documentation of this file.
1 // File: events.idl
2 
3 #ifndef _EVENTS_IDL_
4 #define _EVENTS_IDL_
5 
6 #include "DOM_APISPEC.idl"
7 
13 module events
14 {
17  typedef dom::Node Node;
18 
19  interface EventListener;
20  interface Event;
21 
22  // Introduced in DOM Level 2:
23 #ifndef FORWARD_EVENT_EXCEPTION
24  exception EventException {
25  unsigned short code;
26  };
27 #endif
28 
29  // EventExceptionCode
30  const unsigned short UNSPECIFIED_EVENT_TYPE_ERR = 0;
31 
32 
33  // Introduced in DOM Level 2:
35  void addEventListener(in DOMString type,
36  in EventListener listener,
37  in boolean useCapture);
38  void removeEventListener(in DOMString type,
39  in EventListener listener,
40  in boolean useCapture);
41  boolean dispatchEvent(in Event evt)
42  raises(EventException);
43  };
44 #pragma terminal-interface
45 
46  // Introduced in DOM Level 2:
48  void handleEvent(in Event evt);
49  };
50 #pragma terminal-interface
51 
52  // Introduced in DOM Level 2:
53  interface Event : XPCOM::IObject {
54 
55  // PhaseType
56  const unsigned short CAPTURING_PHASE = 1;
57  const unsigned short AT_TARGET = 2;
58  const unsigned short BUBBLING_PHASE = 3;
59 
60  readonly attribute DOMString type;
61  readonly attribute EventTarget target;
62  readonly attribute EventTarget currentTarget;
63  readonly attribute unsigned short eventPhase;
64  readonly attribute boolean bubbles;
65  readonly attribute boolean cancelable;
66  readonly attribute DOMTimeStamp timeStamp;
67  void stopPropagation();
68  void preventDefault();
69  void initEvent(in DOMString eventTypeArg,
70  in boolean canBubbleArg,
71  in boolean cancelableArg);
72  };
73 
74  // Introduced in DOM Level 2:
76  Event createEvent(in DOMString domEventType)
77  raises(dom::DOMException);
78  };
79 #pragma terminal-interface
80 
81  // Introduced in DOM Level 2:
82  interface MutationEvent : Event {
83 
84  // attrChangeType
85  const unsigned short MODIFICATION = 1;
86  const unsigned short ADDITION = 2;
87  const unsigned short REMOVAL = 3;
88 
89  readonly attribute Node relatedNode;
90  readonly attribute DOMString prevValue;
91  readonly attribute DOMString newValue;
92  readonly attribute DOMString attrName;
93  readonly attribute unsigned short attrChange;
94  void initMutationEvent(in DOMString typeArg,
95  in boolean canBubbleArg,
96  in boolean cancelableArg,
97  in Node relatedNodeArg,
98  in DOMString prevValueArg,
99  in DOMString newValueArg,
100  in DOMString attrNameArg,
101  in unsigned short attrChangeArg);
102  };
103 #pragma terminal-interface
104 };
105 
106 #endif // _EVENTS_IDL_
Back to Top