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§
Sourcefn rich_text_root(&self) -> Option<WidgetInfo>
fn rich_text_root(&self) -> Option<WidgetInfo>
Gets the outer most ancestor that defines the rich text root.
Sourcefn rich_text_component(&self) -> Option<RichTextComponent>
fn rich_text_component(&self) -> Option<RichTextComponent>
Gets what kind of component of the rich text tree this widget is.
Sourcefn rich_text_leaves(&self) -> impl Iterator<Item = WidgetInfo> + 'static
fn rich_text_leaves(&self) -> impl Iterator<Item = WidgetInfo> + 'static
Iterate over the text/leaf component descendants that can be interacted with.
Sourcefn rich_text_leaves_rev(&self) -> impl Iterator<Item = WidgetInfo> + 'static
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.
Sourcefn rich_text_selection(
&self,
a: WidgetId,
b: WidgetId,
) -> impl ExactSizeIterator<Item = WidgetInfo> + 'static
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.
Sourcefn rich_text_selection_rev(
&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
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.
Sourcefn rich_text_prev(&self) -> impl Iterator<Item = WidgetInfo> + 'static
fn rich_text_prev(&self) -> impl Iterator<Item = WidgetInfo> + 'static
Iterate over the prev text/leaf components before the current one.
Sourcefn rich_text_self_and_prev(&self) -> impl Iterator<Item = WidgetInfo> + 'static
fn rich_text_self_and_prev(&self) -> impl Iterator<Item = WidgetInfo> + 'static
Iterate over the text/leaf component and previous.
Sourcefn rich_text_next(&self) -> impl Iterator<Item = WidgetInfo> + 'static
fn rich_text_next(&self) -> impl Iterator<Item = WidgetInfo> + 'static
Iterate over the next text/leaf components after the current one.
Sourcefn rich_text_self_and_next(&self) -> impl Iterator<Item = WidgetInfo> + 'static
fn rich_text_self_and_next(&self) -> impl Iterator<Item = WidgetInfo> + 'static
Iterate over the text/leaf component and next.
Sourcefn rich_text_line_info(&self) -> RichLineInfo
fn rich_text_line_info(&self) -> RichLineInfo
Gets info about how this rich leaf affects the text lines.
Sourcefn rich_text_nearest_leaf(&self, window_point: PxPoint) -> Option<WidgetInfo>
fn rich_text_nearest_leaf(&self, window_point: PxPoint) -> Option<WidgetInfo>
Gets the leaf descendant that is nearest to the window_point.
Sourcefn rich_text_nearest_leaf_filtered(
&self,
window_point: PxPoint,
filter: impl FnMut(&WidgetInfo, PxRect, usize, usize) -> bool,
) -> Option<WidgetInfo>
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.