electron_sys/interface/
shortcut_details.rs

1use js_sys::JsString;
2use wasm_bindgen::prelude::*;
3
4#[wasm_bindgen]
5#[derive(Clone, Debug, PartialEq)]
6pub struct ShortcutDetails {
7    app_user_model_id: Option<JsString>,
8    args: Option<JsString>,
9    cwd: Option<JsString>,
10    description: Option<JsString>,
11    icon: Option<JsString>,
12    icon_index: Option<usize>,
13    target: JsString,
14}
15
16#[wasm_bindgen]
17impl ShortcutDetails {
18    #[allow(clippy::too_many_arguments)]
19    #[wasm_bindgen(constructor)]
20    pub fn new(
21        app_user_model_id: Option<JsString>,
22        args: Option<JsString>,
23        cwd: Option<JsString>,
24        description: Option<JsString>,
25        icon: Option<JsString>,
26        icon_index: Option<usize>,
27        target: JsString,
28    ) -> ShortcutDetails {
29        ShortcutDetails {
30            app_user_model_id,
31            args,
32            cwd,
33            description,
34            icon,
35            icon_index,
36            target,
37        }
38    }
39
40    #[wasm_bindgen(getter)]
41    pub fn app_user_model_id(&self) -> Option<JsString> {
42        self.app_user_model_id.clone()
43    }
44
45    #[wasm_bindgen(setter)]
46    pub fn set_app_user_model_id(&mut self, value: Option<JsString>) {
47        self.app_user_model_id = value;
48    }
49
50    #[wasm_bindgen(getter)]
51    pub fn args(&self) -> Option<JsString> {
52        self.args.clone()
53    }
54
55    #[wasm_bindgen(setter)]
56    pub fn set_args(&mut self, value: Option<JsString>) {
57        self.args = value;
58    }
59
60    #[wasm_bindgen(getter)]
61    pub fn cwd(&self) -> Option<JsString> {
62        self.cwd.clone()
63    }
64
65    #[wasm_bindgen(setter)]
66    pub fn set_cwd(&mut self, value: Option<JsString>) {
67        self.cwd = value;
68    }
69
70    #[wasm_bindgen(getter)]
71    pub fn description(&self) -> Option<JsString> {
72        self.description.clone()
73    }
74
75    #[wasm_bindgen(setter)]
76    pub fn set_description(&mut self, value: Option<JsString>) {
77        self.description = value;
78    }
79
80    #[wasm_bindgen(getter)]
81    pub fn icon(&self) -> Option<JsString> {
82        self.icon.clone()
83    }
84
85    #[wasm_bindgen(setter)]
86    pub fn set_icon(&mut self, value: Option<JsString>) {
87        self.icon = value;
88    }
89
90    #[wasm_bindgen(getter)]
91    pub fn icon_index(&self) -> Option<usize> {
92        self.icon_index
93    }
94
95    #[wasm_bindgen(setter)]
96    pub fn set_icon_index(&mut self, value: Option<usize>) {
97        self.icon_index = value;
98    }
99
100    #[wasm_bindgen(getter)]
101    pub fn target(&self) -> JsString {
102        self.target.clone()
103    }
104
105    #[wasm_bindgen(setter)]
106    pub fn set_target(&mut self, value: JsString) {
107        self.target = value;
108    }
109}