electron_sys/interface/
display_balloon_options.rs

1use js_sys::JsString;
2use wasm_bindgen::prelude::*;
3
4#[wasm_bindgen]
5#[derive(Clone, Debug, Eq, PartialEq)]
6pub struct DisplayBalloonOptions {
7    content: JsString,
8    icon_type: Option<JsString>,
9    icon: Option<JsString>,
10    large_icon: Option<JsString>,
11    no_sound: Option<bool>,
12    respect_quiet_time: Option<bool>,
13    title: JsString,
14}
15
16#[wasm_bindgen]
17impl DisplayBalloonOptions {
18    #[wasm_bindgen(constructor)]
19    pub fn new(
20        content: JsString,
21        icon_type: Option<JsString>,
22        icon: Option<JsString>,
23        large_icon: Option<JsString>,
24        no_sound: Option<bool>,
25        respect_quiet_time: Option<bool>,
26        title: JsString,
27    ) -> DisplayBalloonOptions {
28        DisplayBalloonOptions {
29            content,
30            icon_type,
31            icon,
32            large_icon,
33            no_sound,
34            respect_quiet_time,
35            title,
36        }
37    }
38
39    #[wasm_bindgen(getter)]
40    pub fn content(&self) -> JsString {
41        self.content.clone()
42    }
43
44    #[wasm_bindgen(setter)]
45    pub fn set_content(&mut self, value: JsString) {
46        self.content = value;
47    }
48
49    #[wasm_bindgen(getter, js_name = "iconType")]
50    pub fn icon_type(&self) -> Option<JsString> {
51        self.icon_type.clone()
52    }
53
54    #[wasm_bindgen(setter)]
55    pub fn set_icon_type(&mut self, value: Option<JsString>) {
56        self.icon_type = value;
57    }
58
59    #[wasm_bindgen(getter)]
60    pub fn icon(&self) -> Option<JsString> {
61        self.icon.clone()
62    }
63
64    #[wasm_bindgen(setter)]
65    pub fn set_icon(&mut self, value: Option<JsString>) {
66        self.icon = value;
67    }
68
69    #[wasm_bindgen(getter, js_name = "largeIcon")]
70    pub fn large_icon(&self) -> Option<JsString> {
71        self.large_icon.clone()
72    }
73
74    #[wasm_bindgen(setter)]
75    pub fn set_large_icon(&mut self, value: Option<JsString>) {
76        self.large_icon = value;
77    }
78
79    #[wasm_bindgen(getter, js_name = "noSound")]
80    pub fn no_sound(&self) -> Option<bool> {
81        self.no_sound
82    }
83
84    #[wasm_bindgen(setter)]
85    pub fn set_no_sound(&mut self, value: Option<bool>) {
86        self.no_sound = value;
87    }
88
89    #[wasm_bindgen(getter, js_name = "respectQuietTime")]
90    pub fn respect_quiet_time(&self) -> Option<bool> {
91        self.respect_quiet_time
92    }
93
94    #[wasm_bindgen(setter)]
95    pub fn set_respect_quiet_time(&mut self, value: Option<bool>) {
96        self.respect_quiet_time = value;
97    }
98
99    #[wasm_bindgen(getter)]
100    pub fn title(&self) -> JsString {
101        self.title.clone()
102    }
103
104    #[wasm_bindgen(setter)]
105    pub fn set_title(&mut self, value: JsString) {
106        self.title = value;
107    }
108}