pub enum SelectionEvent {
StartEdgeUpdate {
global_position: Offset,
granularity: TextGranularity,
},
EndEdgeUpdate {
global_position: Offset,
granularity: TextGranularity,
},
Clear,
SelectAll,
SelectWord {
global_position: Offset,
},
SelectParagraph {
global_position: Offset,
absorb: bool,
},
GranularlyExtendSelection {
forward: bool,
is_end: bool,
granularity: TextGranularity,
},
DirectionallyExtendSelection {
dx: f64,
is_end: bool,
direction: SelectionExtendDirection,
},
}Expand description
A selection event sent to a SelectionHandler.
Dart’s abstract SelectionEvent and its subclasses are one enum: the subclass is the variant,
and SelectionEventType follows from it.
Variants§
StartEdgeUpdate
Updates the selection start edge.
Fields
granularity: TextGranularityThe granularity the edge moves by.
EndEdgeUpdate
Updates the selection end edge.
Fields
granularity: TextGranularityThe granularity the edge moves by.
Clear
Clears the current selection.
SelectAll
Selects all the available content.
SelectWord
Selects the word at global_position.
SelectParagraph
Selects the paragraph at global_position.
Fields
GranularlyExtendSelection
Extends the start or end of the selection by granularity.
Fields
granularity: TextGranularityThe granularity to extend by.
DirectionallyExtendSelection
Extends the current selection with respect to direction.
Implementations§
Source§impl SelectionEvent
impl SelectionEvent
Sourcepub fn ty(&self) -> SelectionEventType
pub fn ty(&self) -> SelectionEventType
The type of this event.
Sourcepub fn for_start(
global_position: Offset,
granularity: Option<TextGranularity>,
) -> SelectionEvent
pub fn for_start( global_position: Offset, granularity: Option<TextGranularity>, ) -> SelectionEvent
Creates a start-edge update at global_position, at character granularity unless given.
Sourcepub fn for_end(
global_position: Offset,
granularity: Option<TextGranularity>,
) -> SelectionEvent
pub fn for_end( global_position: Offset, granularity: Option<TextGranularity>, ) -> SelectionEvent
Creates an end-edge update at global_position, at character granularity unless given.
Sourcepub fn copy_with(
&self,
dx: Option<f64>,
is_end: Option<bool>,
direction: Option<SelectionExtendDirection>,
) -> SelectionEvent
pub fn copy_with( &self, dx: Option<f64>, is_end: Option<bool>, direction: Option<SelectionExtendDirection>, ) -> SelectionEvent
A copy with the given values replaced.