Mercurial > projects > dwt-mac
comparison dwt/internal/mozilla/nsIDOMKeyEvent.d @ 125:5583f8eeee6c
Synced mozilla with dwt-linux
author | Jacob Carlborg <doob@me.com> |
---|---|
date | Fri, 16 Jan 2009 12:49:08 +0100 |
parents | d8635bb48c7c |
children |
comparison
equal
deleted
inserted
replaced
124:540fa4e9974a | 125:5583f8eeee6c |
---|---|
1 /* ***** BEGIN LICENSE BLOCK ***** | |
2 * Version: MPL 1.1 | |
3 * | |
4 * The contents of this file are subject to the Mozilla Public License Version | |
5 * 1.1 (the "License"); you may not use this file except in compliance with | |
6 * the License. You may obtain a copy of the License at | |
7 * http://www.mozilla.org/MPL/ | |
8 * | |
9 * Software distributed under the License is distributed on an "AS IS" basis, | |
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | |
11 * for the specific language governing rights and limitations under the | |
12 * License. | |
13 * | |
14 * The Original Code is Mozilla Communicator client code, released March 31, 1998. | |
15 * | |
16 * The Initial Developer of the Original Code is | |
17 * Netscape Communications Corporation. | |
18 * Portions created by Netscape are Copyright (C) 1998-1999 | |
19 * Netscape Communications Corporation. All Rights Reserved. | |
20 * | |
21 * Contributor(s): | |
22 * | |
23 * IBM | |
24 * - Binding to permit interfacing between Mozilla and DWT | |
25 * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved. | |
26 * | |
27 * ***** END LICENSE BLOCK ***** */ | |
28 module dwt.internal.mozilla.nsIDOMKeyEvent; | 1 module dwt.internal.mozilla.nsIDOMKeyEvent; |
29 | 2 |
30 import dwt.dwthelper.utils; | 3 import dwt.internal.mozilla.Common; |
4 import dwt.internal.mozilla.nsID; | |
31 | 5 |
32 public class nsIDOMKeyEvent extends nsIDOMUIEvent { | 6 import dwt.internal.mozilla.nsIDOMUIEvent; |
7 import dwt.internal.mozilla.nsIDOMAbstractView; | |
8 import dwt.internal.mozilla.nsStringAPI; | |
33 | 9 |
34 static final int LAST_METHOD_ID = nsIDOMUIEvent.LAST_METHOD_ID + 7; | 10 const char[] NS_IDOMKEYEVENT_IID_STR = "028e0e6e-8b01-11d3-aae7-0010838a3123"; |
35 | 11 |
36 public static final String NS_IDOMKEYEVENT_IID_STR = | 12 const nsIID NS_IDOMKEYEVENT_IID= |
37 "028e0e6e-8b01-11d3-aae7-0010838a3123"; | 13 {0x028e0e6e, 0x8b01, 0x11d3, |
14 [ 0xaa, 0xe7, 0x00, 0x10, 0x83, 0x8a, 0x31, 0x23 ]}; | |
38 | 15 |
39 public static final nsID NS_IDOMKEYEVENT_IID = | 16 interface nsIDOMKeyEvent : nsIDOMUIEvent { |
40 new nsID(NS_IDOMKEYEVENT_IID_STR); | |
41 | 17 |
42 public nsIDOMKeyEvent(int /*long*/ address) { | 18 static const char[] IID_STR = NS_IDOMKEYEVENT_IID_STR; |
43 super(address); | 19 static const nsIID IID = NS_IDOMKEYEVENT_IID; |
44 } | |
45 | 20 |
46 public static final int DOM_VK_CANCEL = 3; | 21 extern(System): |
22 enum { DOM_VK_CANCEL = 3U }; | |
23 enum { DOM_VK_HELP = 6U }; | |
24 enum { DOM_VK_BACK_SPACE = 8U }; | |
25 enum { DOM_VK_TAB = 9U }; | |
26 enum { DOM_VK_CLEAR = 12U }; | |
27 enum { DOM_VK_RETURN = 13U }; | |
28 enum { DOM_VK_ENTER = 14U }; | |
29 enum { DOM_VK_SHIFT = 16U }; | |
30 enum { DOM_VK_CONTROL = 17U }; | |
31 enum { DOM_VK_ALT = 18U }; | |
32 enum { DOM_VK_PAUSE = 19U }; | |
33 enum { DOM_VK_CAPS_LOCK = 20U }; | |
34 enum { DOM_VK_ESCAPE = 27U }; | |
35 enum { DOM_VK_SPACE = 32U }; | |
36 enum { DOM_VK_PAGE_UP = 33U }; | |
37 enum { DOM_VK_PAGE_DOWN = 34U }; | |
38 enum { DOM_VK_END = 35U }; | |
39 enum { DOM_VK_HOME = 36U }; | |
40 enum { DOM_VK_LEFT = 37U }; | |
41 enum { DOM_VK_UP = 38U }; | |
42 enum { DOM_VK_RIGHT = 39U }; | |
43 enum { DOM_VK_DOWN = 40U }; | |
44 enum { DOM_VK_PRINTSCREEN = 44U }; | |
45 enum { DOM_VK_INSERT = 45U }; | |
46 enum { DOM_VK_DELETE = 46U }; | |
47 enum { DOM_VK_0 = 48U }; | |
48 enum { DOM_VK_1 = 49U }; | |
49 enum { DOM_VK_2 = 50U }; | |
50 enum { DOM_VK_3 = 51U }; | |
51 enum { DOM_VK_4 = 52U }; | |
52 enum { DOM_VK_5 = 53U }; | |
53 enum { DOM_VK_6 = 54U }; | |
54 enum { DOM_VK_7 = 55U }; | |
55 enum { DOM_VK_8 = 56U }; | |
56 enum { DOM_VK_9 = 57U }; | |
57 enum { DOM_VK_SEMICOLON = 59U }; | |
58 enum { DOM_VK_EQUALS = 61U }; | |
59 enum { DOM_VK_A = 65U }; | |
60 enum { DOM_VK_B = 66U }; | |
61 enum { DOM_VK_C = 67U }; | |
62 enum { DOM_VK_D = 68U }; | |
63 enum { DOM_VK_E = 69U }; | |
64 enum { DOM_VK_F = 70U }; | |
65 enum { DOM_VK_G = 71U }; | |
66 enum { DOM_VK_H = 72U }; | |
67 enum { DOM_VK_I = 73U }; | |
68 enum { DOM_VK_J = 74U }; | |
69 enum { DOM_VK_K = 75U }; | |
70 enum { DOM_VK_L = 76U }; | |
71 enum { DOM_VK_M = 77U }; | |
72 enum { DOM_VK_N = 78U }; | |
73 enum { DOM_VK_O = 79U }; | |
74 enum { DOM_VK_P = 80U }; | |
75 enum { DOM_VK_Q = 81U }; | |
76 enum { DOM_VK_R = 82U }; | |
77 enum { DOM_VK_S = 83U }; | |
78 enum { DOM_VK_T = 84U }; | |
79 enum { DOM_VK_U = 85U }; | |
80 enum { DOM_VK_V = 86U }; | |
81 enum { DOM_VK_W = 87U }; | |
82 enum { DOM_VK_X = 88U }; | |
83 enum { DOM_VK_Y = 89U }; | |
84 enum { DOM_VK_Z = 90U }; | |
85 enum { DOM_VK_CONTEXT_MENU = 93U }; | |
86 enum { DOM_VK_NUMPAD0 = 96U }; | |
87 enum { DOM_VK_NUMPAD1 = 97U }; | |
88 enum { DOM_VK_NUMPAD2 = 98U }; | |
89 enum { DOM_VK_NUMPAD3 = 99U }; | |
90 enum { DOM_VK_NUMPAD4 = 100U }; | |
91 enum { DOM_VK_NUMPAD5 = 101U }; | |
92 enum { DOM_VK_NUMPAD6 = 102U }; | |
93 enum { DOM_VK_NUMPAD7 = 103U }; | |
94 enum { DOM_VK_NUMPAD8 = 104U }; | |
95 enum { DOM_VK_NUMPAD9 = 105U }; | |
96 enum { DOM_VK_MULTIPLY = 106U }; | |
97 enum { DOM_VK_ADD = 107U }; | |
98 enum { DOM_VK_SEPARATOR = 108U }; | |
99 enum { DOM_VK_SUBTRACT = 109U }; | |
100 enum { DOM_VK_DECIMAL = 110U }; | |
101 enum { DOM_VK_DIVIDE = 111U }; | |
102 enum { DOM_VK_F1 = 112U }; | |
103 enum { DOM_VK_F2 = 113U }; | |
104 enum { DOM_VK_F3 = 114U }; | |
105 enum { DOM_VK_F4 = 115U }; | |
106 enum { DOM_VK_F5 = 116U }; | |
107 enum { DOM_VK_F6 = 117U }; | |
108 enum { DOM_VK_F7 = 118U }; | |
109 enum { DOM_VK_F8 = 119U }; | |
110 enum { DOM_VK_F9 = 120U }; | |
111 enum { DOM_VK_F10 = 121U }; | |
112 enum { DOM_VK_F11 = 122U }; | |
113 enum { DOM_VK_F12 = 123U }; | |
114 enum { DOM_VK_F13 = 124U }; | |
115 enum { DOM_VK_F14 = 125U }; | |
116 enum { DOM_VK_F15 = 126U }; | |
117 enum { DOM_VK_F16 = 127U }; | |
118 enum { DOM_VK_F17 = 128U }; | |
119 enum { DOM_VK_F18 = 129U }; | |
120 enum { DOM_VK_F19 = 130U }; | |
121 enum { DOM_VK_F20 = 131U }; | |
122 enum { DOM_VK_F21 = 132U }; | |
123 enum { DOM_VK_F22 = 133U }; | |
124 enum { DOM_VK_F23 = 134U }; | |
125 enum { DOM_VK_F24 = 135U }; | |
126 enum { DOM_VK_NUM_LOCK = 144U }; | |
127 enum { DOM_VK_SCROLL_LOCK = 145U }; | |
128 enum { DOM_VK_COMMA = 188U }; | |
129 enum { DOM_VK_PERIOD = 190U }; | |
130 enum { DOM_VK_SLASH = 191U }; | |
131 enum { DOM_VK_BACK_QUOTE = 192U }; | |
132 enum { DOM_VK_OPEN_BRACKET = 219U }; | |
133 enum { DOM_VK_BACK_SLASH = 220U }; | |
134 enum { DOM_VK_CLOSE_BRACKET = 221U }; | |
135 enum { DOM_VK_QUOTE = 222U }; | |
136 enum { DOM_VK_META = 224U }; | |
47 | 137 |
48 public static final int DOM_VK_HELP = 6; | 138 nsresult GetCharCode(PRUint32 *aCharCode); |
139 nsresult GetKeyCode(PRUint32 *aKeyCode); | |
140 nsresult GetAltKey(PRBool *aAltKey); | |
141 nsresult GetCtrlKey(PRBool *aCtrlKey); | |
142 nsresult GetShiftKey(PRBool *aShiftKey); | |
143 nsresult GetMetaKey(PRBool *aMetaKey); | |
49 | 144 |
50 public static final int DOM_VK_BACK_SPACE = 8; | 145 nsresult InitKeyEvent(nsAString * typeArg, PRBool canBubbleArg, PRBool cancelableArg, nsIDOMAbstractView viewArg, PRBool ctrlKeyArg, PRBool altKeyArg, PRBool shiftKeyArg, PRBool metaKeyArg, PRUint32 keyCodeArg, PRUint32 charCodeArg); |
51 | 146 |
52 public static final int DOM_VK_TAB = 9; | 147 } |
53 | 148 |
54 public static final int DOM_VK_CLEAR = 12; | |
55 | |
56 public static final int DOM_VK_RETURN = 13; | |
57 | |
58 public static final int DOM_VK_ENTER = 14; | |
59 | |
60 public static final int DOM_VK_SHIFT = 16; | |
61 | |
62 public static final int DOM_VK_CONTROL = 17; | |
63 | |
64 public static final int DOM_VK_ALT = 18; | |
65 | |
66 public static final int DOM_VK_PAUSE = 19; | |
67 | |
68 public static final int DOM_VK_CAPS_LOCK = 20; | |
69 | |
70 public static final int DOM_VK_ESCAPE = 27; | |
71 | |
72 public static final int DOM_VK_SPACE = 32; | |
73 | |
74 public static final int DOM_VK_PAGE_UP = 33; | |
75 | |
76 public static final int DOM_VK_PAGE_DOWN = 34; | |
77 | |
78 public static final int DOM_VK_END = 35; | |
79 | |
80 public static final int DOM_VK_HOME = 36; | |
81 | |
82 public static final int DOM_VK_LEFT = 37; | |
83 | |
84 public static final int DOM_VK_UP = 38; | |
85 | |
86 public static final int DOM_VK_RIGHT = 39; | |
87 | |
88 public static final int DOM_VK_DOWN = 40; | |
89 | |
90 public static final int DOM_VK_PRINTSCREEN = 44; | |
91 | |
92 public static final int DOM_VK_INSERT = 45; | |
93 | |
94 public static final int DOM_VK_DELETE = 46; | |
95 | |
96 public static final int DOM_VK_0 = 48; | |
97 | |
98 public static final int DOM_VK_1 = 49; | |
99 | |
100 public static final int DOM_VK_2 = 50; | |
101 | |
102 public static final int DOM_VK_3 = 51; | |
103 | |
104 public static final int DOM_VK_4 = 52; | |
105 | |
106 public static final int DOM_VK_5 = 53; | |
107 | |
108 public static final int DOM_VK_6 = 54; | |
109 | |
110 public static final int DOM_VK_7 = 55; | |
111 | |
112 public static final int DOM_VK_8 = 56; | |
113 | |
114 public static final int DOM_VK_9 = 57; | |
115 | |
116 public static final int DOM_VK_SEMICOLON = 59; | |
117 | |
118 public static final int DOM_VK_EQUALS = 61; | |
119 | |
120 public static final int DOM_VK_A = 65; | |
121 | |
122 public static final int DOM_VK_B = 66; | |
123 | |
124 public static final int DOM_VK_C = 67; | |
125 | |
126 public static final int DOM_VK_D = 68; | |
127 | |
128 public static final int DOM_VK_E = 69; | |
129 | |
130 public static final int DOM_VK_F = 70; | |
131 | |
132 public static final int DOM_VK_G = 71; | |
133 | |
134 public static final int DOM_VK_H = 72; | |
135 | |
136 public static final int DOM_VK_I = 73; | |
137 | |
138 public static final int DOM_VK_J = 74; | |
139 | |
140 public static final int DOM_VK_K = 75; | |
141 | |
142 public static final int DOM_VK_L = 76; | |
143 | |
144 public static final int DOM_VK_M = 77; | |
145 | |
146 public static final int DOM_VK_N = 78; | |
147 | |
148 public static final int DOM_VK_O = 79; | |
149 | |
150 public static final int DOM_VK_P = 80; | |
151 | |
152 public static final int DOM_VK_Q = 81; | |
153 | |
154 public static final int DOM_VK_R = 82; | |
155 | |
156 public static final int DOM_VK_S = 83; | |
157 | |
158 public static final int DOM_VK_T = 84; | |
159 | |
160 public static final int DOM_VK_U = 85; | |
161 | |
162 public static final int DOM_VK_V = 86; | |
163 | |
164 public static final int DOM_VK_W = 87; | |
165 | |
166 public static final int DOM_VK_X = 88; | |
167 | |
168 public static final int DOM_VK_Y = 89; | |
169 | |
170 public static final int DOM_VK_Z = 90; | |
171 | |
172 public static final int DOM_VK_NUMPAD0 = 96; | |
173 | |
174 public static final int DOM_VK_NUMPAD1 = 97; | |
175 | |
176 public static final int DOM_VK_NUMPAD2 = 98; | |
177 | |
178 public static final int DOM_VK_NUMPAD3 = 99; | |
179 | |
180 public static final int DOM_VK_NUMPAD4 = 100; | |
181 | |
182 public static final int DOM_VK_NUMPAD5 = 101; | |
183 | |
184 public static final int DOM_VK_NUMPAD6 = 102; | |
185 | |
186 public static final int DOM_VK_NUMPAD7 = 103; | |
187 | |
188 public static final int DOM_VK_NUMPAD8 = 104; | |
189 | |
190 public static final int DOM_VK_NUMPAD9 = 105; | |
191 | |
192 public static final int DOM_VK_MULTIPLY = 106; | |
193 | |
194 public static final int DOM_VK_ADD = 107; | |
195 | |
196 public static final int DOM_VK_SEPARATOR = 108; | |
197 | |
198 public static final int DOM_VK_SUBTRACT = 109; | |
199 | |
200 public static final int DOM_VK_DECIMAL = 110; | |
201 | |
202 public static final int DOM_VK_DIVIDE = 111; | |
203 | |
204 public static final int DOM_VK_F1 = 112; | |
205 | |
206 public static final int DOM_VK_F2 = 113; | |
207 | |
208 public static final int DOM_VK_F3 = 114; | |
209 | |
210 public static final int DOM_VK_F4 = 115; | |
211 | |
212 public static final int DOM_VK_F5 = 116; | |
213 | |
214 public static final int DOM_VK_F6 = 117; | |
215 | |
216 public static final int DOM_VK_F7 = 118; | |
217 | |
218 public static final int DOM_VK_F8 = 119; | |
219 | |
220 public static final int DOM_VK_F9 = 120; | |
221 | |
222 public static final int DOM_VK_F10 = 121; | |
223 | |
224 public static final int DOM_VK_F11 = 122; | |
225 | |
226 public static final int DOM_VK_F12 = 123; | |
227 | |
228 public static final int DOM_VK_F13 = 124; | |
229 | |
230 public static final int DOM_VK_F14 = 125; | |
231 | |
232 public static final int DOM_VK_F15 = 126; | |
233 | |
234 public static final int DOM_VK_F16 = 127; | |
235 | |
236 public static final int DOM_VK_F17 = 128; | |
237 | |
238 public static final int DOM_VK_F18 = 129; | |
239 | |
240 public static final int DOM_VK_F19 = 130; | |
241 | |
242 public static final int DOM_VK_F20 = 131; | |
243 | |
244 public static final int DOM_VK_F21 = 132; | |
245 | |
246 public static final int DOM_VK_F22 = 133; | |
247 | |
248 public static final int DOM_VK_F23 = 134; | |
249 | |
250 public static final int DOM_VK_F24 = 135; | |
251 | |
252 public static final int DOM_VK_NUM_LOCK = 144; | |
253 | |
254 public static final int DOM_VK_SCROLL_LOCK = 145; | |
255 | |
256 public static final int DOM_VK_COMMA = 188; | |
257 | |
258 public static final int DOM_VK_PERIOD = 190; | |
259 | |
260 public static final int DOM_VK_SLASH = 191; | |
261 | |
262 public static final int DOM_VK_BACK_QUOTE = 192; | |
263 | |
264 public static final int DOM_VK_OPEN_BRACKET = 219; | |
265 | |
266 public static final int DOM_VK_BACK_SLASH = 220; | |
267 | |
268 public static final int DOM_VK_CLOSE_BRACKET = 221; | |
269 | |
270 public static final int DOM_VK_QUOTE = 222; | |
271 | |
272 public static final int DOM_VK_META = 224; | |
273 | |
274 public int GetCharCode(int[] aCharCode) { | |
275 return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 1, getAddress(), aCharCode); | |
276 } | |
277 | |
278 public int GetKeyCode(int[] aKeyCode) { | |
279 return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 2, getAddress(), aKeyCode); | |
280 } | |
281 | |
282 public int GetAltKey(int[] aAltKey) { | |
283 return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 3, getAddress(), aAltKey); | |
284 } | |
285 | |
286 public int GetCtrlKey(int[] aCtrlKey) { | |
287 return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 4, getAddress(), aCtrlKey); | |
288 } | |
289 | |
290 public int GetShiftKey(int[] aShiftKey) { | |
291 return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 5, getAddress(), aShiftKey); | |
292 } | |
293 | |
294 public int GetMetaKey(int[] aMetaKey) { | |
295 return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 6, getAddress(), aMetaKey); | |
296 } | |
297 | |
298 public int InitKeyEvent(int /*long*/ typeArg, int canBubbleArg, int cancelableArg, int /*long*/ viewArg, int ctrlKeyArg, int altKeyArg, int shiftKeyArg, int metaKeyArg, int keyCodeArg, int charCodeArg) { | |
299 return XPCOM.VtblCall(nsIDOMUIEvent.LAST_METHOD_ID + 7, getAddress(), typeArg, canBubbleArg, cancelableArg, viewArg, ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, keyCodeArg, charCodeArg); | |
300 } | |
301 } |