fcitx5_dbus/
controller.rs

1use std::collections::HashMap;
2use zbus::proxy;
3
4#[proxy(
5    interface = "org.fcitx.Fcitx.Controller1",
6    default_service = "org.fcitx.Fcitx5",
7    default_path = "/controller"
8)]
9pub trait Controller {
10    /// Activate method
11    fn activate(&self) -> zbus::Result<()>;
12
13    /// AddInputMethodGroup method
14    fn add_input_method_group(&self, group: &str) -> zbus::Result<()>;
15
16    /// AddonForIM method
17    #[zbus(name = "AddonForIM")]
18    fn addon_for_im(&self, im_name: &str) -> zbus::Result<String>;
19
20    /// AvailableInputMethods method
21    fn available_input_methods(
22        &self,
23    ) -> zbus::Result<Vec<(String, String, String, String, String, String, bool)>>;
24
25    /// AvailableKeyboardLayouts method
26    #[allow(clippy::type_complexity)]
27    fn available_keyboard_layouts(
28        &self,
29    ) -> zbus::Result<
30        Vec<(
31            String,
32            String,
33            Vec<String>,
34            Vec<(String, String, Vec<String>)>,
35        )>,
36    >;
37
38    /// CanRestart method
39    fn can_restart(&self) -> zbus::Result<bool>;
40
41    /// CheckUpdate method
42    fn check_update(&self) -> zbus::Result<bool>;
43
44    /// Configure method
45    fn configure(&self) -> zbus::Result<()>;
46
47    /// ConfigureAddon method
48    fn configure_addon(&self, arg: &str) -> zbus::Result<()>;
49
50    /// ConfigureIM method
51    #[zbus(name = "ConfigureIM")]
52    fn configure_im(&self, arg: &str) -> zbus::Result<()>;
53
54    /// CurrentInputMethod method
55    fn current_input_method(&self) -> zbus::Result<String>;
56
57    /// CurrentInputMethodGroup method
58    fn current_input_method_group(&self) -> zbus::Result<String>;
59
60    /// CurrentUI method
61    #[zbus(name = "CurrentUI")]
62    fn current_ui(&self) -> zbus::Result<String>;
63
64    /// Deactivate method
65    fn deactivate(&self) -> zbus::Result<()>;
66
67    /// DebugInfo method
68    fn debug_info(&self) -> zbus::Result<String>;
69
70    /// Exit method
71    fn exit(&self) -> zbus::Result<()>;
72
73    /// FullInputMethodGroupInfo method
74    #[allow(clippy::type_complexity)]
75    fn full_input_method_group_info(
76        &self,
77        input_method_group_name: &str,
78    ) -> zbus::Result<(
79        String,
80        String,
81        String,
82        HashMap<String, zbus::zvariant::OwnedValue>,
83        Vec<(
84            String,
85            String,
86            String,
87            String,
88            String,
89            String,
90            String,
91            bool,
92            String,
93            HashMap<String, zbus::zvariant::OwnedValue>,
94        )>,
95    )>;
96
97    /// GetAddons method
98    fn get_addons(&self) -> zbus::Result<Vec<(String, String, String, i32, bool, bool)>>;
99
100    /// GetAddonsV2 method
101    fn get_addons_v2(
102        &self,
103    ) -> zbus::Result<
104        Vec<(
105            String,
106            String,
107            String,
108            i32,
109            bool,
110            bool,
111            bool,
112            Vec<String>,
113            Vec<String>,
114        )>,
115    >;
116
117    /// GetConfig method
118    #[allow(clippy::type_complexity)]
119    fn get_config(
120        &self,
121        uri: &str,
122    ) -> zbus::Result<(
123        zbus::zvariant::OwnedValue,
124        Vec<(
125            String,
126            Vec<(
127                String,
128                String,
129                String,
130                zbus::zvariant::OwnedValue,
131                HashMap<String, zbus::zvariant::OwnedValue>,
132            )>,
133        )>,
134    )>;
135
136    /// InputMethodGroupInfo method
137    fn input_method_group_info(
138        &self,
139        group_name: &str,
140    ) -> zbus::Result<(String, Vec<(String, String)>)>;
141
142    /// InputMethodGroups method
143    fn input_method_groups(&self) -> zbus::Result<Vec<String>>;
144
145    /// OpenWaylandConnection method
146    fn open_wayland_connection(&self, name: &str) -> zbus::Result<()>;
147
148    /// OpenWaylandConnectionSocket method
149    fn open_wayland_connection_socket(&self, fd: zbus::zvariant::Fd<'_>) -> zbus::Result<()>;
150
151    /// OpenX11Connection method
152    #[zbus(name = "OpenX11Connection")]
153    fn open_x11connection(&self, name: &str) -> zbus::Result<()>;
154
155    /// Refresh method
156    fn refresh(&self) -> zbus::Result<()>;
157
158    /// ReloadAddonConfig method
159    fn reload_addon_config(&self, addon_name: &str) -> zbus::Result<()>;
160
161    /// ReloadConfig method
162    fn reload_config(&self) -> zbus::Result<()>;
163
164    /// RemoveInputMethodGroup method
165    fn remove_input_method_group(&self, group: &str) -> zbus::Result<()>;
166
167    /// ReopenWaylandConnectionSocket method
168    fn reopen_wayland_connection_socket(
169        &self,
170        name: &str,
171        fd: zbus::zvariant::Fd<'_>,
172    ) -> zbus::Result<()>;
173
174    /// ResetIMList method
175    #[zbus(name = "ResetIMList")]
176    fn reset_imlist(&self) -> zbus::Result<()>;
177
178    /// Restart method
179    fn restart(&self) -> zbus::Result<()>;
180
181    /// Save method
182    fn save(&self) -> zbus::Result<()>;
183
184    /// SetAddonsState method
185    fn set_addons_state(&self, addons: &[(&str, bool)]) -> zbus::Result<()>;
186
187    /// SetConfig method
188    fn set_config(&self, uri: &str, v: &zbus::zvariant::Value<'_>) -> zbus::Result<()>;
189
190    /// SetCurrentIM method
191    #[zbus(name = "SetCurrentIM")]
192    fn set_current_im(&self, im_name: &str) -> zbus::Result<()>;
193
194    /// SetInputMethodGroupInfo method
195    fn set_input_method_group_info(
196        &self,
197        group_name: &str,
198        default_layout: &str,
199        entries: &[(&str, &str)],
200    ) -> zbus::Result<()>;
201
202    /// SetLogRule method
203    fn set_log_rule(&self, rule: &str) -> zbus::Result<()>;
204
205    /// State method
206    fn state(&self) -> zbus::Result<i32>;
207
208    /// SwitchInputMethodGroup method
209    fn switch_input_method_group(&self, group: &str) -> zbus::Result<()>;
210
211    /// Toggle method
212    fn toggle(&self) -> zbus::Result<()>;
213
214    /// InputMethodGroupsChanged signal
215    #[zbus(signal)]
216    fn input_method_groups_changed(&self) -> zbus::Result<()>;
217}