web_sys/features/
gen_DeviceMotionEventInit.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 = DeviceMotionEventInit)]
8    #[derive(Debug, Clone, PartialEq, Eq)]
9    #[doc = "The `DeviceMotionEventInit` dictionary."]
10    #[doc = ""]
11    #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"]
12    pub type DeviceMotionEventInit;
13    #[doc = "Get the `bubbles` field of this object."]
14    #[doc = ""]
15    #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"]
16    #[wasm_bindgen(method, getter = "bubbles")]
17    pub fn get_bubbles(this: &DeviceMotionEventInit) -> 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: `DeviceMotionEventInit`*"]
21    #[wasm_bindgen(method, setter = "bubbles")]
22    pub fn set_bubbles(this: &DeviceMotionEventInit, 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: `DeviceMotionEventInit`*"]
26    #[wasm_bindgen(method, getter = "cancelable")]
27    pub fn get_cancelable(this: &DeviceMotionEventInit) -> 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: `DeviceMotionEventInit`*"]
31    #[wasm_bindgen(method, setter = "cancelable")]
32    pub fn set_cancelable(this: &DeviceMotionEventInit, 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: `DeviceMotionEventInit`*"]
36    #[wasm_bindgen(method, getter = "composed")]
37    pub fn get_composed(this: &DeviceMotionEventInit) -> 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: `DeviceMotionEventInit`*"]
41    #[wasm_bindgen(method, setter = "composed")]
42    pub fn set_composed(this: &DeviceMotionEventInit, val: bool);
43    #[cfg(feature = "DeviceAccelerationInit")]
44    #[doc = "Get the `acceleration` field of this object."]
45    #[doc = ""]
46    #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`, `DeviceMotionEventInit`*"]
47    #[wasm_bindgen(method, getter = "acceleration")]
48    pub fn get_acceleration(this: &DeviceMotionEventInit) -> Option<DeviceAccelerationInit>;
49    #[cfg(feature = "DeviceAccelerationInit")]
50    #[doc = "Change the `acceleration` field of this object."]
51    #[doc = ""]
52    #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`, `DeviceMotionEventInit`*"]
53    #[wasm_bindgen(method, setter = "acceleration")]
54    pub fn set_acceleration(this: &DeviceMotionEventInit, val: &DeviceAccelerationInit);
55    #[cfg(feature = "DeviceAccelerationInit")]
56    #[doc = "Get the `accelerationIncludingGravity` field of this object."]
57    #[doc = ""]
58    #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`, `DeviceMotionEventInit`*"]
59    #[wasm_bindgen(method, getter = "accelerationIncludingGravity")]
60    pub fn get_acceleration_including_gravity(
61        this: &DeviceMotionEventInit,
62    ) -> Option<DeviceAccelerationInit>;
63    #[cfg(feature = "DeviceAccelerationInit")]
64    #[doc = "Change the `accelerationIncludingGravity` field of this object."]
65    #[doc = ""]
66    #[doc = "*This API requires the following crate features to be activated: `DeviceAccelerationInit`, `DeviceMotionEventInit`*"]
67    #[wasm_bindgen(method, setter = "accelerationIncludingGravity")]
68    pub fn set_acceleration_including_gravity(
69        this: &DeviceMotionEventInit,
70        val: &DeviceAccelerationInit,
71    );
72    #[doc = "Get the `interval` field of this object."]
73    #[doc = ""]
74    #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"]
75    #[wasm_bindgen(method, getter = "interval")]
76    pub fn get_interval(this: &DeviceMotionEventInit) -> Option<f64>;
77    #[doc = "Change the `interval` field of this object."]
78    #[doc = ""]
79    #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"]
80    #[wasm_bindgen(method, setter = "interval")]
81    pub fn set_interval(this: &DeviceMotionEventInit, val: Option<f64>);
82    #[cfg(feature = "DeviceRotationRateInit")]
83    #[doc = "Get the `rotationRate` field of this object."]
84    #[doc = ""]
85    #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`, `DeviceRotationRateInit`*"]
86    #[wasm_bindgen(method, getter = "rotationRate")]
87    pub fn get_rotation_rate(this: &DeviceMotionEventInit) -> Option<DeviceRotationRateInit>;
88    #[cfg(feature = "DeviceRotationRateInit")]
89    #[doc = "Change the `rotationRate` field of this object."]
90    #[doc = ""]
91    #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`, `DeviceRotationRateInit`*"]
92    #[wasm_bindgen(method, setter = "rotationRate")]
93    pub fn set_rotation_rate(this: &DeviceMotionEventInit, val: &DeviceRotationRateInit);
94}
95impl DeviceMotionEventInit {
96    #[doc = "Construct a new `DeviceMotionEventInit`."]
97    #[doc = ""]
98    #[doc = "*This API requires the following crate features to be activated: `DeviceMotionEventInit`*"]
99    pub fn new() -> Self {
100        #[allow(unused_mut)]
101        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
102        ret
103    }
104    #[deprecated = "Use `set_bubbles()` instead."]
105    pub fn bubbles(&mut self, val: bool) -> &mut Self {
106        self.set_bubbles(val);
107        self
108    }
109    #[deprecated = "Use `set_cancelable()` instead."]
110    pub fn cancelable(&mut self, val: bool) -> &mut Self {
111        self.set_cancelable(val);
112        self
113    }
114    #[deprecated = "Use `set_composed()` instead."]
115    pub fn composed(&mut self, val: bool) -> &mut Self {
116        self.set_composed(val);
117        self
118    }
119    #[cfg(feature = "DeviceAccelerationInit")]
120    #[deprecated = "Use `set_acceleration()` instead."]
121    pub fn acceleration(&mut self, val: &DeviceAccelerationInit) -> &mut Self {
122        self.set_acceleration(val);
123        self
124    }
125    #[cfg(feature = "DeviceAccelerationInit")]
126    #[deprecated = "Use `set_acceleration_including_gravity()` instead."]
127    pub fn acceleration_including_gravity(&mut self, val: &DeviceAccelerationInit) -> &mut Self {
128        self.set_acceleration_including_gravity(val);
129        self
130    }
131    #[deprecated = "Use `set_interval()` instead."]
132    pub fn interval(&mut self, val: Option<f64>) -> &mut Self {
133        self.set_interval(val);
134        self
135    }
136    #[cfg(feature = "DeviceRotationRateInit")]
137    #[deprecated = "Use `set_rotation_rate()` instead."]
138    pub fn rotation_rate(&mut self, val: &DeviceRotationRateInit) -> &mut Self {
139        self.set_rotation_rate(val);
140        self
141    }
142}
143impl Default for DeviceMotionEventInit {
144    fn default() -> Self {
145        Self::new()
146    }
147}