Skip to main content

PlainStaticSelectionContainerDelegate

Struct PlainStaticSelectionContainerDelegate 

Source
pub struct PlainStaticSelectionContainerDelegate { /* private fields */ }
Expand description

Dart’s instantiable StaticSelectionContainerDelegate().

A delegate that handles selection events for the selectables in a SelectionContainer, which SelectableRegion uses. A Waft app that needs another behavior writes its own struct of StaticSelectionContainerDelegate and overrides the members it changes.

Implementations§

Source§

impl PlainStaticSelectionContainerDelegate

Source

pub fn new(app: &mut App) -> Ref<PlainStaticSelectionContainerDelegate>

Creates a delegate over no selectables and no selection.

Trait Implementations§

Source§

impl ChangeNotifier for PlainStaticSelectionContainerDelegate

Source§

fn change_notifier_data(&self) -> &ChangeNotifierData

Source§

fn change_notifier_data_mut(&mut self) -> &mut ChangeNotifierData

Source§

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

Runs before the listener is stored. Dart overrides of addListener that work before super.addListener go here.
Source§

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

Runs after the listener is removed. Dart overrides of removeListener that work after super.removeListener go here.
Source§

impl Debug for PlainStaticSelectionContainerDelegate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl MultiSelectableSelectionContainerDelegate for PlainStaticSelectionContainerDelegate

Source§

fn multi_selectable_selection_container_delegate_data( self: Handle<Self>, app: &App, ) -> &MultiSelectableSelectionContainerDelegateData

Dart’s MultiSelectableSelectionContainerDelegate fields, held under the field multi_selectable_selection_container_delegate (multi_selectable_selection_container_delegate_accessors!).
Source§

fn multi_selectable_selection_container_delegate_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut MultiSelectableSelectionContainerDelegateData

Source§

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

Called when this delegate finishes updating the selectables.
Source§

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

Selects all contents of all selectables.
Source§

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

Selects a word in a selectable at the location the event names.
Source§

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

Selects a paragraph in a selectable at the location the event names.
Source§

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

Removes the selection of all selectables this delegate manages.
Source§

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

Updates the selection edges.
Source§

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

Discards the resources the delegate holds; Dart’s dispose, as ChangeNotifier.dispose takes it.
Source§

fn ensure_child_updated( self: Handle<Self>, app: &mut App, selectable: AnySelectable, )

Ensures the selectable child has received an up to date selection event. Read more
Source§

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

Dispatches a selection event to one selectable. Read more
Source§

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

Notifies this delegate that layout of the container has changed.
Source§

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

The combined SelectionGeometry for child selectables.
Source§

fn compare_order( self: Handle<Self>, app: &mut App, a: AnySelectable, b: AnySelectable, ) -> Ordering

The compare function this delegate uses for the selection order of the selectables. Read more
Source§

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

Extends the current selection by a waft_rendering::TextGranularity.
Source§

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

Extends the current selection in a SelectionExtendDirection.
Source§

impl SelectionContainerDelegate for PlainStaticSelectionContainerDelegate

Source§

fn selection_container_delegate_data( self: Handle<Self>, app: &App, ) -> &SelectionContainerDelegateData

The fields of this class.
Source§

fn selection_container_delegate_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut SelectionContainerDelegateData

The fields of this class, mutably.
Source§

fn as_selection_container_delegate( self: Handle<Self>, ) -> AnySelectionContainerDelegate

Erases this delegate for a SelectionContainer, as Dart’s implicit upcast.
Source§

fn get_transform_from( self: Handle<Self>, app: &App, child: AnySelectable, ) -> Matrix4

Gets the paint transform from the Selectable child to the SelectionContainer of this delegate; the container must have been laid out.
Source§

fn get_transform_to( self: Handle<Self>, app: &App, ancestor: Option<AnyRenderObject>, ) -> Matrix4

Gets the paint transform from the SelectionContainer of this delegate to ancestor; the container must have been laid out.
Source§

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

Whether the SelectionContainer has undergone layout and has a size.
Source§

fn container_size(self: Handle<Self>, app: &App) -> Size

Gets the size of the SelectionContainer of this delegate; it must have been laid out.
Source§

fn selection_container_context(self: Handle<Self>, app: &App) -> BuildContext

Dart’s _selectionContainerContext!: the context of the container this delegate serves.
Source§

impl SelectionHandler for PlainStaticSelectionContainerDelegate

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.
Source§

impl SelectionRegistrar for PlainStaticSelectionContainerDelegate

Source§

fn add(self: Handle<Self>, app: &mut App, selectable: AnySelectable)

Adds selectable to the registrar.
Source§

fn remove(self: Handle<Self>, app: &mut App, selectable: AnySelectable)

Removes selectable from the registrar.
Source§

fn as_selection_registrar(self: Handle<Self>) -> AnySelectionRegistrar

Erases this registrar, as Dart’s implicit upcast.
Source§

impl StaticSelectionContainerDelegate for PlainStaticSelectionContainerDelegate

Source§

fn static_selection_container_delegate_data( self: Handle<Self>, app: &App, ) -> &StaticSelectionContainerDelegateData

Dart’s StaticSelectionContainerDelegate fields, held under the field static_selection_container_delegate (static_selection_container_delegate_accessors!).
Source§

fn static_selection_container_delegate_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut StaticSelectionContainerDelegateData

Source§

fn did_receive_selection_event_for( self: Handle<Self>, app: &mut App, selectable: AnySelectable, for_end: Option<bool>, )

Tracks whether a selection edge update event for selectable was received. Read more
Source§

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

Updates the internal selection state after a SelectionEvent that selects a boundary, such as select-word, select-paragraph and select-all.
Source§

fn update_last_selection_edge_location( self: Handle<Self>, app: &mut App, global_selection_edge_location: Offset, for_end: bool, )

Updates the last selection edge location of the edge for_end names.
Source§

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

Clears the internal selection state: no selectable under this delegate has received a start or end event, and no edge location is remembered.
Source§

fn clear_internal_selection_state_for_selectable( self: Handle<Self>, app: &mut App, selectable: AnySelectable, )

Clears the internal selection state of selectable.

Auto Trait Implementations§

§

impl !RefUnwindSafe for PlainStaticSelectionContainerDelegate

§

impl !Send for PlainStaticSelectionContainerDelegate

§

impl !Sync for PlainStaticSelectionContainerDelegate

§

impl !UnwindSafe for PlainStaticSelectionContainerDelegate

§

impl Forget for PlainStaticSelectionContainerDelegate

§

impl Freeze for PlainStaticSelectionContainerDelegate
where NonZero<u32>: Freeze, &'static ElementVTable: Freeze, *const u8 is !null: Freeze, PhantomData<Option<Listener>>: Freeze, *const RcInner<Cell<usize>> is !null: Freeze, PhantomData<RcInner<Cell<usize>>>: Freeze, PhantomData<AnySelectable>: Freeze, PhantomData<fn() -> LayerLink>: Freeze, *const RcInner<Keep> is !null: Freeze, PhantomData<RcInner<Keep>>: Freeze, &'static SelectableVTable: Freeze, PhantomData<Rect>: Freeze,

§

impl Move for PlainStaticSelectionContainerDelegate

§

impl Unpin for PlainStaticSelectionContainerDelegate
where NonZero<u32>: Unpin, &'static ElementVTable: Unpin, *const u8 is !null: Unpin, Rc<dyn Fn(&mut App)>: Unpin, *const (): Unpin, Rc<Cell<usize>>: Unpin, &'static SelectableVTable: Unpin, Rc<Keep>: Unpin,

§

impl UnsafeUnpin for PlainStaticSelectionContainerDelegate
where NonZeroU32Inner: UnsafeUnpin, &'static ElementVTable: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<Option<Listener>>: UnsafeUnpin, *const RcInner<Cell<usize>> is !null: UnsafeUnpin, PhantomData<RcInner<Cell<usize>>>: UnsafeUnpin, PhantomData<AnySelectable>: UnsafeUnpin, PhantomData<fn() -> LayerLink>: UnsafeUnpin, *const RcInner<Keep> is !null: UnsafeUnpin, PhantomData<RcInner<Keep>>: UnsafeUnpin, &'static SelectableVTable: UnsafeUnpin, PhantomData<Rect>: 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> ListenableObject for T
where T: ChangeNotifier,

Source§

fn add_listener(self: Handle<T>, app: &mut App, listener: Listener)

Register a closure to be called when the object notifies its listeners.
Source§

fn remove_listener(self: Handle<T>, app: &mut App, listener: &Listener)

Remove a previously registered closure from the list of closures that the object notifies.
Source§

impl<T> MultiSelectableSelectionContainerDelegateBase for T

Source§

fn add(self: Handle<Self>, app: &mut App, selectable: AnySelectable)

Dart’s MultiSelectableSelectionContainerDelegate.add: queue the selectable until after this frame, when the container has laid it out.
Source§

fn remove(self: Handle<Self>, app: &mut App, selectable: AnySelectable)

Dart’s MultiSelectableSelectionContainerDelegate.remove.
Source§

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

Dart’s dispatchSelectionEventToChild: send the event to the selectable.
Source§

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

Dart’s _scheduleSelectableUpdate: one update per frame, on the microtask queue when the frame’s own callbacks are running so a nested container is updated in the same frame.
Source§

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

Dart’s runScheduledTask.
Source§

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

Dart’s _updateSelectables: fold the selectables added since the last frame in, then let the geometry catch up with them. Read more
Source§

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

Dart’s _flushAdditions: merge the new selectables into screen order, keeping the selection indices on the selectables they named.
Source§

fn remove_selectable( self: Handle<Self>, app: &mut App, selectable: AnySelectable, )

Dart’s _removeSelectable.
Source§

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

Dart’s didChangeSelectables.
Source§

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

Dart’s value: the combined geometry of the selectables.
Source§

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

Dart’s _updateSelectionGeometry: fold the selectables’ geometries into value, telling listeners when it changed, and hand the handles to the selectables on the edges.
Source§

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

Dart’s _handleSelectableGeometryChange.
Source§

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

Dart’s getSelectionGeometry: one geometry covering the selectables from the start edge to the end edge, in the container’s coordinates.
Source§

fn adjust_selection_index_based_on_selection_geometry( self: Handle<Self>, app: &App, current_index: i32, toward_index: i32, ) -> i32

Dart’s _adjustSelectionIndexBasedOnSelectionGeometry: the current edge index may point at a selectable whose own selection is collapsed at its edge, so move it toward the opposite edge to one with a selection.
Source§

fn compare_order( self: Handle<Self>, app: &mut App, a: AnySelectable, b: AnySelectable, ) -> Ordering

Dart’s compareOrder: the default is screen order.
Source§

fn get_bounding_box( self: Handle<Self>, app: &mut App, selectable: AnySelectable, ) -> Rect

Dart’s _getBoundingBox: every bounding box of the selectable, unioned.
Source§

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

Dart’s pushHandleLayers.
Source§

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

Dart’s _updateHandleLayersAndOwners: hand both handle layers to the selectables that hold the selection edges, hiding a handle outside the container’s drawable area.
Source§

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

Dart’s getSelectedContent: the selected contents of all selectables, concatenated.
Source§

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

Dart’s contentLength: the sum of every selectable’s content length.
Source§

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

Dart’s getSelection: the selection range across the selectables, in content offsets.
Source§

fn calculate_local_range( self: Handle<Self>, app: &App, selections: &[(usize, Option<SelectedContentRange>)], ) -> Option<SelectedContentRange>

Dart’s _calculateLocalRange: the range the selectables’ own ranges make up, offset by the content before them.
Source§

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

Dart’s _flushInactiveSelections: clear the selection of every selectable outside the edges, or of every selectable but the one edge that exists.
Source§

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

Dart’s handleSelectAll: select every selectable.
Source§

fn clear_selectables(self: Handle<Self>, app: &mut App, skip_index: Option<i32>)

Dart’s _clearSelectables: clear the selection of every selectable but skip_index.
Source§

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

Dart’s _handleSelectBoundary: the word or paragraph at the event’s position, in the selectable under it, or the nearest one when no bounding box contains it.
Source§

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

Dart’s handleSelectWord.
Source§

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

Dart’s handleSelectParagraph.
Source§

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

Dart’s handleClearSelection: clear the selection of every selectable.
Source§

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

Dart’s handleGranularlyExtendSelection.
Source§

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

Dart’s handleDirectionallyExtendSelection.
Source§

fn assert_selection_indices_agree(self: Handle<Self>, app: &App)

Dart’s assert((currentSelectionStartIndex == -1) == (currentSelectionEndIndex == -1)), as a debug check.
Source§

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

Dart’s handleSelectionEdgeUpdate: start the selection when the edge is new, and move it across the selectables otherwise.
Source§

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

Dart’s _initSelection: find the selectable that contains the new edge, sweeping from the opposite edge when it exists.
Source§

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

Dart’s _adjustSelection: move an edge that already has a selectable, searching from the opposite edge when the current one is out of the viewport.
Source§

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

Dart’s dispatchSelectionEvent: hand the event to the handler its type names, keeping the selectables in screen order while a selection is in progress.
Source§

fn set_extend_selection_in_progress( self: Handle<Self>, app: &mut App, value: bool, )

Dart’s _extendSelectionInProgress =.
Source§

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

Dart’s dispose: stop listening to the selectables, forget them, and dispose the ChangeNotifier.
Source§

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

Source§

impl<T> StaticSelectionContainerDelegateBase for T

Source§

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

Dart’s getSelectedContent, inherited.
Source§

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

Dart’s value, inherited.
Source§

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

Dart’s pushHandleLayers, inherited.
Source§

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

Dart’s getSelection, inherited.
Source§

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

Dart’s dispatchSelectionEvent, inherited.
Source§

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

Dart’s contentLength, inherited.
Source§

fn add(self: Handle<Self>, app: &mut App, selectable: AnySelectable)

Dart’s add, inherited.
Source§

fn remove(self: Handle<Self>, app: &mut App, selectable: AnySelectable)

Dart’s StaticSelectionContainerDelegate.remove.
Source§

fn did_receive_selection_event_for( self: Handle<Self>, app: &mut App, selectable: AnySelectable, for_end: Option<bool>, )

Dart’s didReceiveSelectionEventFor.
Source§

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

Dart’s didReceiveSelectionBoundaryEvents.
Source§

fn update_last_selection_edge_location( self: Handle<Self>, app: &mut App, global_selection_edge_location: Offset, for_end: bool, )

Dart’s updateLastSelectionEdgeLocation.
Source§

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

Dart’s _updateLastSelectionEdgeLocationsFromGeometries.
Source§

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

Dart’s clearInternalSelectionState.
Source§

fn clear_internal_selection_state_for_selectable( self: Handle<Self>, app: &mut App, selectable: AnySelectable, )

Dart’s clearInternalSelectionStateForSelectable.
Source§

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

Dart’s handleSelectAll.
Source§

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

Dart’s handleSelectWord.
Source§

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

Dart’s handleSelectParagraph.
Source§

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

Dart’s handleClearSelection.
Source§

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

Dart’s handleSelectionEdgeUpdate.
Source§

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

Dart’s dispose.
Source§

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

Dart’s dispatchSelectionEventToChild: mark the edge the child is about to receive, and bring it up to date, before sending the event on.
Source§

fn ensure_child_updated( self: Handle<Self>, app: &mut App, selectable: AnySelectable, )

Dart’s ensureChildUpdated: synthesize the edge event the child has not seen, from the last edge location, so a selectable added inside the selection is selected at once.
Source§

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

Dart’s didChangeSelectables: replay the last edge updates over the new list, then drop the selectables that are gone from the edge bookkeeping.
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>