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 fn activate(&self) -> zbus::Result<()>;
12
13 fn add_input_method_group(&self, group: &str) -> zbus::Result<()>;
15
16 #[zbus(name = "AddonForIM")]
18 fn addon_for_im(&self, im_name: &str) -> zbus::Result<String>;
19
20 fn available_input_methods(
22 &self,
23 ) -> zbus::Result<Vec<(String, String, String, String, String, String, bool)>>;
24
25 #[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 fn can_restart(&self) -> zbus::Result<bool>;
40
41 fn check_update(&self) -> zbus::Result<bool>;
43
44 fn configure(&self) -> zbus::Result<()>;
46
47 fn configure_addon(&self, arg: &str) -> zbus::Result<()>;
49
50 #[zbus(name = "ConfigureIM")]
52 fn configure_im(&self, arg: &str) -> zbus::Result<()>;
53
54 fn current_input_method(&self) -> zbus::Result<String>;
56
57 fn current_input_method_group(&self) -> zbus::Result<String>;
59
60 #[zbus(name = "CurrentUI")]
62 fn current_ui(&self) -> zbus::Result<String>;
63
64 fn deactivate(&self) -> zbus::Result<()>;
66
67 fn debug_info(&self) -> zbus::Result<String>;
69
70 fn exit(&self) -> zbus::Result<()>;
72
73 #[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 fn get_addons(&self) -> zbus::Result<Vec<(String, String, String, i32, bool, bool)>>;
99
100 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 #[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 fn input_method_group_info(
138 &self,
139 group_name: &str,
140 ) -> zbus::Result<(String, Vec<(String, String)>)>;
141
142 fn input_method_groups(&self) -> zbus::Result<Vec<String>>;
144
145 fn open_wayland_connection(&self, name: &str) -> zbus::Result<()>;
147
148 fn open_wayland_connection_socket(&self, fd: zbus::zvariant::Fd<'_>) -> zbus::Result<()>;
150
151 #[zbus(name = "OpenX11Connection")]
153 fn open_x11connection(&self, name: &str) -> zbus::Result<()>;
154
155 fn refresh(&self) -> zbus::Result<()>;
157
158 fn reload_addon_config(&self, addon_name: &str) -> zbus::Result<()>;
160
161 fn reload_config(&self) -> zbus::Result<()>;
163
164 fn remove_input_method_group(&self, group: &str) -> zbus::Result<()>;
166
167 fn reopen_wayland_connection_socket(
169 &self,
170 name: &str,
171 fd: zbus::zvariant::Fd<'_>,
172 ) -> zbus::Result<()>;
173
174 #[zbus(name = "ResetIMList")]
176 fn reset_imlist(&self) -> zbus::Result<()>;
177
178 fn restart(&self) -> zbus::Result<()>;
180
181 fn save(&self) -> zbus::Result<()>;
183
184 fn set_addons_state(&self, addons: &[(&str, bool)]) -> zbus::Result<()>;
186
187 fn set_config(&self, uri: &str, v: &zbus::zvariant::Value<'_>) -> zbus::Result<()>;
189
190 #[zbus(name = "SetCurrentIM")]
192 fn set_current_im(&self, im_name: &str) -> zbus::Result<()>;
193
194 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 fn set_log_rule(&self, rule: &str) -> zbus::Result<()>;
204
205 fn state(&self) -> zbus::Result<i32>;
207
208 fn switch_input_method_group(&self, group: &str) -> zbus::Result<()>;
210
211 fn toggle(&self) -> zbus::Result<()>;
213
214 #[zbus(signal)]
216 fn input_method_groups_changed(&self) -> zbus::Result<()>;
217}