RichTextWidgetInfoExt

Trait RichTextWidgetInfoExt 

Source
pub trait RichTextWidgetInfoExt {
Show 13 methods // Required methods fn rich_text_root(&self) -> Option<WidgetInfo>; fn rich_text_component(&self) -> Option<RichTextComponent>; fn rich_text_leaves(&self) -> impl Iterator<Item = WidgetInfo> + 'static; fn rich_text_leaves_rev(&self) -> impl Iterator<Item = WidgetInfo> + 'static; fn rich_text_selection( &self, a: WidgetId, b: WidgetId, ) -> impl ExactSizeIterator<Item = WidgetInfo> + 'static; fn rich_text_selection_rev( &self, a: WidgetId, b: WidgetId, ) -> impl ExactSizeIterator<Item = WidgetInfo> + 'static; fn rich_text_prev(&self) -> impl Iterator<Item = WidgetInfo> + 'static; fn rich_text_self_and_prev( &self, ) -> impl Iterator<Item = WidgetInfo> + 'static; fn rich_text_next(&self) -> impl Iterator<Item = WidgetInfo> + 'static; fn rich_text_self_and_next( &self, ) -> impl Iterator<Item = WidgetInfo> + 'static; fn rich_text_line_info(&self) -> RichLineInfo; fn rich_text_nearest_leaf( &self, window_point: PxPoint, ) -> Option<WidgetInfo>; fn rich_text_nearest_leaf_filtered( &self, window_point: PxPoint, filter: impl FnMut(&WidgetInfo, PxRect, usize, usize) -> bool, ) -> Option<WidgetInfo>;
}
Expand description

Extends WidgetInfo state to provide information about rich text.

Required Methods§

Source

fn rich_text_root(&self) -> Option<WidgetInfo>

Gets the outer most ancestor that defines the rich text root.

Source

fn rich_text_component(&self) -> Option<RichTextComponent>

Gets what kind of component of the rich text tree this widget is.

Source

fn rich_text_leaves(&self) -> impl Iterator<Item = WidgetInfo> + 'static

Iterate over the text/leaf component descendants that can be interacted with.

Source

fn rich_text_leaves_rev(&self) -> impl Iterator<Item = WidgetInfo> + 'static

Iterate over the text/leaf component descendants that can be interacted with, in reverse.

Source

fn rich_text_selection( &self, a: WidgetId, b: WidgetId, ) -> impl ExactSizeIterator<Item = WidgetInfo> + 'static

Iterate over the selection text/leaf component descendants that can be interacted with.

The iterator is over a..=b or if a is after b the iterator is over b..=a.

Source

fn rich_text_selection_rev( &self, a: WidgetId, b: WidgetId, ) -> impl ExactSizeIterator<Item = WidgetInfo> + 'static

Iterate over the selection text/leaf component descendants that can be interacted with, in reverse.

The iterator is over b..=a or if a is after b the iterator is over a..=b.

Source

fn rich_text_prev(&self) -> impl Iterator<Item = WidgetInfo> + 'static

Iterate over the prev text/leaf components before the current one.

Source

fn rich_text_self_and_prev(&self) -> impl Iterator<Item = WidgetInfo> + 'static

Iterate over the text/leaf component and previous.

Source

fn rich_text_next(&self) -> impl Iterator<Item = WidgetInfo> + 'static

Iterate over the next text/leaf components after the current one.

Source

fn rich_text_self_and_next(&self) -> impl Iterator<Item = WidgetInfo> + 'static

Iterate over the text/leaf component and next.

Source

fn rich_text_line_info(&self) -> RichLineInfo

Gets info about how this rich leaf affects the text lines.

Source

fn rich_text_nearest_leaf(&self, window_point: PxPoint) -> Option<WidgetInfo>

Gets the leaf descendant that is nearest to the window_point.

Source

fn rich_text_nearest_leaf_filtered( &self, window_point: PxPoint, filter: impl FnMut(&WidgetInfo, PxRect, usize, usize) -> bool, ) -> Option<WidgetInfo>

Gets the leaf descendant that is nearest to the window_point and is approved by the filter.

The filter parameters are the widget, the rect, the rect row index and the widget inline rows length. If the widget is not inlined both index and len are zero.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl RichTextWidgetInfoExt for WidgetInfo

Source§

fn rich_text_root(&self) -> Option<WidgetInfo>

Source§

fn rich_text_component(&self) -> Option<RichTextComponent>

Source§

fn rich_text_leaves(&self) -> impl Iterator<Item = WidgetInfo> + 'static

Source§

fn rich_text_leaves_rev(&self) -> impl Iterator<Item = WidgetInfo> + 'static

Source§

fn rich_text_selection( &self, a: WidgetId, b: WidgetId, ) -> impl ExactSizeIterator<Item = WidgetInfo> + 'static

Source§

fn rich_text_selection_rev( &self, a: WidgetId, b: WidgetId, ) -> impl ExactSizeIterator<Item = WidgetInfo> + 'static

Source§

fn rich_text_prev(&self) -> impl Iterator<Item = WidgetInfo> + 'static

Source§

fn rich_text_next(&self) -> impl Iterator<Item = WidgetInfo> + 'static

Source§

fn rich_text_self_and_prev(&self) -> impl Iterator<Item = WidgetInfo> + 'static

Source§

fn rich_text_self_and_next(&self) -> impl Iterator<Item = WidgetInfo> + 'static

Source§

fn rich_text_line_info(&self) -> RichLineInfo

Source§

fn rich_text_nearest_leaf(&self, window_point: PxPoint) -> Option<WidgetInfo>

Source§

fn rich_text_nearest_leaf_filtered( &self, window_point: PxPoint, filter: impl FnMut(&WidgetInfo, PxRect, usize, usize) -> bool, ) -> Option<WidgetInfo>

Implementors§