Skip to main content

TextSelectionOverlay

Struct TextSelectionOverlay 

Source
pub struct TextSelectionOverlay {
    pub context: BuildContext,
    pub render_object: RenderHandle<RenderEditable>,
    pub selection_controls: Option<Rc<dyn TextSelectionControls>>,
    pub selection_delegate: AnyTextSelectionDelegate,
    pub context_menu_builder: Option<WidgetBuilder>,
    /* private fields */
}
Expand description

An object that manages overlay entries for selection handles.

The context must have an Overlay as an ancestor.

Fields§

§context: BuildContext

The context in which the selection UI should appear.

§render_object: RenderHandle<RenderEditable>

The editable line in which the selected text is being displayed.

§selection_controls: Option<Rc<dyn TextSelectionControls>>

Builds text selection handles and toolbar.

§selection_delegate: AnyTextSelectionDelegate

The delegate for manipulating the current selection in the owning text field.

§context_menu_builder: Option<WidgetBuilder>

If not provided, no context menu will be built.

Implementations§

Source§

impl TextSelectionOverlay

Source

pub fn new( app: &mut App, value: TextEditingValue, context: BuildContext, toolbar_layer_link: Ref<LayerLink>, start_handle_layer_link: Ref<LayerLink>, end_handle_layer_link: Ref<LayerLink>, render_object: RenderHandle<RenderEditable>, selection_delegate: AnyTextSelectionDelegate, magnifier_configuration: TextMagnifierConfiguration, ) -> Ref<Self>

Creates an object that manages overlay entries for selection handles.

The context must have an Overlay as an ancestor.

Source

pub fn debug_required_for( self: Ref<Self>, app: &mut App, widget: WidgetRef, ) -> Ref<Self>

Dart TextSelectionOverlay(debugRequiredFor:).

Source

pub fn selection_controls( self: Ref<Self>, app: &mut App, controls: Rc<dyn TextSelectionControls>, ) -> Ref<Self>

Dart TextSelectionOverlay(selectionControls:).

Source

pub fn handles_visible( self: Ref<Self>, app: &mut App, visible: bool, ) -> Ref<Self>

Dart TextSelectionOverlay(handlesVisible:).

Source

pub fn drag_start_behavior( self: Ref<Self>, app: &mut App, drag_start_behavior: DragStartBehavior, ) -> Ref<Self>

Dart TextSelectionOverlay(dragStartBehavior:).

Source

pub fn on_selection_handle_tapped( self: Ref<Self>, app: &mut App, on_selection_handle_tapped: Listener, ) -> Ref<Self>

Dart TextSelectionOverlay(onSelectionHandleTapped:).

Source

pub fn clipboard_status( self: Ref<Self>, app: &mut App, clipboard_status: Ref<ClipboardStatusNotifier>, ) -> Ref<Self>

Dart TextSelectionOverlay(clipboardStatus:).

Source

pub fn context_menu_builder( self: Ref<Self>, app: &mut App, context_menu_builder: WidgetBuilder, ) -> Ref<Self>

Dart TextSelectionOverlay(contextMenuBuilder:).

Source

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

Retrieve current value.

Source

pub fn handles_visible_value(self: Handle<Self>, app: &App) -> bool

Whether selection handles are visible.

Source

pub fn set_handles_visible(self: Handle<Self>, app: &mut App, visible: bool)

Set to false if you want to hide the handles without rebuilding them.

Source

pub fn show_handles(self: Handle<Self>, app: &mut App)

Builds the handles by inserting them into the context’s overlay.

Source

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

Destroys the handles by removing them from overlay.

Source

pub fn show_toolbar(self: Handle<Self>, app: &mut App)

Shows the toolbar by inserting it into the overlay.

Must not be called during the build or layout phase.

Source

pub fn show_spell_check_suggestions_toolbar( self: Handle<Self>, app: &mut App, spell_check_suggestions_toolbar_builder: WidgetBuilder, )

Shows toolbar with spell check suggestions of misspelled words that are available for click-and-replace.

Source

pub fn show_magnifier( self: Handle<Self>, app: &mut App, position_to_show: Offset, )

Shows the magnifier, and hides the toolbar if it was showing.

Source

pub fn update_magnifier( self: Handle<Self>, app: &mut App, position_to_show: Offset, )

Update the current magnifier with new selection data.

Source

pub fn hide_magnifier(self: Handle<Self>, app: &mut App)

Hide the current magnifier.

Source

pub fn update(self: Handle<Self>, app: &mut App, new_value: TextEditingValue)

Updates the overlay after the selection has changed.

Source

pub fn update_for_scroll(self: Handle<Self>, app: &mut App)

Causes the overlay to update its rendering after a scroll or metrics change.

Source

pub fn handles_are_visible(self: Handle<Self>, app: &App) -> bool

Whether the handles are currently visible.

Source

pub fn toolbar_is_visible(self: Handle<Self>, app: &App) -> bool

Whether the toolbar is currently visible.

Source

pub fn magnifier_is_visible(self: Handle<Self>, app: &App) -> bool

Whether the magnifier is currently visible.

Source

pub fn magnifier_exists(self: Handle<Self>, app: &App) -> bool

Whether the magnifier currently exists in the overlay.

Source

pub fn spell_check_toolbar_is_visible(self: Handle<Self>, app: &App) -> bool

Whether the spell check menu is currently visible.

Source

pub fn hide(self: Handle<Self>, app: &mut App)

Hides the entire overlay including the toolbar and the handles.

Source

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

Hides the toolbar part of the overlay.

Source

pub fn dispose(self: Handle<Self>, app: &mut App)

Disposes this object and release resources.

Auto Trait Implementations§

§

impl !RefUnwindSafe for TextSelectionOverlay

§

impl !Send for TextSelectionOverlay

§

impl !Sync for TextSelectionOverlay

§

impl !UnwindSafe for TextSelectionOverlay

§

impl Forget for TextSelectionOverlay

§

impl Freeze for TextSelectionOverlay
where NonZero<u32>: Freeze, &'static ElementVTable: Freeze, PhantomData<fn() -> RenderEditable>: Freeze, *const RcInner<dyn TextSelectionControls> is !null: Freeze, PhantomData<RcInner<dyn TextSelectionControls>>: Freeze, &'static TextSelectionDelegateVTable: Freeze, PhantomData<fn() -> SelectionOverlay>: Freeze, *const RcInner<Keep> is !null: Freeze, PhantomData<RcInner<Keep>>: Freeze, *const RcInner<dyn Fn(&mut App, AnyElement) -> Rc<dyn Widget>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, AnyElement) -> Rc<dyn Widget>>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<fn() -> ValueNotifier<bool>>: Freeze, *const RcInner<dyn Widget> is !null: Freeze, PhantomData<RcInner<dyn Widget>>: Freeze, *const RcInner<dyn Fn(&mut App)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze, *const (): Freeze, PhantomData<fn() -> ClipboardStatusNotifier>: Freeze,

§

impl Move for TextSelectionOverlay

§

impl Unpin for TextSelectionOverlay
where NonZero<u32>: Unpin, &'static ElementVTable: Unpin, Rc<dyn TextSelectionControls>: Unpin, &'static TextSelectionDelegateVTable: Unpin, Rc<Keep>: Unpin, Rc<dyn Fn(&mut App, AnyElement) -> Rc<dyn Widget>>: Unpin, *const u8 is !null: Unpin, Rc<dyn Widget>: Unpin, Rc<dyn Fn(&mut App)>: Unpin, *const (): Unpin,

§

impl UnsafeUnpin for TextSelectionOverlay
where NonZeroU32Inner: UnsafeUnpin, &'static ElementVTable: UnsafeUnpin, PhantomData<fn() -> RenderEditable>: UnsafeUnpin, *const RcInner<dyn TextSelectionControls> is !null: UnsafeUnpin, PhantomData<RcInner<dyn TextSelectionControls>>: UnsafeUnpin, &'static TextSelectionDelegateVTable: UnsafeUnpin, PhantomData<fn() -> SelectionOverlay>: UnsafeUnpin, *const RcInner<Keep> is !null: UnsafeUnpin, PhantomData<RcInner<Keep>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App, AnyElement) -> Rc<dyn Widget>> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, AnyElement) -> Rc<dyn Widget>>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, PhantomData<fn() -> ValueNotifier<bool>>: UnsafeUnpin, *const RcInner<dyn Widget> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Widget>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin, *const (): UnsafeUnpin, PhantomData<fn() -> ClipboardStatusNotifier>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>