]>
Commit | Line | Data |
---|---|---|
49aad941 | 1 | #![allow(unused_imports)] |
fe692bf9 | 2 | #![allow(clippy::all)] |
49aad941 FG |
3 | use super::*; |
4 | use wasm_bindgen::prelude::*; | |
5 | #[wasm_bindgen] | |
6 | extern "C" { | |
7 | # [wasm_bindgen (extends = :: js_sys :: Object , js_name = DragEventInit)] | |
8 | #[derive(Debug, Clone, PartialEq, Eq)] | |
9 | #[doc = "The `DragEventInit` dictionary."] | |
10 | #[doc = ""] | |
11 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
12 | pub type DragEventInit; | |
13 | } | |
14 | impl DragEventInit { | |
15 | #[doc = "Construct a new `DragEventInit`."] | |
16 | #[doc = ""] | |
17 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
18 | pub fn new() -> Self { | |
19 | #[allow(unused_mut)] | |
20 | let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new()); | |
21 | ret | |
22 | } | |
23 | #[doc = "Change the `bubbles` field of this object."] | |
24 | #[doc = ""] | |
25 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
26 | pub fn bubbles(&mut self, val: bool) -> &mut Self { | |
27 | use wasm_bindgen::JsValue; | |
28 | let r = ::js_sys::Reflect::set( | |
29 | self.as_ref(), | |
30 | &JsValue::from("bubbles"), | |
31 | &JsValue::from(val), | |
32 | ); | |
33 | debug_assert!( | |
34 | r.is_ok(), | |
35 | "setting properties should never fail on our dictionary objects" | |
36 | ); | |
37 | let _ = r; | |
38 | self | |
39 | } | |
40 | #[doc = "Change the `cancelable` field of this object."] | |
41 | #[doc = ""] | |
42 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
43 | pub fn cancelable(&mut self, val: bool) -> &mut Self { | |
44 | use wasm_bindgen::JsValue; | |
45 | let r = ::js_sys::Reflect::set( | |
46 | self.as_ref(), | |
47 | &JsValue::from("cancelable"), | |
48 | &JsValue::from(val), | |
49 | ); | |
50 | debug_assert!( | |
51 | r.is_ok(), | |
52 | "setting properties should never fail on our dictionary objects" | |
53 | ); | |
54 | let _ = r; | |
55 | self | |
56 | } | |
57 | #[doc = "Change the `composed` field of this object."] | |
58 | #[doc = ""] | |
59 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
60 | pub fn composed(&mut self, val: bool) -> &mut Self { | |
61 | use wasm_bindgen::JsValue; | |
62 | let r = ::js_sys::Reflect::set( | |
63 | self.as_ref(), | |
64 | &JsValue::from("composed"), | |
65 | &JsValue::from(val), | |
66 | ); | |
67 | debug_assert!( | |
68 | r.is_ok(), | |
69 | "setting properties should never fail on our dictionary objects" | |
70 | ); | |
71 | let _ = r; | |
72 | self | |
73 | } | |
74 | #[doc = "Change the `detail` field of this object."] | |
75 | #[doc = ""] | |
76 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
77 | pub fn detail(&mut self, val: i32) -> &mut Self { | |
78 | use wasm_bindgen::JsValue; | |
79 | let r = | |
80 | ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val)); | |
81 | debug_assert!( | |
82 | r.is_ok(), | |
83 | "setting properties should never fail on our dictionary objects" | |
84 | ); | |
85 | let _ = r; | |
86 | self | |
87 | } | |
88 | #[cfg(feature = "Window")] | |
89 | #[doc = "Change the `view` field of this object."] | |
90 | #[doc = ""] | |
91 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`, `Window`*"] | |
92 | pub fn view(&mut self, val: Option<&Window>) -> &mut Self { | |
93 | use wasm_bindgen::JsValue; | |
94 | let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val)); | |
95 | debug_assert!( | |
96 | r.is_ok(), | |
97 | "setting properties should never fail on our dictionary objects" | |
98 | ); | |
99 | let _ = r; | |
100 | self | |
101 | } | |
102 | #[doc = "Change the `altKey` field of this object."] | |
103 | #[doc = ""] | |
104 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
105 | pub fn alt_key(&mut self, val: bool) -> &mut Self { | |
106 | use wasm_bindgen::JsValue; | |
107 | let r = | |
108 | ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("altKey"), &JsValue::from(val)); | |
109 | debug_assert!( | |
110 | r.is_ok(), | |
111 | "setting properties should never fail on our dictionary objects" | |
112 | ); | |
113 | let _ = r; | |
114 | self | |
115 | } | |
116 | #[doc = "Change the `ctrlKey` field of this object."] | |
117 | #[doc = ""] | |
118 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
119 | pub fn ctrl_key(&mut self, val: bool) -> &mut Self { | |
120 | use wasm_bindgen::JsValue; | |
121 | let r = ::js_sys::Reflect::set( | |
122 | self.as_ref(), | |
123 | &JsValue::from("ctrlKey"), | |
124 | &JsValue::from(val), | |
125 | ); | |
126 | debug_assert!( | |
127 | r.is_ok(), | |
128 | "setting properties should never fail on our dictionary objects" | |
129 | ); | |
130 | let _ = r; | |
131 | self | |
132 | } | |
133 | #[doc = "Change the `metaKey` field of this object."] | |
134 | #[doc = ""] | |
135 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
136 | pub fn meta_key(&mut self, val: bool) -> &mut Self { | |
137 | use wasm_bindgen::JsValue; | |
138 | let r = ::js_sys::Reflect::set( | |
139 | self.as_ref(), | |
140 | &JsValue::from("metaKey"), | |
141 | &JsValue::from(val), | |
142 | ); | |
143 | debug_assert!( | |
144 | r.is_ok(), | |
145 | "setting properties should never fail on our dictionary objects" | |
146 | ); | |
147 | let _ = r; | |
148 | self | |
149 | } | |
150 | #[doc = "Change the `modifierAltGraph` field of this object."] | |
151 | #[doc = ""] | |
152 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
153 | pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self { | |
154 | use wasm_bindgen::JsValue; | |
155 | let r = ::js_sys::Reflect::set( | |
156 | self.as_ref(), | |
157 | &JsValue::from("modifierAltGraph"), | |
158 | &JsValue::from(val), | |
159 | ); | |
160 | debug_assert!( | |
161 | r.is_ok(), | |
162 | "setting properties should never fail on our dictionary objects" | |
163 | ); | |
164 | let _ = r; | |
165 | self | |
166 | } | |
167 | #[doc = "Change the `modifierCapsLock` field of this object."] | |
168 | #[doc = ""] | |
169 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
170 | pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self { | |
171 | use wasm_bindgen::JsValue; | |
172 | let r = ::js_sys::Reflect::set( | |
173 | self.as_ref(), | |
174 | &JsValue::from("modifierCapsLock"), | |
175 | &JsValue::from(val), | |
176 | ); | |
177 | debug_assert!( | |
178 | r.is_ok(), | |
179 | "setting properties should never fail on our dictionary objects" | |
180 | ); | |
181 | let _ = r; | |
182 | self | |
183 | } | |
184 | #[doc = "Change the `modifierFn` field of this object."] | |
185 | #[doc = ""] | |
186 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
187 | pub fn modifier_fn(&mut self, val: bool) -> &mut Self { | |
188 | use wasm_bindgen::JsValue; | |
189 | let r = ::js_sys::Reflect::set( | |
190 | self.as_ref(), | |
191 | &JsValue::from("modifierFn"), | |
192 | &JsValue::from(val), | |
193 | ); | |
194 | debug_assert!( | |
195 | r.is_ok(), | |
196 | "setting properties should never fail on our dictionary objects" | |
197 | ); | |
198 | let _ = r; | |
199 | self | |
200 | } | |
201 | #[doc = "Change the `modifierFnLock` field of this object."] | |
202 | #[doc = ""] | |
203 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
204 | pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self { | |
205 | use wasm_bindgen::JsValue; | |
206 | let r = ::js_sys::Reflect::set( | |
207 | self.as_ref(), | |
208 | &JsValue::from("modifierFnLock"), | |
209 | &JsValue::from(val), | |
210 | ); | |
211 | debug_assert!( | |
212 | r.is_ok(), | |
213 | "setting properties should never fail on our dictionary objects" | |
214 | ); | |
215 | let _ = r; | |
216 | self | |
217 | } | |
218 | #[doc = "Change the `modifierNumLock` field of this object."] | |
219 | #[doc = ""] | |
220 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
221 | pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self { | |
222 | use wasm_bindgen::JsValue; | |
223 | let r = ::js_sys::Reflect::set( | |
224 | self.as_ref(), | |
225 | &JsValue::from("modifierNumLock"), | |
226 | &JsValue::from(val), | |
227 | ); | |
228 | debug_assert!( | |
229 | r.is_ok(), | |
230 | "setting properties should never fail on our dictionary objects" | |
231 | ); | |
232 | let _ = r; | |
233 | self | |
234 | } | |
235 | #[doc = "Change the `modifierOS` field of this object."] | |
236 | #[doc = ""] | |
237 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
238 | pub fn modifier_os(&mut self, val: bool) -> &mut Self { | |
239 | use wasm_bindgen::JsValue; | |
240 | let r = ::js_sys::Reflect::set( | |
241 | self.as_ref(), | |
242 | &JsValue::from("modifierOS"), | |
243 | &JsValue::from(val), | |
244 | ); | |
245 | debug_assert!( | |
246 | r.is_ok(), | |
247 | "setting properties should never fail on our dictionary objects" | |
248 | ); | |
249 | let _ = r; | |
250 | self | |
251 | } | |
252 | #[doc = "Change the `modifierScrollLock` field of this object."] | |
253 | #[doc = ""] | |
254 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
255 | pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self { | |
256 | use wasm_bindgen::JsValue; | |
257 | let r = ::js_sys::Reflect::set( | |
258 | self.as_ref(), | |
259 | &JsValue::from("modifierScrollLock"), | |
260 | &JsValue::from(val), | |
261 | ); | |
262 | debug_assert!( | |
263 | r.is_ok(), | |
264 | "setting properties should never fail on our dictionary objects" | |
265 | ); | |
266 | let _ = r; | |
267 | self | |
268 | } | |
269 | #[doc = "Change the `modifierSymbol` field of this object."] | |
270 | #[doc = ""] | |
271 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
272 | pub fn modifier_symbol(&mut self, val: bool) -> &mut Self { | |
273 | use wasm_bindgen::JsValue; | |
274 | let r = ::js_sys::Reflect::set( | |
275 | self.as_ref(), | |
276 | &JsValue::from("modifierSymbol"), | |
277 | &JsValue::from(val), | |
278 | ); | |
279 | debug_assert!( | |
280 | r.is_ok(), | |
281 | "setting properties should never fail on our dictionary objects" | |
282 | ); | |
283 | let _ = r; | |
284 | self | |
285 | } | |
286 | #[doc = "Change the `modifierSymbolLock` field of this object."] | |
287 | #[doc = ""] | |
288 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
289 | pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self { | |
290 | use wasm_bindgen::JsValue; | |
291 | let r = ::js_sys::Reflect::set( | |
292 | self.as_ref(), | |
293 | &JsValue::from("modifierSymbolLock"), | |
294 | &JsValue::from(val), | |
295 | ); | |
296 | debug_assert!( | |
297 | r.is_ok(), | |
298 | "setting properties should never fail on our dictionary objects" | |
299 | ); | |
300 | let _ = r; | |
301 | self | |
302 | } | |
303 | #[doc = "Change the `shiftKey` field of this object."] | |
304 | #[doc = ""] | |
305 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
306 | pub fn shift_key(&mut self, val: bool) -> &mut Self { | |
307 | use wasm_bindgen::JsValue; | |
308 | let r = ::js_sys::Reflect::set( | |
309 | self.as_ref(), | |
310 | &JsValue::from("shiftKey"), | |
311 | &JsValue::from(val), | |
312 | ); | |
313 | debug_assert!( | |
314 | r.is_ok(), | |
315 | "setting properties should never fail on our dictionary objects" | |
316 | ); | |
317 | let _ = r; | |
318 | self | |
319 | } | |
320 | #[doc = "Change the `button` field of this object."] | |
321 | #[doc = ""] | |
322 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
323 | pub fn button(&mut self, val: i16) -> &mut Self { | |
324 | use wasm_bindgen::JsValue; | |
325 | let r = | |
326 | ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("button"), &JsValue::from(val)); | |
327 | debug_assert!( | |
328 | r.is_ok(), | |
329 | "setting properties should never fail on our dictionary objects" | |
330 | ); | |
331 | let _ = r; | |
332 | self | |
333 | } | |
334 | #[doc = "Change the `buttons` field of this object."] | |
335 | #[doc = ""] | |
336 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
337 | pub fn buttons(&mut self, val: u16) -> &mut Self { | |
338 | use wasm_bindgen::JsValue; | |
339 | let r = ::js_sys::Reflect::set( | |
340 | self.as_ref(), | |
341 | &JsValue::from("buttons"), | |
342 | &JsValue::from(val), | |
343 | ); | |
344 | debug_assert!( | |
345 | r.is_ok(), | |
346 | "setting properties should never fail on our dictionary objects" | |
347 | ); | |
348 | let _ = r; | |
349 | self | |
350 | } | |
351 | #[doc = "Change the `clientX` field of this object."] | |
352 | #[doc = ""] | |
353 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
354 | pub fn client_x(&mut self, val: i32) -> &mut Self { | |
355 | use wasm_bindgen::JsValue; | |
356 | let r = ::js_sys::Reflect::set( | |
357 | self.as_ref(), | |
358 | &JsValue::from("clientX"), | |
359 | &JsValue::from(val), | |
360 | ); | |
361 | debug_assert!( | |
362 | r.is_ok(), | |
363 | "setting properties should never fail on our dictionary objects" | |
364 | ); | |
365 | let _ = r; | |
366 | self | |
367 | } | |
368 | #[doc = "Change the `clientY` field of this object."] | |
369 | #[doc = ""] | |
370 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
371 | pub fn client_y(&mut self, val: i32) -> &mut Self { | |
372 | use wasm_bindgen::JsValue; | |
373 | let r = ::js_sys::Reflect::set( | |
374 | self.as_ref(), | |
375 | &JsValue::from("clientY"), | |
376 | &JsValue::from(val), | |
377 | ); | |
378 | debug_assert!( | |
379 | r.is_ok(), | |
380 | "setting properties should never fail on our dictionary objects" | |
381 | ); | |
382 | let _ = r; | |
383 | self | |
384 | } | |
385 | #[doc = "Change the `movementX` field of this object."] | |
386 | #[doc = ""] | |
387 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
388 | pub fn movement_x(&mut self, val: i32) -> &mut Self { | |
389 | use wasm_bindgen::JsValue; | |
390 | let r = ::js_sys::Reflect::set( | |
391 | self.as_ref(), | |
392 | &JsValue::from("movementX"), | |
393 | &JsValue::from(val), | |
394 | ); | |
395 | debug_assert!( | |
396 | r.is_ok(), | |
397 | "setting properties should never fail on our dictionary objects" | |
398 | ); | |
399 | let _ = r; | |
400 | self | |
401 | } | |
402 | #[doc = "Change the `movementY` field of this object."] | |
403 | #[doc = ""] | |
404 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
405 | pub fn movement_y(&mut self, val: i32) -> &mut Self { | |
406 | use wasm_bindgen::JsValue; | |
407 | let r = ::js_sys::Reflect::set( | |
408 | self.as_ref(), | |
409 | &JsValue::from("movementY"), | |
410 | &JsValue::from(val), | |
411 | ); | |
412 | debug_assert!( | |
413 | r.is_ok(), | |
414 | "setting properties should never fail on our dictionary objects" | |
415 | ); | |
416 | let _ = r; | |
417 | self | |
418 | } | |
419 | #[cfg(feature = "EventTarget")] | |
420 | #[doc = "Change the `relatedTarget` field of this object."] | |
421 | #[doc = ""] | |
422 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`, `EventTarget`*"] | |
423 | pub fn related_target(&mut self, val: Option<&EventTarget>) -> &mut Self { | |
424 | use wasm_bindgen::JsValue; | |
425 | let r = ::js_sys::Reflect::set( | |
426 | self.as_ref(), | |
427 | &JsValue::from("relatedTarget"), | |
428 | &JsValue::from(val), | |
429 | ); | |
430 | debug_assert!( | |
431 | r.is_ok(), | |
432 | "setting properties should never fail on our dictionary objects" | |
433 | ); | |
434 | let _ = r; | |
435 | self | |
436 | } | |
437 | #[doc = "Change the `screenX` field of this object."] | |
438 | #[doc = ""] | |
439 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
440 | pub fn screen_x(&mut self, val: i32) -> &mut Self { | |
441 | use wasm_bindgen::JsValue; | |
442 | let r = ::js_sys::Reflect::set( | |
443 | self.as_ref(), | |
444 | &JsValue::from("screenX"), | |
445 | &JsValue::from(val), | |
446 | ); | |
447 | debug_assert!( | |
448 | r.is_ok(), | |
449 | "setting properties should never fail on our dictionary objects" | |
450 | ); | |
451 | let _ = r; | |
452 | self | |
453 | } | |
454 | #[doc = "Change the `screenY` field of this object."] | |
455 | #[doc = ""] | |
456 | #[doc = "*This API requires the following crate features to be activated: `DragEventInit`*"] | |
457 | pub fn screen_y(&mut self, val: i32) -> &mut Self { | |
458 | use wasm_bindgen::JsValue; | |
459 | let r = ::js_sys::Reflect::set( | |
460 | self.as_ref(), | |
461 | &JsValue::from("screenY"), | |
462 | &JsValue::from(val), | |
463 | ); | |
464 | debug_assert!( | |
465 | r.is_ok(), | |
466 | "setting properties should never fail on our dictionary objects" | |
467 | ); | |
468 | let _ = r; | |
469 | self | |
470 | } | |
471 | #[cfg(feature = "DataTransfer")] | |
472 | #[doc = "Change the `dataTransfer` field of this object."] | |
473 | #[doc = ""] | |
474 | #[doc = "*This API requires the following crate features to be activated: `DataTransfer`, `DragEventInit`*"] | |
475 | pub fn data_transfer(&mut self, val: Option<&DataTransfer>) -> &mut Self { | |
476 | use wasm_bindgen::JsValue; | |
477 | let r = ::js_sys::Reflect::set( | |
478 | self.as_ref(), | |
479 | &JsValue::from("dataTransfer"), | |
480 | &JsValue::from(val), | |
481 | ); | |
482 | debug_assert!( | |
483 | r.is_ok(), | |
484 | "setting properties should never fail on our dictionary objects" | |
485 | ); | |
486 | let _ = r; | |
487 | self | |
488 | } | |
489 | } | |
490 | impl Default for DragEventInit { | |
491 | fn default() -> Self { | |
492 | Self::new() | |
493 | } | |
494 | } |