blob: 2d65bee2852e97a14f86e3cc634c9c2d88cdafb3 [file] [log] [blame]
#![allow(unused_imports)]
use super::*;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern "C" {
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = WheelEventInit)]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `WheelEventInit` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub type WheelEventInit;
}
impl WheelEventInit {
#[doc = "Construct a new `WheelEventInit`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn new() -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret
}
#[doc = "Change the `bubbles` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn bubbles(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("bubbles"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `cancelable` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn cancelable(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("cancelable"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `composed` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn composed(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("composed"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `detail` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn detail(&mut self, val: i32) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("detail"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[cfg(feature = "Window")]
#[doc = "Change the `view` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`, `Window`*"]
pub fn view(&mut self, val: Option<&Window>) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(self.as_ref(), &JsValue::from("view"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `altKey` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn alt_key(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("altKey"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `ctrlKey` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn ctrl_key(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("ctrlKey"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `metaKey` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn meta_key(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("metaKey"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `modifierAltGraph` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn modifier_alt_graph(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("modifierAltGraph"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `modifierCapsLock` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn modifier_caps_lock(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("modifierCapsLock"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `modifierFn` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn modifier_fn(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("modifierFn"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `modifierFnLock` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn modifier_fn_lock(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("modifierFnLock"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `modifierNumLock` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn modifier_num_lock(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("modifierNumLock"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `modifierOS` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn modifier_os(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("modifierOS"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `modifierScrollLock` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn modifier_scroll_lock(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("modifierScrollLock"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `modifierSymbol` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn modifier_symbol(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("modifierSymbol"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `modifierSymbolLock` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn modifier_symbol_lock(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("modifierSymbolLock"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `shiftKey` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn shift_key(&mut self, val: bool) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("shiftKey"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `button` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn button(&mut self, val: i16) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("button"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `buttons` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn buttons(&mut self, val: u16) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("buttons"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `clientX` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn client_x(&mut self, val: i32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("clientX"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `clientY` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn client_y(&mut self, val: i32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("clientY"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `movementX` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn movement_x(&mut self, val: i32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("movementX"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `movementY` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn movement_y(&mut self, val: i32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("movementY"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[cfg(feature = "EventTarget")]
#[doc = "Change the `relatedTarget` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `EventTarget`, `WheelEventInit`*"]
pub fn related_target(&mut self, val: Option<&EventTarget>) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("relatedTarget"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `screenX` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn screen_x(&mut self, val: i32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("screenX"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `screenY` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn screen_y(&mut self, val: i32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("screenY"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `deltaMode` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn delta_mode(&mut self, val: u32) -> &mut Self {
use wasm_bindgen::JsValue;
let r = ::js_sys::Reflect::set(
self.as_ref(),
&JsValue::from("deltaMode"),
&JsValue::from(val),
);
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `deltaX` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn delta_x(&mut self, val: f64) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("deltaX"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `deltaY` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn delta_y(&mut self, val: f64) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("deltaY"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
#[doc = "Change the `deltaZ` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WheelEventInit`*"]
pub fn delta_z(&mut self, val: f64) -> &mut Self {
use wasm_bindgen::JsValue;
let r =
::js_sys::Reflect::set(self.as_ref(), &JsValue::from("deltaZ"), &JsValue::from(val));
debug_assert!(
r.is_ok(),
"setting properties should never fail on our dictionary objects"
);
let _ = r;
self
}
}
impl Default for WheelEventInit {
fn default() -> Self {
Self::new()
}
}