DOMEvents.idl 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. /*
  2. * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. * 1. Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * 2. Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. *
  13. * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
  14. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  15. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  16. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
  17. * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  18. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  20. * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  21. * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  23. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. #ifndef DO_NO_IMPORTS
  26. import "oaidl.idl";
  27. import "ocidl.idl";
  28. import "DOMCore.idl";
  29. import "DOMWindow.idl";
  30. #endif
  31. interface IDOMEvent;
  32. interface IDOMEventException;
  33. interface IDOMEventTarget;
  34. interface IDOMKeyboardEvent;
  35. interface IDOMMouseEvent;
  36. interface IDOMMutationEvent;
  37. interface IDOMNode;
  38. interface IDOMOverflowEvent;
  39. interface IDOMUIEvent;
  40. interface IDOMWheelEvent;
  41. interface IDOMWindow;
  42. typedef long long DOMTimeStamp;
  43. [
  44. object,
  45. oleautomation,
  46. uuid(7f8a0a96-f864-44fb-87fb-c5f03666e8e6),
  47. pointer_default(unique)
  48. ]
  49. interface IDOMEventListener : IDOMObject
  50. {
  51. //void handleEvent(Event evt);
  52. HRESULT handleEvent([in] IDOMEvent* evt);
  53. }
  54. [
  55. object,
  56. oleautomation,
  57. uuid(62343a9e-a779-4e91-818a-14fc178cf4c2),
  58. pointer_default(unique)
  59. ]
  60. interface IDOMEvent : IDOMObject
  61. {
  62. // DOM PhaseType
  63. const unsigned short DOMEVENT_CAPTURING_PHASE = 1;
  64. const unsigned short DOMEVENT_AT_TARGET = 2;
  65. const unsigned short DOMEVENT_BUBBLING_PHASE = 3;
  66. // Reverse-engineered from Netscape
  67. const unsigned short DOMEVENT_MOUSEDOWN = 1;
  68. const unsigned short DOMEVENT_MOUSEUP = 2;
  69. const unsigned short DOMEVENT_MOUSEOVER = 4;
  70. const unsigned short DOMEVENT_MOUSEOUT = 8;
  71. const unsigned short DOMEVENT_MOUSEMOVE = 16;
  72. const unsigned short DOMEVENT_MOUSEDRAG = 32;
  73. const unsigned short DOMEVENT_CLICK = 64;
  74. const unsigned short DOMEVENT_DBLCLICK = 128;
  75. const unsigned short DOMEVENT_KEYDOWN = 256;
  76. const unsigned short DOMEVENT_KEYUP = 512;
  77. const unsigned short DOMEVENT_KEYPRESS = 1024;
  78. const unsigned short DOMEVENT_DRAGDROP = 2048;
  79. const unsigned short DOMEVENT_FOCUS = 4096;
  80. const unsigned short DOMEVENT_BLUR = 8192;
  81. const unsigned short DOMEVENT_SELECT = 16384;
  82. const unsigned short DOMEVENT_CHANGE = 32768;
  83. //readonly attribute DOMString type;
  84. HRESULT type([out, retval] BSTR* result);
  85. //readonly attribute EventTarget target;
  86. HRESULT target([out, retval] IDOMEventTarget** result);
  87. //readonly attribute EventTarget currentTarget;
  88. HRESULT currentTarget([out, retval] IDOMEventTarget** result);
  89. //readonly attribute unsigned short eventPhase;
  90. HRESULT eventPhase([out, retval] unsigned short* result);
  91. //readonly attribute boolean bubbles;
  92. HRESULT bubbles([out, retval] BOOL* result);
  93. //readonly attribute boolean cancelable;
  94. HRESULT cancelable([out, retval] BOOL* result);
  95. //readonly attribute DOMTimeStamp timeStamp;
  96. HRESULT timeStamp([out, retval] DOMTimeStamp* result);
  97. //void stopPropagation();
  98. HRESULT stopPropagation();
  99. //void preventDefault();
  100. HRESULT preventDefault();
  101. //[OldStyleObjC] void initEvent(DOMString eventTypeArg,
  102. // boolean canBubbleArg,
  103. // boolean cancelableArg);
  104. HRESULT initEvent([in] BSTR eventTypeArg, [in] BOOL canBubbleArg, [in] BOOL cancelableArg);
  105. }
  106. [
  107. object,
  108. oleautomation,
  109. uuid(c7cf7d84-d755-40bc-b664-84bc79eff709),
  110. pointer_default(unique)
  111. ]
  112. interface IDOMEventTarget : IUnknown
  113. {
  114. //void addEventListener(DOMString type,
  115. // EventListener listener,
  116. // boolean useCapture);
  117. HRESULT addEventListener([in] BSTR type, [in] IDOMEventListener* listener, [in] BOOL useCapture);
  118. //void removeEventListener(DOMString type,
  119. // EventListener listener,
  120. // boolean useCapture);
  121. HRESULT removeEventListener([in] BSTR type, [in] IDOMEventListener* listener, [in] BOOL useCapture);
  122. //boolean dispatchEvent(Event event)
  123. HRESULT dispatchEvent([in] IDOMEvent* event, [out, retval] BOOL* result);
  124. }
  125. [
  126. object,
  127. oleautomation,
  128. uuid(55AAF192-68CD-409f-A551-89710DC7240A),
  129. pointer_default(unique)
  130. ]
  131. interface IDOMDocumentEvent : IUnknown
  132. {
  133. //[RaisesException] Event createEvent(DOMString eventType);
  134. HRESULT createEvent([in] BSTR eventType, [out, retval] IDOMEvent** result);
  135. }
  136. [
  137. object,
  138. oleautomation,
  139. uuid(76bc4e46-67df-40d3-89b0-a94dcc2ed507),
  140. pointer_default(unique)
  141. ]
  142. interface IDOMKeyboardEvent : IDOMUIEvent
  143. {
  144. // KeyLocationCode
  145. const unsigned long DOMKEYBOARDEVENT_KEY_LOCATION_STANDARD = 0x00;
  146. const unsigned long DOMKEYBOARDEVENT_KEY_LOCATION_LEFT = 0x01;
  147. const unsigned long DOMKEYBOARDEVENT_KEY_LOCATION_RIGHT = 0x02;
  148. const unsigned long DOMKEYBOARDEVENT_KEY_LOCATION_NUMPAD = 0x03;
  149. //readonly attribute DOMString keyIdentifier;
  150. HRESULT keyIdentifier([out, retval] BSTR* result);
  151. //readonly attribute unsigned long keyLocation;
  152. HRESULT keyLocation([out, retval] unsigned long* result);
  153. //readonly attribute boolean ctrlKey;
  154. HRESULT ctrlKey([out, retval] BOOL* result);
  155. //readonly attribute boolean shiftKey;
  156. HRESULT shiftKey([out, retval] BOOL* result);
  157. //readonly attribute boolean altKey;
  158. HRESULT altKey([out, retval] BOOL* result);
  159. //readonly attribute boolean metaKey;
  160. HRESULT metaKey([out, retval] BOOL* result);
  161. //readonly attribute boolean altGraphKey;
  162. HRESULT altGraphKey([out, retval] BOOL* result);
  163. //boolean getModifierState(DOMString keyIdentifierArg);
  164. HRESULT getModifierState([in] BSTR keyIdentifierArg, [out, retval] BOOL* result);
  165. // FIXME: this does not match the version in the DOM spec.
  166. //void initKeyboardEvent(AtomicString type,
  167. // boolean canBubble,
  168. // boolean cancelable,
  169. // DOMWindow view,
  170. // DOMString keyIdentifier,
  171. // unsigned long keyLocation,
  172. // boolean ctrlKey,
  173. // boolean altKey,
  174. // boolean shiftKey,
  175. // boolean metaKey,
  176. // boolean altGraphKey);
  177. HRESULT initKeyboardEvent([in] BSTR type, [in] BOOL canBubble, [in] BOOL cancelable, [in] IDOMWindow* view, [in] BSTR keyIdentifier, [in] unsigned long keyLocation, [in] BOOL ctrlKey, [in] BOOL altKey, [in] BOOL shiftKey, [in] BOOL metaKey, [in] BOOL graphKey);
  178. // WebKit Extensions
  179. //readonly attribute long keyCode;
  180. //HRESULT keyCode([out, retval] long* result);
  181. //readonly attribute long charCode;
  182. //HRESULT charCode([out, retval] long* result);
  183. //void initKeyboardEvent(AtomicString type,
  184. // boolean canBubble,
  185. // boolean cancelable,
  186. // DOMWindow view,
  187. // DOMString keyIdentifier,
  188. // unsigned long keyLocation,
  189. // boolean ctrlKey,
  190. // boolean altKey,
  191. // boolean shiftKey,
  192. // boolean metaKey);
  193. }
  194. [
  195. object,
  196. oleautomation,
  197. uuid(bdd97151-5f6a-4ba4-a902-9b008392eb54),
  198. pointer_default(unique)
  199. ]
  200. interface IDOMMouseEvent : IDOMUIEvent
  201. {
  202. //readonly attribute long screenX;
  203. HRESULT screenX([out, retval] long* result);
  204. //readonly attribute long screenY;
  205. HRESULT screenY([out, retval] long* result);
  206. //readonly attribute long clientX;
  207. HRESULT clientX([out, retval] long* result);
  208. //readonly attribute long clientY;
  209. HRESULT clientY([out, retval] long* result);
  210. //readonly attribute boolean ctrlKey;
  211. HRESULT ctrlKey([out, retval] BOOL* result);
  212. //readonly attribute boolean shiftKey;
  213. HRESULT shiftKey([out, retval] BOOL* result);
  214. //readonly attribute boolean altKey;
  215. HRESULT altKey([out, retval] BOOL* result);
  216. //readonly attribute boolean metaKey;
  217. HRESULT metaKey([out, retval] BOOL* result);
  218. //readonly attribute unsigned short button;
  219. HRESULT button([out, retval] unsigned short* result);
  220. //readonly attribute EventTarget relatedTarget;
  221. HRESULT relatedTarget([out, retval] IDOMEventTarget** result);
  222. //[OldStyleObjC] void initMouseEvent(AtomicString type,
  223. // boolean canBubble,
  224. // boolean cancelable,
  225. // DOMWindow view,
  226. // long detail,
  227. // long screenX,
  228. // long screenY,
  229. // long clientX,
  230. // long clientY,
  231. // boolean ctrlKey,
  232. // boolean altKey,
  233. // boolean shiftKey,
  234. // boolean metaKey,
  235. // unsigned short button,
  236. // EventTarget relatedTarget);
  237. HRESULT initMouseEvent([in] BSTR type, [in] BOOL canBubble, [in] BOOL cancelable, [in] IDOMWindow* view, [in] long detail, [in] long screenX, [in] long screenY, [in] long clientX, [in] long clientY, [in] BOOL ctrlKey, [in] BOOL altKey, [in] BOOL shiftKey, [in] BOOL metaKey, [in] unsigned short button, [in] IDOMEventTarget* relatedTarget);
  238. // extensions
  239. //readonly attribute long offsetX;
  240. HRESULT offsetX([out, retval] long* result);
  241. //readonly attribute long offsetY;
  242. HRESULT offsetY([out, retval] long* result);
  243. //readonly attribute long x;
  244. HRESULT x([out, retval] long* result);
  245. //readonly attribute long y;
  246. HRESULT y([out, retval] long* result);
  247. //readonly attribute Node fromElement;
  248. HRESULT fromElement([out, retval] IDOMNode** result);
  249. //readonly attribute Node toElement;
  250. HRESULT toElement([out, retval] IDOMNode** result);
  251. }
  252. [
  253. object,
  254. oleautomation,
  255. uuid(6345d228-ea67-48ee-93c8-ff6e9c6356e9),
  256. pointer_default(unique)
  257. ]
  258. interface IDOMMutationEvent : IDOMEvent
  259. {
  260. // attrChangeType
  261. const unsigned short DOMMUTATIONEVENT_MODIFICATION = 1;
  262. const unsigned short DOMMUTATIONEVENT_ADDITION = 2;
  263. const unsigned short DOMMUTATIONEVENT_REMOVAL = 3;
  264. //readonly attribute Node relatedNode;
  265. HRESULT relatedNode([out, retval] IDOMNode** result);
  266. //readonly attribute DOMString prevValue;
  267. HRESULT prevValue([out, retval] BSTR* result);
  268. //readonly attribute DOMString newValue;
  269. HRESULT newValue([out, retval] BSTR* result);
  270. //readonly attribute DOMString attrName;
  271. HRESULT attrName([out, retval] BSTR* result);
  272. //readonly attribute unsigned short attrChange;
  273. HRESULT attrChange([out, retval] unsigned short* result);
  274. //[OldStyleObjC] void initMutationEvent(AtomicString type,
  275. // boolean canBubble,
  276. // boolean cancelable,
  277. // Node relatedNode,
  278. // DOMString prevValue,
  279. // DOMString newValue,
  280. // DOMString attrName,
  281. // unsigned short attrChange);
  282. HRESULT initMutationEvent([in] BSTR type, [in] BOOL canBubble, [in] BOOL cancelable, [in] IDOMNode* relatedNode, [in] BSTR prevValue, [in] BSTR newValue, [in] BSTR attrName, [in] unsigned short attrChange);
  283. }
  284. [
  285. object,
  286. oleautomation,
  287. uuid(6048369e-e444-401b-950d-c9daef9384d2),
  288. pointer_default(unique)
  289. ]
  290. interface IDOMOverflowEvent : IDOMEvent
  291. {
  292. const unsigned short DOMOVERFLOWEVENT_HORIZONTAL = 0;
  293. const unsigned short DOMOVERFLOWEVENT_VERTICAL = 1;
  294. const unsigned short DOMOVERFLOWEVENT_BOTH = 2;
  295. //readonly attribute unsigned short orient;
  296. HRESULT orient([out, retval] unsigned short* result);
  297. //readonly attribute boolean horizontalOverflow;
  298. HRESULT horizontalOverflow([out, retval] BOOL* result);
  299. //readonly attribute boolean verticalOverflow;
  300. HRESULT verticalOverflow([out, retval] BOOL* result);
  301. }
  302. [
  303. object,
  304. oleautomation,
  305. uuid(b928261d-7c9e-4156-af71-6f698bd97788),
  306. pointer_default(unique)
  307. ]
  308. interface IDOMUIEvent : IDOMEvent
  309. {
  310. //readonly attribute DOMWindow view;
  311. HRESULT view([out, retval] IDOMWindow** result);
  312. //readonly attribute long detail;
  313. HRESULT detail([out, retval] long* result);
  314. //[OldStyleObjC] void initUIEvent(AtomicString type,
  315. // boolean canBubble,
  316. // boolean cancelable,
  317. // DOMWindow view,
  318. // long detail);
  319. HRESULT initUIEvent([in] BSTR type, [in] BOOL canBubble, [in] BOOL cancelable, [in] IDOMWindow* view, [in] long detail);
  320. // extentsions
  321. //readonly attribute long keyCode;
  322. HRESULT keyCode([out, retval] long* result);
  323. //readonly attribute long charCode;
  324. HRESULT charCode([out, retval] long* result);
  325. HRESULT unused1([out, retval] long* result);
  326. HRESULT unused2([out, retval] long* result);
  327. //readonly attribute long pageX;
  328. HRESULT pageX([out, retval] long* result);
  329. //readonly attribute long pageY;
  330. HRESULT pageY([out, retval] long* result);
  331. //readonly attribute long which;
  332. HRESULT which([out, retval] long* result);
  333. }
  334. [
  335. object,
  336. oleautomation,
  337. uuid(5404e6d9-a2bb-4c74-8070-ce9d2599bd00),
  338. pointer_default(unique)
  339. ]
  340. interface IDOMWheelEvent : IDOMUIEvent
  341. {
  342. //readonly attribute long screenX;
  343. HRESULT screenX([out, retval] long* result);
  344. //readonly attribute long screenY;
  345. HRESULT screenY([out, retval] long* result);
  346. //readonly attribute long clientX;
  347. HRESULT clientX([out, retval] long* result);
  348. //readonly attribute long clientY;
  349. HRESULT clientY([out, retval] long* result);
  350. //readonly attribute boolean ctrlKey;
  351. HRESULT ctrlKey([out, retval] BOOL* result);
  352. //readonly attribute boolean shiftKey;
  353. HRESULT shiftKey([out, retval] BOOL* result);
  354. //readonly attribute boolean altKey;
  355. HRESULT altKey([out, retval] BOOL* result);
  356. //readonly attribute boolean metaKey;
  357. HRESULT metaKey([out, retval] BOOL* result);
  358. //readonly attribute long wheelDelta;
  359. HRESULT wheelDelta([out, retval] long* result);
  360. //readonly attribute long wheelDeltaX;
  361. HRESULT wheelDeltaX([out, retval] long* result);
  362. //readonly attribute long wheelDeltaY;
  363. HRESULT wheelDeltaY([out, retval] long* result);
  364. // WebKit Extensions
  365. //readonly attribute long offsetX;
  366. HRESULT offsetX([out, retval] long* result);
  367. //readonly attribute long offsetY;
  368. HRESULT offsetY([out, retval] long* result);
  369. //readonly attribute long x;
  370. HRESULT x([out, retval] long* result);
  371. //readonly attribute long y;
  372. HRESULT y([out, retval] long* result);
  373. //readonly attribute boolean isHorizontal;
  374. HRESULT isHorizontal([out, retval] BOOL* result);
  375. //void initWheelEvent(long wheelDeltaX,
  376. // long wheelDeltaY,
  377. // DOMWindow view,
  378. // long screenX,
  379. // long screenY,
  380. // long clientX,
  381. // long clientY,
  382. // boolean ctrlKey,
  383. // boolean altKey,
  384. // boolean shiftKey,
  385. // boolean metaKey);
  386. HRESULT initWheelEvent([in] long wheelDeltaX, [in] long wheelDeltaY, [in] IDOMWindow* view, [in] long screenX, [in] long screenY, [in] long clientX, [in] long clientY, [in] BOOL ctrlKey, [in] BOOL altKey, [in] BOOL shiftKey, [in] BOOL metaKey);
  387. }