Skip to main content

TextSelectionDelegate

Trait TextSelectionDelegate 

Source
pub trait TextSelectionDelegate: Sized + 'static {
Show 17 methods // Required methods fn text_editing_value(self: Handle<Self>, app: &App) -> TextEditingValue; fn user_update_text_editing_value( self: Handle<Self>, app: &mut App, value: TextEditingValue, cause: SelectionChangedCause, ); fn hide_toolbar(self: Handle<Self>, app: &mut App, hide_handles: bool); fn bring_into_view( self: Handle<Self>, app: &mut App, position: TextPosition, ); fn cut_selection( self: Handle<Self>, app: &mut App, cause: SelectionChangedCause, ); fn paste_text( self: Handle<Self>, app: &mut App, cause: SelectionChangedCause, ) -> Task<()> ⓘ; fn select_all( self: Handle<Self>, app: &mut App, cause: SelectionChangedCause, ); fn copy_selection( self: Handle<Self>, app: &mut App, cause: SelectionChangedCause, ); // Provided methods fn cut_enabled(self: Handle<Self>, _app: &App) -> bool { ... } fn copy_enabled(self: Handle<Self>, _app: &App) -> bool { ... } fn paste_enabled(self: Handle<Self>, _app: &App) -> bool { ... } fn select_all_enabled(self: Handle<Self>, _app: &App) -> bool { ... } fn look_up_enabled(self: Handle<Self>, _app: &App) -> bool { ... } fn search_web_enabled(self: Handle<Self>, _app: &App) -> bool { ... } fn share_enabled(self: Handle<Self>, _app: &App) -> bool { ... } fn live_text_input_enabled(self: Handle<Self>, _app: &App) -> bool { ... } fn as_text_selection_delegate( self: Handle<Self>, ) -> AnyTextSelectionDelegate { ... }
}
Expand description

An interface for manipulating the selection, to be used by the implementor of the toolbar widget.

Required Methods§

Source

fn text_editing_value(self: Handle<Self>, app: &App) -> TextEditingValue

Gets the current text input.

Source

fn user_update_text_editing_value( self: Handle<Self>, app: &mut App, value: TextEditingValue, cause: SelectionChangedCause, )

Indicates that the user has requested the delegate to replace its current text editing state with value.

The new value is treated as user input and thus may subject to input formatting.

Source

fn hide_toolbar(self: Handle<Self>, app: &mut App, hide_handles: bool)

Hides the text selection toolbar.

By default, hide_handles is true, and the toolbar is hidden along with its handles. If hide_handles is set to false, then the toolbar will be hidden but the handles will remain.

Source

fn bring_into_view(self: Handle<Self>, app: &mut App, position: TextPosition)

Brings the provided [TextPosition] into the visible area of the text input.

Source

fn cut_selection( self: Handle<Self>, app: &mut App, cause: SelectionChangedCause, )

Cut current selection to crate::Clipboard.

Source

fn paste_text( self: Handle<Self>, app: &mut App, cause: SelectionChangedCause, ) -> Task<()> ⓘ

Paste text from crate::Clipboard.

Source

fn select_all(self: Handle<Self>, app: &mut App, cause: SelectionChangedCause)

Set the current selection to contain the entire text value.

Source

fn copy_selection( self: Handle<Self>, app: &mut App, cause: SelectionChangedCause, )

Copy current selection to crate::Clipboard.

Provided Methods§

Source

fn cut_enabled(self: Handle<Self>, _app: &App) -> bool

Whether cut is enabled.

Source

fn copy_enabled(self: Handle<Self>, _app: &App) -> bool

Whether copy is enabled.

Source

fn paste_enabled(self: Handle<Self>, _app: &App) -> bool

Whether paste is enabled.

Source

fn select_all_enabled(self: Handle<Self>, _app: &App) -> bool

Whether select all is enabled.

Source

fn look_up_enabled(self: Handle<Self>, _app: &App) -> bool

Whether look up is enabled.

Source

fn search_web_enabled(self: Handle<Self>, _app: &App) -> bool

Whether search web is enabled.

Source

fn share_enabled(self: Handle<Self>, _app: &App) -> bool

Whether share is enabled.

Source

fn live_text_input_enabled(self: Handle<Self>, _app: &App) -> bool

Whether Live Text input is enabled.

Source

fn as_text_selection_delegate(self: Handle<Self>) -> AnyTextSelectionDelegate

This delegate as the erased AnyTextSelectionDelegate.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§