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