/work/obj-fuzz/dist/include/mozilla/dom/KeyboardEventBinding.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* THIS FILE IS AUTOGENERATED FROM KeyboardEvent.webidl BY Codegen.py - DO NOT EDIT */ |
2 | | |
3 | | #ifndef mozilla_dom_KeyboardEventBinding_h |
4 | | #define mozilla_dom_KeyboardEventBinding_h |
5 | | |
6 | | #include "GeckoProfiler.h" |
7 | | #include "UIEventBinding.h" |
8 | | #include "js/RootingAPI.h" |
9 | | #include "jspubtd.h" |
10 | | #include "mozilla/ErrorResult.h" |
11 | | #include "mozilla/dom/BindingDeclarations.h" |
12 | | #include "mozilla/dom/Nullable.h" |
13 | | #include "mozilla/dom/PrototypeList.h" |
14 | | #include "nsGlobalWindow.h" |
15 | | |
16 | | class nsGlobalWindowInner; |
17 | | |
18 | | namespace mozilla { |
19 | | namespace dom { |
20 | | |
21 | | class KeyboardEvent; |
22 | | struct KeyboardEventAtoms; |
23 | | struct KeyboardEventInitAtoms; |
24 | | struct NativePropertyHooks; |
25 | | class ProtoAndIfaceCache; |
26 | | |
27 | | } // namespace dom |
28 | | } // namespace mozilla |
29 | | |
30 | | namespace mozilla { |
31 | | namespace dom { |
32 | | |
33 | | struct KeyboardEventInit : public EventModifierInit |
34 | | { |
35 | | MOZ_INIT_OUTSIDE_CTOR uint32_t mCharCode; |
36 | | MOZ_INIT_OUTSIDE_CTOR nsString mCode; |
37 | | MOZ_INIT_OUTSIDE_CTOR bool mIsComposing; |
38 | | MOZ_INIT_OUTSIDE_CTOR nsString mKey; |
39 | | MOZ_INIT_OUTSIDE_CTOR uint32_t mKeyCode; |
40 | | MOZ_INIT_OUTSIDE_CTOR uint32_t mLocation; |
41 | | MOZ_INIT_OUTSIDE_CTOR bool mRepeat; |
42 | | MOZ_INIT_OUTSIDE_CTOR uint32_t mWhich; |
43 | | |
44 | | KeyboardEventInit(); |
45 | | |
46 | | explicit inline KeyboardEventInit(const FastDictionaryInitializer& ) |
47 | | : EventModifierInit(FastDictionaryInitializer()) |
48 | 0 | { |
49 | 0 | // Do nothing here; this is used by our "Fast" subclass |
50 | 0 | } |
51 | | |
52 | | explicit inline KeyboardEventInit(const KeyboardEventInit& aOther) |
53 | 0 | { |
54 | 0 | *this = aOther; |
55 | 0 | } |
56 | | |
57 | | bool |
58 | | Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false); |
59 | | |
60 | | bool |
61 | | Init(const nsAString& aJSON); |
62 | | |
63 | | bool |
64 | | ToObjectInternal(JSContext* cx, JS::MutableHandle<JS::Value> rval) const; |
65 | | |
66 | | bool |
67 | | ToJSON(nsAString& aJSON) const; |
68 | | |
69 | | void |
70 | | TraceDictionary(JSTracer* trc); |
71 | | |
72 | | inline void |
73 | | TraverseForCC(nsCycleCollectionTraversalCallback& aCallback, uint32_t aFlags) |
74 | 0 | { |
75 | 0 | EventModifierInit::TraverseForCC(aCallback, aFlags); |
76 | 0 | } |
77 | | |
78 | | inline void |
79 | | UnlinkForCC() |
80 | 0 | { |
81 | 0 | EventModifierInit::UnlinkForCC(); |
82 | 0 | } |
83 | | |
84 | | KeyboardEventInit& |
85 | | operator=(const KeyboardEventInit& aOther); |
86 | | |
87 | | private: |
88 | | static bool |
89 | | InitIds(JSContext* cx, KeyboardEventInitAtoms* atomsCache); |
90 | | }; |
91 | | |
92 | | namespace binding_detail { |
93 | | struct FastKeyboardEventInit : public KeyboardEventInit |
94 | | { |
95 | | inline FastKeyboardEventInit() |
96 | | : KeyboardEventInit(FastDictionaryInitializer()) |
97 | 0 | { |
98 | 0 | // Doesn't matter what int we pass to the parent constructor |
99 | 0 | } |
100 | | }; |
101 | | } // namespace binding_detail |
102 | | |
103 | | |
104 | | namespace KeyboardEvent_Binding { |
105 | | |
106 | | typedef mozilla::dom::KeyboardEvent NativeType; |
107 | | |
108 | | static const uint32_t DOM_KEY_LOCATION_STANDARD = 0; |
109 | | static const uint32_t DOM_KEY_LOCATION_LEFT = 1; |
110 | | static const uint32_t DOM_KEY_LOCATION_RIGHT = 2; |
111 | | static const uint32_t DOM_KEY_LOCATION_NUMPAD = 3; |
112 | | static const uint32_t DOM_VK_CANCEL = 3; |
113 | | static const uint32_t DOM_VK_HELP = 6; |
114 | | static const uint32_t DOM_VK_BACK_SPACE = 8; |
115 | | static const uint32_t DOM_VK_TAB = 9; |
116 | | static const uint32_t DOM_VK_CLEAR = 12; |
117 | | static const uint32_t DOM_VK_RETURN = 13; |
118 | | static const uint32_t DOM_VK_SHIFT = 16; |
119 | | static const uint32_t DOM_VK_CONTROL = 17; |
120 | | static const uint32_t DOM_VK_ALT = 18; |
121 | | static const uint32_t DOM_VK_PAUSE = 19; |
122 | | static const uint32_t DOM_VK_CAPS_LOCK = 20; |
123 | | static const uint32_t DOM_VK_KANA = 21; |
124 | | static const uint32_t DOM_VK_HANGUL = 21; |
125 | | static const uint32_t DOM_VK_EISU = 22; |
126 | | static const uint32_t DOM_VK_JUNJA = 23; |
127 | | static const uint32_t DOM_VK_FINAL = 24; |
128 | | static const uint32_t DOM_VK_HANJA = 25; |
129 | | static const uint32_t DOM_VK_KANJI = 25; |
130 | | static const uint32_t DOM_VK_ESCAPE = 27; |
131 | | static const uint32_t DOM_VK_CONVERT = 28; |
132 | | static const uint32_t DOM_VK_NONCONVERT = 29; |
133 | | static const uint32_t DOM_VK_ACCEPT = 30; |
134 | | static const uint32_t DOM_VK_MODECHANGE = 31; |
135 | | static const uint32_t DOM_VK_SPACE = 32; |
136 | | static const uint32_t DOM_VK_PAGE_UP = 33; |
137 | | static const uint32_t DOM_VK_PAGE_DOWN = 34; |
138 | | static const uint32_t DOM_VK_END = 35; |
139 | | static const uint32_t DOM_VK_HOME = 36; |
140 | | static const uint32_t DOM_VK_LEFT = 37; |
141 | | static const uint32_t DOM_VK_UP = 38; |
142 | | static const uint32_t DOM_VK_RIGHT = 39; |
143 | | static const uint32_t DOM_VK_DOWN = 40; |
144 | | static const uint32_t DOM_VK_SELECT = 41; |
145 | | static const uint32_t DOM_VK_PRINT = 42; |
146 | | static const uint32_t DOM_VK_EXECUTE = 43; |
147 | | static const uint32_t DOM_VK_PRINTSCREEN = 44; |
148 | | static const uint32_t DOM_VK_INSERT = 45; |
149 | | static const uint32_t DOM_VK_DELETE = 46; |
150 | | static const uint32_t DOM_VK_0 = 48; |
151 | | static const uint32_t DOM_VK_1 = 49; |
152 | | static const uint32_t DOM_VK_2 = 50; |
153 | | static const uint32_t DOM_VK_3 = 51; |
154 | | static const uint32_t DOM_VK_4 = 52; |
155 | | static const uint32_t DOM_VK_5 = 53; |
156 | | static const uint32_t DOM_VK_6 = 54; |
157 | | static const uint32_t DOM_VK_7 = 55; |
158 | | static const uint32_t DOM_VK_8 = 56; |
159 | | static const uint32_t DOM_VK_9 = 57; |
160 | | static const uint32_t DOM_VK_COLON = 58; |
161 | | static const uint32_t DOM_VK_SEMICOLON = 59; |
162 | | static const uint32_t DOM_VK_LESS_THAN = 60; |
163 | | static const uint32_t DOM_VK_EQUALS = 61; |
164 | | static const uint32_t DOM_VK_GREATER_THAN = 62; |
165 | | static const uint32_t DOM_VK_QUESTION_MARK = 63; |
166 | | static const uint32_t DOM_VK_AT = 64; |
167 | | static const uint32_t DOM_VK_A = 65; |
168 | | static const uint32_t DOM_VK_B = 66; |
169 | | static const uint32_t DOM_VK_C = 67; |
170 | | static const uint32_t DOM_VK_D = 68; |
171 | | static const uint32_t DOM_VK_E = 69; |
172 | | static const uint32_t DOM_VK_F = 70; |
173 | | static const uint32_t DOM_VK_G = 71; |
174 | | static const uint32_t DOM_VK_H = 72; |
175 | | static const uint32_t DOM_VK_I = 73; |
176 | | static const uint32_t DOM_VK_J = 74; |
177 | | static const uint32_t DOM_VK_K = 75; |
178 | | static const uint32_t DOM_VK_L = 76; |
179 | | static const uint32_t DOM_VK_M = 77; |
180 | | static const uint32_t DOM_VK_N = 78; |
181 | | static const uint32_t DOM_VK_O = 79; |
182 | | static const uint32_t DOM_VK_P = 80; |
183 | | static const uint32_t DOM_VK_Q = 81; |
184 | | static const uint32_t DOM_VK_R = 82; |
185 | | static const uint32_t DOM_VK_S = 83; |
186 | | static const uint32_t DOM_VK_T = 84; |
187 | | static const uint32_t DOM_VK_U = 85; |
188 | | static const uint32_t DOM_VK_V = 86; |
189 | | static const uint32_t DOM_VK_W = 87; |
190 | | static const uint32_t DOM_VK_X = 88; |
191 | | static const uint32_t DOM_VK_Y = 89; |
192 | | static const uint32_t DOM_VK_Z = 90; |
193 | | static const uint32_t DOM_VK_WIN = 91; |
194 | | static const uint32_t DOM_VK_CONTEXT_MENU = 93; |
195 | | static const uint32_t DOM_VK_SLEEP = 95; |
196 | | static const uint32_t DOM_VK_NUMPAD0 = 96; |
197 | | static const uint32_t DOM_VK_NUMPAD1 = 97; |
198 | | static const uint32_t DOM_VK_NUMPAD2 = 98; |
199 | | static const uint32_t DOM_VK_NUMPAD3 = 99; |
200 | | static const uint32_t DOM_VK_NUMPAD4 = 100; |
201 | | static const uint32_t DOM_VK_NUMPAD5 = 101; |
202 | | static const uint32_t DOM_VK_NUMPAD6 = 102; |
203 | | static const uint32_t DOM_VK_NUMPAD7 = 103; |
204 | | static const uint32_t DOM_VK_NUMPAD8 = 104; |
205 | | static const uint32_t DOM_VK_NUMPAD9 = 105; |
206 | | static const uint32_t DOM_VK_MULTIPLY = 106; |
207 | | static const uint32_t DOM_VK_ADD = 107; |
208 | | static const uint32_t DOM_VK_SEPARATOR = 108; |
209 | | static const uint32_t DOM_VK_SUBTRACT = 109; |
210 | | static const uint32_t DOM_VK_DECIMAL = 110; |
211 | | static const uint32_t DOM_VK_DIVIDE = 111; |
212 | | static const uint32_t DOM_VK_F1 = 112; |
213 | | static const uint32_t DOM_VK_F2 = 113; |
214 | | static const uint32_t DOM_VK_F3 = 114; |
215 | | static const uint32_t DOM_VK_F4 = 115; |
216 | | static const uint32_t DOM_VK_F5 = 116; |
217 | | static const uint32_t DOM_VK_F6 = 117; |
218 | | static const uint32_t DOM_VK_F7 = 118; |
219 | | static const uint32_t DOM_VK_F8 = 119; |
220 | | static const uint32_t DOM_VK_F9 = 120; |
221 | | static const uint32_t DOM_VK_F10 = 121; |
222 | | static const uint32_t DOM_VK_F11 = 122; |
223 | | static const uint32_t DOM_VK_F12 = 123; |
224 | | static const uint32_t DOM_VK_F13 = 124; |
225 | | static const uint32_t DOM_VK_F14 = 125; |
226 | | static const uint32_t DOM_VK_F15 = 126; |
227 | | static const uint32_t DOM_VK_F16 = 127; |
228 | | static const uint32_t DOM_VK_F17 = 128; |
229 | | static const uint32_t DOM_VK_F18 = 129; |
230 | | static const uint32_t DOM_VK_F19 = 130; |
231 | | static const uint32_t DOM_VK_F20 = 131; |
232 | | static const uint32_t DOM_VK_F21 = 132; |
233 | | static const uint32_t DOM_VK_F22 = 133; |
234 | | static const uint32_t DOM_VK_F23 = 134; |
235 | | static const uint32_t DOM_VK_F24 = 135; |
236 | | static const uint32_t DOM_VK_NUM_LOCK = 144; |
237 | | static const uint32_t DOM_VK_SCROLL_LOCK = 145; |
238 | | static const uint32_t DOM_VK_WIN_OEM_FJ_JISHO = 146; |
239 | | static const uint32_t DOM_VK_WIN_OEM_FJ_MASSHOU = 147; |
240 | | static const uint32_t DOM_VK_WIN_OEM_FJ_TOUROKU = 148; |
241 | | static const uint32_t DOM_VK_WIN_OEM_FJ_LOYA = 149; |
242 | | static const uint32_t DOM_VK_WIN_OEM_FJ_ROYA = 150; |
243 | | static const uint32_t DOM_VK_CIRCUMFLEX = 160; |
244 | | static const uint32_t DOM_VK_EXCLAMATION = 161; |
245 | | static const uint32_t DOM_VK_DOUBLE_QUOTE = 162; |
246 | | static const uint32_t DOM_VK_HASH = 163; |
247 | | static const uint32_t DOM_VK_DOLLAR = 164; |
248 | | static const uint32_t DOM_VK_PERCENT = 165; |
249 | | static const uint32_t DOM_VK_AMPERSAND = 166; |
250 | | static const uint32_t DOM_VK_UNDERSCORE = 167; |
251 | | static const uint32_t DOM_VK_OPEN_PAREN = 168; |
252 | | static const uint32_t DOM_VK_CLOSE_PAREN = 169; |
253 | | static const uint32_t DOM_VK_ASTERISK = 170; |
254 | | static const uint32_t DOM_VK_PLUS = 171; |
255 | | static const uint32_t DOM_VK_PIPE = 172; |
256 | | static const uint32_t DOM_VK_HYPHEN_MINUS = 173; |
257 | | static const uint32_t DOM_VK_OPEN_CURLY_BRACKET = 174; |
258 | | static const uint32_t DOM_VK_CLOSE_CURLY_BRACKET = 175; |
259 | | static const uint32_t DOM_VK_TILDE = 176; |
260 | | static const uint32_t DOM_VK_VOLUME_MUTE = 181; |
261 | | static const uint32_t DOM_VK_VOLUME_DOWN = 182; |
262 | | static const uint32_t DOM_VK_VOLUME_UP = 183; |
263 | | static const uint32_t DOM_VK_COMMA = 188; |
264 | | static const uint32_t DOM_VK_PERIOD = 190; |
265 | | static const uint32_t DOM_VK_SLASH = 191; |
266 | | static const uint32_t DOM_VK_BACK_QUOTE = 192; |
267 | | static const uint32_t DOM_VK_OPEN_BRACKET = 219; |
268 | | static const uint32_t DOM_VK_BACK_SLASH = 220; |
269 | | static const uint32_t DOM_VK_CLOSE_BRACKET = 221; |
270 | | static const uint32_t DOM_VK_QUOTE = 222; |
271 | | static const uint32_t DOM_VK_META = 224; |
272 | | static const uint32_t DOM_VK_ALTGR = 225; |
273 | | static const uint32_t DOM_VK_WIN_ICO_HELP = 227; |
274 | | static const uint32_t DOM_VK_WIN_ICO_00 = 228; |
275 | | static const uint32_t DOM_VK_PROCESSKEY = 229; |
276 | | static const uint32_t DOM_VK_WIN_ICO_CLEAR = 230; |
277 | | static const uint32_t DOM_VK_WIN_OEM_RESET = 233; |
278 | | static const uint32_t DOM_VK_WIN_OEM_JUMP = 234; |
279 | | static const uint32_t DOM_VK_WIN_OEM_PA1 = 235; |
280 | | static const uint32_t DOM_VK_WIN_OEM_PA2 = 236; |
281 | | static const uint32_t DOM_VK_WIN_OEM_PA3 = 237; |
282 | | static const uint32_t DOM_VK_WIN_OEM_WSCTRL = 238; |
283 | | static const uint32_t DOM_VK_WIN_OEM_CUSEL = 239; |
284 | | static const uint32_t DOM_VK_WIN_OEM_ATTN = 240; |
285 | | static const uint32_t DOM_VK_WIN_OEM_FINISH = 241; |
286 | | static const uint32_t DOM_VK_WIN_OEM_COPY = 242; |
287 | | static const uint32_t DOM_VK_WIN_OEM_AUTO = 243; |
288 | | static const uint32_t DOM_VK_WIN_OEM_ENLW = 244; |
289 | | static const uint32_t DOM_VK_WIN_OEM_BACKTAB = 245; |
290 | | static const uint32_t DOM_VK_ATTN = 246; |
291 | | static const uint32_t DOM_VK_CRSEL = 247; |
292 | | static const uint32_t DOM_VK_EXSEL = 248; |
293 | | static const uint32_t DOM_VK_EREOF = 249; |
294 | | static const uint32_t DOM_VK_PLAY = 250; |
295 | | static const uint32_t DOM_VK_ZOOM = 251; |
296 | | static const uint32_t DOM_VK_PA1 = 253; |
297 | | static const uint32_t DOM_VK_WIN_OEM_CLEAR = 254; |
298 | | const JSClass* |
299 | | GetJSClass(); |
300 | | |
301 | | bool |
302 | | Wrap(JSContext* aCx, mozilla::dom::KeyboardEvent* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector); |
303 | | |
304 | | template <class T> |
305 | | inline JSObject* Wrap(JSContext* aCx, T* aObject, JS::Handle<JSObject*> aGivenProto) |
306 | 0 | { |
307 | 0 | JS::Rooted<JSObject*> reflector(aCx); |
308 | 0 | return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; |
309 | 0 | } |
310 | | |
311 | | // We declare this as an array so that retrieving a pointer to this |
312 | | // binding's property hooks only requires compile/link-time resolvable |
313 | | // address arithmetic. Declaring it as a pointer instead would require |
314 | | // doing a run-time load to fetch a pointer to this binding's property |
315 | | // hooks. And then structures which embedded a pointer to this structure |
316 | | // would require a run-time load for proper initialization, which would |
317 | | // then induce static constructors. Lots of static constructors. |
318 | | extern const NativePropertyHooks sNativePropertyHooks[]; |
319 | | |
320 | | void |
321 | | CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, bool aDefineOnGlobal); |
322 | | |
323 | | inline JS::Handle<JSObject*> GetProtoObjectHandle(JSContext* aCx) |
324 | 0 | { |
325 | 0 | /* Get the interface prototype object for this class. This will create the |
326 | 0 | object as needed. */ |
327 | 0 | return GetPerInterfaceObjectHandle(aCx, prototypes::id::KeyboardEvent, |
328 | 0 | &CreateInterfaceObjects, |
329 | 0 | /* aDefineOnGlobal = */ true); |
330 | 0 |
|
331 | 0 | } |
332 | | |
333 | | inline JS::Handle<JSObject*> GetConstructorObjectHandle(JSContext* aCx, bool aDefineOnGlobal = true) |
334 | 0 | { |
335 | 0 | /* Get the interface object for this class. This will create the object as |
336 | 0 | needed. */ |
337 | 0 |
|
338 | 0 | return GetPerInterfaceObjectHandle(aCx, constructors::id::KeyboardEvent, |
339 | 0 | &CreateInterfaceObjects, |
340 | 0 | aDefineOnGlobal); |
341 | 0 | } |
342 | | |
343 | | JSObject* |
344 | | GetConstructorObject(JSContext* aCx); |
345 | | |
346 | | } // namespace KeyboardEvent_Binding |
347 | | |
348 | | |
349 | | |
350 | | } // namespace dom |
351 | | } // namespace mozilla |
352 | | |
353 | | #endif // mozilla_dom_KeyboardEventBinding_h |