ferroui_base/input/text_input/i_text_input_method_impl.rs
1use super::{TextInputMethodClient, TextInputOptions};
2use crate::Rect;
3use std::rc::Rc;
4
5/// The input method of the platform, as seen by an input root.
6///
7/// This contract is not stable: it follows the needs of the platform
8/// backends.
9pub trait ITextInputMethodImpl {
10 /// Sets the text editing client the input method talks to, or detaches
11 /// it from the current one.
12 fn set_client(&self, client: Option<Rc<dyn TextInputMethodClient>>);
13
14 /// Sets the rectangle of the text cursor, in the coordinates of the
15 /// root.
16 fn set_cursor_rect(&self, rect: Rect);
17
18 /// Sets the options of the text input of the current client.
19 fn set_options(&self, options: &TextInputOptions);
20
21 /// Resets the state of the input method.
22 fn reset(&self);
23}