pub trait TextInputClient: Sized + 'static {
// Required methods
fn current_text_editing_value(
self: Handle<Self>,
app: &App,
) -> Option<TextEditingValue>;
fn update_editing_value(
self: Handle<Self>,
app: &mut App,
value: TextEditingValue,
);
fn perform_action(
self: Handle<Self>,
app: &mut App,
action: TextInputAction,
);
fn connection_closed(self: Handle<Self>, app: &mut App);
// Provided methods
fn perform_private_command(self: Handle<Self>, app: &mut App, action: &str) { ... }
fn update_floating_cursor(
self: Handle<Self>,
app: &mut App,
point: RawFloatingCursorPoint,
) { ... }
fn show_autocorrection_prompt_rect(
self: Handle<Self>,
app: &mut App,
start: i32,
end: i32,
) { ... }
fn show_toolbar(self: Handle<Self>, app: &mut App) { ... }
fn insert_text_placeholder(self: Handle<Self>, app: &mut App, size: Size) { ... }
fn remove_text_placeholder(self: Handle<Self>, app: &mut App) { ... }
fn perform_selector(self: Handle<Self>, app: &mut App, selector_name: &str) { ... }
fn as_text_input_client(self: Handle<Self>) -> AnyTextInputClient { ... }
}Expand description
An interface to receive information from TextInput.
See also:
TextInput::attachEditableText, aTextInputClientimplementation.
Required Methods§
Sourcefn current_text_editing_value(
self: Handle<Self>,
app: &App,
) -> Option<TextEditingValue>
fn current_text_editing_value( self: Handle<Self>, app: &App, ) -> Option<TextEditingValue>
The current state of the TextEditingValue held by this client.
Sourcefn update_editing_value(
self: Handle<Self>,
app: &mut App,
value: TextEditingValue,
)
fn update_editing_value( self: Handle<Self>, app: &mut App, value: TextEditingValue, )
Requests that this client update its editing state to the given value.
The new value is treated as user input and thus may subject to input
formatting.
Sourcefn perform_action(self: Handle<Self>, app: &mut App, action: TextInputAction)
fn perform_action(self: Handle<Self>, app: &mut App, action: TextInputAction)
Requests that this client perform the given action.
Sourcefn connection_closed(self: Handle<Self>, app: &mut App)
fn connection_closed(self: Handle<Self>, app: &mut App)
Platform notified framework of closed connection.
TextInputClient should cleanup its connection and finalize editing.
Provided Methods§
Sourcefn perform_private_command(self: Handle<Self>, app: &mut App, action: &str)
fn perform_private_command(self: Handle<Self>, app: &mut App, action: &str)
Request from the input method that this client perform the given private command.
Sourcefn update_floating_cursor(
self: Handle<Self>,
app: &mut App,
point: RawFloatingCursorPoint,
)
fn update_floating_cursor( self: Handle<Self>, app: &mut App, point: RawFloatingCursorPoint, )
Updates the floating cursor position and state.
Sourcefn show_autocorrection_prompt_rect(
self: Handle<Self>,
app: &mut App,
start: i32,
end: i32,
)
fn show_autocorrection_prompt_rect( self: Handle<Self>, app: &mut App, start: i32, end: i32, )
Requests that this client display a prompt rectangle for the given text range, to indicate the range of text that will be changed by a pending autocorrection.
Sourcefn show_toolbar(self: Handle<Self>, app: &mut App)
fn show_toolbar(self: Handle<Self>, app: &mut App)
Requests that the client show the editing toolbar, for example when the platform changes the selection through a non-flutter method such as scribble.
Sourcefn insert_text_placeholder(self: Handle<Self>, app: &mut App, size: Size)
fn insert_text_placeholder(self: Handle<Self>, app: &mut App, size: Size)
Requests that the client add a text placeholder to reserve visual space in the text.
Sourcefn remove_text_placeholder(self: Handle<Self>, app: &mut App)
fn remove_text_placeholder(self: Handle<Self>, app: &mut App)
Requests that the client remove the text placeholder.
Sourcefn perform_selector(self: Handle<Self>, app: &mut App, selector_name: &str)
fn perform_selector(self: Handle<Self>, app: &mut App, selector_name: &str)
Performs the specified MacOS-specific selector from the
NSStandardKeyBindingResponding protocol or user-specified selector
from DefaultKeyBinding.Dict.
Sourcefn as_text_input_client(self: Handle<Self>) -> AnyTextInputClient
fn as_text_input_client(self: Handle<Self>) -> AnyTextInputClient
This client as the erased AnyTextInputClient.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".