pub trait IBusEngine: Send + Sync {
// Provided methods
fn process_key_event(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
_keyval: Keysym,
_keycode: KeyCode,
_state: IBusModifierState,
) -> impl Future<Output = Result<bool>> + Send { ... }
fn set_cursor_location(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
_x: i32,
_y: i32,
_w: i32,
_h: i32,
) -> impl Future<Output = Result<()>> + Send { ... }
fn focus_in(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send { ... }
fn focus_out(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send { ... }
fn reset(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send { ... }
fn enable(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send { ... }
fn disable(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send { ... }
fn candidate_clicked(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
_index: u32,
_button: u32,
_state: u32,
) -> impl Future<Output = Result<()>> + Send { ... }
fn page_up(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send { ... }
fn page_down(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send { ... }
fn cursor_up(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send { ... }
fn cursor_down(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send { ... }
}Expand description
Implement this trait to implement an input method.
Your implementation can use the methods of the IBusEngineBackend
to display text to the user.
Provided Methods§
Sourcefn process_key_event(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
_keyval: Keysym,
_keycode: KeyCode,
_state: IBusModifierState,
) -> impl Future<Output = Result<bool>> + Send
fn process_key_event( &mut self, _se: SignalEmitter<'_>, _server: &ObjectServer, _keyval: Keysym, _keycode: KeyCode, _state: IBusModifierState, ) -> impl Future<Output = Result<bool>> + Send
A key was pressed or released.
keyval encodes the symbol of the key interpreted according to the current keyboard layout.
keycode encodes the position of the key on the keyboard, which is independent of the
keyboard layout.
state encodes wether the key was pressed or released, and modifiers (shift, control…).
Note that when shift+a is pressed, keyval will be Keysym::A (instead of Keysym::a).
state.shift() will still be true. Same applies for AltGr in keyboard layouts which
have it.
Sourcefn set_cursor_location(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
_x: i32,
_y: i32,
_w: i32,
_h: i32,
) -> impl Future<Output = Result<()>> + Send
fn set_cursor_location( &mut self, _se: SignalEmitter<'_>, _server: &ObjectServer, _x: i32, _y: i32, _w: i32, _h: i32, ) -> impl Future<Output = Result<()>> + Send
设置光标位置
Sourcefn focus_in(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send
fn focus_in( &mut self, _se: SignalEmitter<'_>, _server: &ObjectServer, ) -> impl Future<Output = Result<()>> + Send
获得焦点
Sourcefn focus_out(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send
fn focus_out( &mut self, _se: SignalEmitter<'_>, _server: &ObjectServer, ) -> impl Future<Output = Result<()>> + Send
失去焦点
Sourcefn reset(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send
fn reset( &mut self, _se: SignalEmitter<'_>, _server: &ObjectServer, ) -> impl Future<Output = Result<()>> + Send
重置
Sourcefn enable(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send
fn enable( &mut self, _se: SignalEmitter<'_>, _server: &ObjectServer, ) -> impl Future<Output = Result<()>> + Send
启用
Sourcefn disable(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send
fn disable( &mut self, _se: SignalEmitter<'_>, _server: &ObjectServer, ) -> impl Future<Output = Result<()>> + Send
禁用
Sourcefn candidate_clicked(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
_index: u32,
_button: u32,
_state: u32,
) -> impl Future<Output = Result<()>> + Send
fn candidate_clicked( &mut self, _se: SignalEmitter<'_>, _server: &ObjectServer, _index: u32, _button: u32, _state: u32, ) -> impl Future<Output = Result<()>> + Send
(UI) Emitted when a candidate on a lookup table is clicked
_index is the 0-based index of the clicked candiate in the current page, not in the full lookup table
Sourcefn page_up(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send
fn page_up( &mut self, _se: SignalEmitter<'_>, _server: &ObjectServer, ) -> impl Future<Output = Result<()>> + Send
(UI) Emitted when the “previous page” button is clicked on a lookup table
Sourcefn page_down(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send
fn page_down( &mut self, _se: SignalEmitter<'_>, _server: &ObjectServer, ) -> impl Future<Output = Result<()>> + Send
(UI) Emitted when the “next page” button is clicked on a lookup table
Sourcefn cursor_up(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send
fn cursor_up( &mut self, _se: SignalEmitter<'_>, _server: &ObjectServer, ) -> impl Future<Output = Result<()>> + Send
(UI) Emmitted when the user scrolls up (with the mouse wheel) on a lookup table
Sourcefn cursor_down(
&mut self,
_se: SignalEmitter<'_>,
_server: &ObjectServer,
) -> impl Future<Output = Result<()>> + Send
fn cursor_down( &mut self, _se: SignalEmitter<'_>, _server: &ObjectServer, ) -> impl Future<Output = Result<()>> + Send
(UI) Emmitted when the user scrolls down (with the mouse wheel) on a lookup table
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.