Skip to main content

SelectionHandler

Trait SelectionHandler 

Source
pub trait SelectionHandler: ListenableObject {
    // Required methods
    fn value(self: Handle<Self>, app: &App) -> SelectionGeometry;
    fn push_handle_layers(
        self: Handle<Self>,
        app: &mut App,
        start_handle: Option<Ref<LayerLink>>,
        end_handle: Option<Ref<LayerLink>>,
    );
    fn selected_content(
        self: Handle<Self>,
        app: &App,
    ) -> Option<SelectedContent>;
    fn selection(self: Handle<Self>, app: &App) -> Option<SelectedContentRange>;
    fn dispatch_selection_event(
        self: Handle<Self>,
        app: &mut App,
        event: &SelectionEvent,
    ) -> SelectionResult;
    fn content_length(self: Handle<Self>, app: &App) -> usize;
}
Expand description

The abstract interface to handle SelectionEvents.

Extended by Selectable and by a widget’s selection container delegate. This class returns a SelectionGeometry as its value and notifies its listeners when that geometry changes, as Dart’s ValueListenable<SelectionGeometry>.

Required Methods§

Source

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

The geometry of the current selection.

Source

fn push_handle_layers( self: Handle<Self>, app: &mut App, start_handle: Option<Ref<LayerLink>>, end_handle: Option<Ref<LayerLink>>, )

Marks this handler responsible for pushing LeaderLayers for the selection handles. None cleans up a layer it pushed before.

Source

fn selected_content(self: Handle<Self>, app: &App) -> Option<SelectedContent>

The selected content in this object, if anything is selected.

Source

fn selection(self: Handle<Self>, app: &App) -> Option<SelectedContentRange>

The selected range in this object; None when nothing is selected.

Source

fn dispatch_selection_event( self: Handle<Self>, app: &mut App, event: &SelectionEvent, ) -> SelectionResult

Handles a selection event sent to this object.

Source

fn content_length(self: Handle<Self>, app: &App) -> usize

The length of the content in this object.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§