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§
Sourcefn text_editing_value(self: Handle<Self>, app: &App) -> TextEditingValue
fn text_editing_value(self: Handle<Self>, app: &App) -> TextEditingValue
Gets the current text input.
Sourcefn user_update_text_editing_value(
self: Handle<Self>,
app: &mut App,
value: TextEditingValue,
cause: SelectionChangedCause,
)
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.
Sourcefn hide_toolbar(self: Handle<Self>, app: &mut App, hide_handles: bool)
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.
Sourcefn bring_into_view(self: Handle<Self>, app: &mut App, position: TextPosition)
fn bring_into_view(self: Handle<Self>, app: &mut App, position: TextPosition)
Brings the provided [TextPosition] into the visible area of the text
input.
Sourcefn cut_selection(
self: Handle<Self>,
app: &mut App,
cause: SelectionChangedCause,
)
fn cut_selection( self: Handle<Self>, app: &mut App, cause: SelectionChangedCause, )
Cut current selection to crate::Clipboard.
Sourcefn paste_text(
self: Handle<Self>,
app: &mut App,
cause: SelectionChangedCause,
) -> Task<()> ⓘ
fn paste_text( self: Handle<Self>, app: &mut App, cause: SelectionChangedCause, ) -> Task<()> ⓘ
Paste text from crate::Clipboard.
Sourcefn select_all(self: Handle<Self>, app: &mut App, cause: SelectionChangedCause)
fn select_all(self: Handle<Self>, app: &mut App, cause: SelectionChangedCause)
Set the current selection to contain the entire text value.
Sourcefn copy_selection(
self: Handle<Self>,
app: &mut App,
cause: SelectionChangedCause,
)
fn copy_selection( self: Handle<Self>, app: &mut App, cause: SelectionChangedCause, )
Copy current selection to crate::Clipboard.
Provided Methods§
Sourcefn cut_enabled(self: Handle<Self>, _app: &App) -> bool
fn cut_enabled(self: Handle<Self>, _app: &App) -> bool
Whether cut is enabled.
Sourcefn copy_enabled(self: Handle<Self>, _app: &App) -> bool
fn copy_enabled(self: Handle<Self>, _app: &App) -> bool
Whether copy is enabled.
Sourcefn paste_enabled(self: Handle<Self>, _app: &App) -> bool
fn paste_enabled(self: Handle<Self>, _app: &App) -> bool
Whether paste is enabled.
Sourcefn select_all_enabled(self: Handle<Self>, _app: &App) -> bool
fn select_all_enabled(self: Handle<Self>, _app: &App) -> bool
Whether select all is enabled.
Sourcefn look_up_enabled(self: Handle<Self>, _app: &App) -> bool
fn look_up_enabled(self: Handle<Self>, _app: &App) -> bool
Whether look up is enabled.
Sourcefn search_web_enabled(self: Handle<Self>, _app: &App) -> bool
fn search_web_enabled(self: Handle<Self>, _app: &App) -> bool
Whether search web is enabled.
Whether share is enabled.
Sourcefn live_text_input_enabled(self: Handle<Self>, _app: &App) -> bool
fn live_text_input_enabled(self: Handle<Self>, _app: &App) -> bool
Whether Live Text input is enabled.
Sourcefn as_text_selection_delegate(self: Handle<Self>) -> AnyTextSelectionDelegate
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".