web_sys/features/
gen_UiEventInit.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = UIEventInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `UiEventInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"]
12    pub type UiEventInit;
13    #[doc = "Get the `bubbles` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"]
16    #[wasm_bindgen(method, getter = "bubbles")]
17    pub fn get_bubbles(this: &UiEventInit) -> Option<bool>;
18    #[doc = "Change the `bubbles` field of this object."]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"]
21    #[wasm_bindgen(method, setter = "bubbles")]
22    pub fn set_bubbles(this: &UiEventInit, val: bool);
23    #[doc = "Get the `cancelable` field of this object."]
24    #[doc = ""]
25    #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"]
26    #[wasm_bindgen(method, getter = "cancelable")]
27    pub fn get_cancelable(this: &UiEventInit) -> Option<bool>;
28    #[doc = "Change the `cancelable` field of this object."]
29    #[doc = ""]
30    #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"]
31    #[wasm_bindgen(method, setter = "cancelable")]
32    pub fn set_cancelable(this: &UiEventInit, val: bool);
33    #[doc = "Get the `composed` field of this object."]
34    #[doc = ""]
35    #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"]
36    #[wasm_bindgen(method, getter = "composed")]
37    pub fn get_composed(this: &UiEventInit) -> Option<bool>;
38    #[doc = "Change the `composed` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"]
41    #[wasm_bindgen(method, setter = "composed")]
42    pub fn set_composed(this: &UiEventInit, val: bool);
43    #[doc = "Get the `detail` field of this object."]
44    #[doc = ""]
45    #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"]
46    #[wasm_bindgen(method, getter = "detail")]
47    pub fn get_detail(this: &UiEventInit) -> Option<i32>;
48    #[doc = "Change the `detail` field of this object."]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"]
51    #[wasm_bindgen(method, setter = "detail")]
52    pub fn set_detail(this: &UiEventInit, val: i32);
53    #[cfg(feature = "Window")]
54    #[doc = "Get the `view` field of this object."]
55    #[doc = ""]
56    #[doc = "*This API requires the following crate features to be activated: `UiEventInit`, `Window`*"]
57    #[wasm_bindgen(method, getter = "view")]
58    pub fn get_view(this: &UiEventInit) -> Option<Window>;
59    #[cfg(feature = "Window")]
60    #[doc = "Change the `view` field of this object."]
61    #[doc = ""]
62    #[doc = "*This API requires the following crate features to be activated: `UiEventInit`, `Window`*"]
63    #[wasm_bindgen(method, setter = "view")]
64    pub fn set_view(this: &UiEventInit, val: Option<&Window>);
65}
66impl UiEventInit {
67    #[doc = "Construct a new `UiEventInit`."]
68    #[doc = ""]
69    #[doc = "*This API requires the following crate features to be activated: `UiEventInit`*"]
70    pub fn new() -> Self {
71        #[allow(unused_mut)]
72        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
73        ret
74    }
75    #[deprecated = "Use `set_bubbles()` instead."]
76    pub fn bubbles(&mut self, val: bool) -> &mut Self {
77        self.set_bubbles(val);
78        self
79    }
80    #[deprecated = "Use `set_cancelable()` instead."]
81    pub fn cancelable(&mut self, val: bool) -> &mut Self {
82        self.set_cancelable(val);
83        self
84    }
85    #[deprecated = "Use `set_composed()` instead."]
86    pub fn composed(&mut self, val: bool) -> &mut Self {
87        self.set_composed(val);
88        self
89    }
90    #[deprecated = "Use `set_detail()` instead."]
91    pub fn detail(&mut self, val: i32) -> &mut Self {
92        self.set_detail(val);
93        self
94    }
95    #[cfg(feature = "Window")]
96    #[deprecated = "Use `set_view()` instead."]
97    pub fn view(&mut self, val: Option<&Window>) -> &mut Self {
98        self.set_view(val);
99        self
100    }
101}
102impl Default for UiEventInit {
103    fn default() -> Self {
104        Self::new()
105    }
106}