dom/webidl/MouseEvent.webidl

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:d49671fb68a3
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 *
6 * For more information on this interface please see
7 * http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html
8 *
9 * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
10 * liability, trademark and document use rules apply.
11 */
12
13 interface MouseEvent : UIEvent {
14 readonly attribute long screenX;
15 readonly attribute long screenY;
16 readonly attribute long clientX;
17 readonly attribute long clientY;
18 readonly attribute boolean ctrlKey;
19 readonly attribute boolean shiftKey;
20 readonly attribute boolean altKey;
21 readonly attribute boolean metaKey;
22 readonly attribute short button;
23 readonly attribute unsigned short buttons;
24 readonly attribute EventTarget? relatedTarget;
25 // Deprecated in DOM Level 3:
26 [Throws]
27 void initMouseEvent(DOMString typeArg,
28 boolean canBubbleArg,
29 boolean cancelableArg,
30 WindowProxy? viewArg,
31 long detailArg,
32 long screenXArg,
33 long screenYArg,
34 long clientXArg,
35 long clientYArg,
36 boolean ctrlKeyArg,
37 boolean altKeyArg,
38 boolean shiftKeyArg,
39 boolean metaKeyArg,
40 short buttonArg,
41 EventTarget? relatedTargetArg);
42 // Introduced in DOM Level 3:
43 boolean getModifierState(DOMString keyArg);
44 };
45
46
47 // Event Constructor Syntax:
48 [Constructor(DOMString typeArg, optional MouseEventInit mouseEventInitDict)]
49 partial interface MouseEvent
50 {
51 };
52
53 // Suggested initMouseEvent replacement initializer:
54 dictionary MouseEventInit {
55 // Attributes from Event:
56 boolean bubbles = false;
57 boolean cancelable = false;
58
59 // Attributes from UIEvent:
60 WindowProxy? view = null;
61 long detail = 0;
62
63 // Attributes for MouseEvent:
64 long screenX = 0;
65 long screenY = 0;
66 long clientX = 0;
67 long clientY = 0;
68 boolean ctrlKey = false;
69 boolean shiftKey = false;
70 boolean altKey = false;
71 boolean metaKey = false;
72 short button = 0;
73 // Note: "buttons" was not previously initializable through initMouseEvent!
74 unsigned short buttons = 0;
75 EventTarget? relatedTarget = null;
76 };
77
78 // Mozilla extensions
79 partial interface MouseEvent
80 {
81 readonly attribute long mozMovementX;
82 readonly attribute long mozMovementY;
83
84 // Finger or touch pressure event value
85 // ranges between 0.0 and 1.0
86 readonly attribute float mozPressure;
87
88 const unsigned short MOZ_SOURCE_UNKNOWN = 0;
89 const unsigned short MOZ_SOURCE_MOUSE = 1;
90 const unsigned short MOZ_SOURCE_PEN = 2;
91 const unsigned short MOZ_SOURCE_ERASER = 3;
92 const unsigned short MOZ_SOURCE_CURSOR = 4;
93 const unsigned short MOZ_SOURCE_TOUCH = 5;
94 const unsigned short MOZ_SOURCE_KEYBOARD = 6;
95
96 readonly attribute unsigned short mozInputSource;
97
98 [Throws]
99 void initNSMouseEvent(DOMString typeArg,
100 boolean canBubbleArg,
101 boolean cancelableArg,
102 WindowProxy? viewArg,
103 long detailArg,
104 long screenXArg,
105 long screenYArg,
106 long clientXArg,
107 long clientYArg,
108 boolean ctrlKeyArg,
109 boolean altKeyArg,
110 boolean shiftKeyArg,
111 boolean metaKeyArg,
112 short buttonArg,
113 EventTarget? relatedTargetArg,
114 float pressure,
115 unsigned short inputSourceArg);
116
117 };
118

mercurial