web_sys/features/
gen_ClipboardPermissionDescriptor.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8    # [wasm_bindgen (extends = :: js_sys :: Object , js_name = ClipboardPermissionDescriptor)]
9    #[derive(Debug, Clone, PartialEq, Eq)]
10    #[doc = "The `ClipboardPermissionDescriptor` dictionary."]
11    #[doc = ""]
12    #[doc = "*This API requires the following crate features to be activated: `ClipboardPermissionDescriptor`*"]
13    #[doc = ""]
14    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
16    pub type ClipboardPermissionDescriptor;
17    #[cfg(web_sys_unstable_apis)]
18    #[cfg(feature = "PermissionName")]
19    #[doc = "Get the `name` field of this object."]
20    #[doc = ""]
21    #[doc = "*This API requires the following crate features to be activated: `ClipboardPermissionDescriptor`, `PermissionName`*"]
22    #[doc = ""]
23    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
24    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
25    #[wasm_bindgen(method, getter = "name")]
26    pub fn get_name(this: &ClipboardPermissionDescriptor) -> PermissionName;
27    #[cfg(web_sys_unstable_apis)]
28    #[cfg(feature = "PermissionName")]
29    #[doc = "Change the `name` field of this object."]
30    #[doc = ""]
31    #[doc = "*This API requires the following crate features to be activated: `ClipboardPermissionDescriptor`, `PermissionName`*"]
32    #[doc = ""]
33    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
34    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
35    #[wasm_bindgen(method, setter = "name")]
36    pub fn set_name(this: &ClipboardPermissionDescriptor, val: PermissionName);
37    #[cfg(web_sys_unstable_apis)]
38    #[doc = "Get the `allowWithoutGesture` field of this object."]
39    #[doc = ""]
40    #[doc = "*This API requires the following crate features to be activated: `ClipboardPermissionDescriptor`*"]
41    #[doc = ""]
42    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
43    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
44    #[wasm_bindgen(method, getter = "allowWithoutGesture")]
45    pub fn get_allow_without_gesture(this: &ClipboardPermissionDescriptor) -> Option<bool>;
46    #[cfg(web_sys_unstable_apis)]
47    #[doc = "Change the `allowWithoutGesture` field of this object."]
48    #[doc = ""]
49    #[doc = "*This API requires the following crate features to be activated: `ClipboardPermissionDescriptor`*"]
50    #[doc = ""]
51    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
52    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
53    #[wasm_bindgen(method, setter = "allowWithoutGesture")]
54    pub fn set_allow_without_gesture(this: &ClipboardPermissionDescriptor, val: bool);
55}
56#[cfg(web_sys_unstable_apis)]
57impl ClipboardPermissionDescriptor {
58    #[cfg(feature = "PermissionName")]
59    #[doc = "Construct a new `ClipboardPermissionDescriptor`."]
60    #[doc = ""]
61    #[doc = "*This API requires the following crate features to be activated: `ClipboardPermissionDescriptor`, `PermissionName`*"]
62    #[doc = ""]
63    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
64    #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
65    pub fn new(name: PermissionName) -> Self {
66        #[allow(unused_mut)]
67        let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
68        ret.set_name(name);
69        ret
70    }
71    #[cfg(web_sys_unstable_apis)]
72    #[cfg(feature = "PermissionName")]
73    #[deprecated = "Use `set_name()` instead."]
74    pub fn name(&mut self, val: PermissionName) -> &mut Self {
75        self.set_name(val);
76        self
77    }
78    #[cfg(web_sys_unstable_apis)]
79    #[deprecated = "Use `set_allow_without_gesture()` instead."]
80    pub fn allow_without_gesture(&mut self, val: bool) -> &mut Self {
81        self.set_allow_without_gesture(val);
82        self
83    }
84}