Skip to main content

TextNode

Struct TextNode 

Source
pub struct TextNode { /* private fields */ }

Implementations§

Source§

impl TextNode

Source

pub fn new(content: impl Into<String>) -> Self

Source

pub fn key(&self, _key: u64) -> &Self

Source

pub fn width(&self, width: f32, unit: Unit) -> &Self

Source

pub fn height(&self, height: f32, unit: Unit) -> &Self

Source

pub fn fill_width(&self) -> &Self

Source

pub fn fill_height(&self) -> &Self

Source

pub fn fill_size(&self) -> &Self

Source

pub fn fill_width_percent(&self, percent: f32) -> &Self

Source

pub fn fill_height_percent(&self, percent: f32) -> &Self

Source

pub fn min_width(&self, value: f32, unit: Unit) -> &Self

Source

pub fn max_width(&self, value: f32, unit: Unit) -> &Self

Source

pub fn min_height(&self, value: f32, unit: Unit) -> &Self

Source

pub fn max_height(&self, value: f32, unit: Unit) -> &Self

Source

pub fn text(&self, content: impl Into<String>) -> &Self

Source

pub fn text_color(&self, color: u32) -> &Self

Source

pub fn style_runs(&self, words: Vec<u32>) -> &Self

Source

pub fn font_stack(&self, stack: FontStack, size: f32) -> &Self

Source

pub fn font_family(&self, family: FontFamily) -> &Self

Source

pub fn font_weight(&self, weight: FontWeight) -> &Self

Source

pub fn font_style(&self, style: FontStyle) -> &Self

Source

pub fn font_size(&self, size: f32) -> &Self

Source

pub fn line_height(&self, line_height: f32) -> &Self

Source

pub fn text_align(&self, align: TextAlign) -> &Self

Source

pub fn text_vertical_align(&self, align: TextVerticalAlign) -> &Self

Source

pub fn text_limits(&self, max_chars: i32, max_lines: i32) -> &Self

Source

pub fn max_lines(&self, max_lines: i32) -> &Self

Source

pub fn wrapping(&self, wrap: bool) -> &Self

Source

pub fn text_overflow(&self, overflow: TextOverflow) -> &Self

Source

pub fn text_overflow_fade(&self, horizontal: bool, vertical: bool) -> &Self

Source

pub fn selectable(&self, selectable: bool) -> &Self

Source

pub fn selection_color(&self, color: u32) -> &Self

Source

pub fn editable(&self, editable: bool) -> &Self

Source

pub fn obscured(&self, obscured: bool) -> &Self

Source

pub fn caret_color(&self, color: u32) -> &Self

Source

pub fn selection_range(&self, start: u32, end: u32) -> &Self

Source

pub fn focus_now(&self) -> &Self

Source

pub fn interactive(&self, interactive: bool) -> &Self

Source

pub fn cursor(&self, style: CursorStyle) -> &Self

Source

pub fn focusable(&self, enabled: bool, tab_index: i32) -> &Self

Source

pub fn on_pointer_click( &self, handler: impl Fn(&mut PointerEventArgs) + 'static, ) -> &Self

Source

pub fn on_pointer_down( &self, handler: impl Fn(&mut PointerEventArgs) + 'static, ) -> &Self

Source

pub fn on_pointer_up( &self, handler: impl Fn(&mut PointerEventArgs) + 'static, ) -> &Self

Source

pub fn on_focus_changed( &self, handler: impl Fn(FocusChangedEventArgs) + 'static, ) -> &Self

Source

pub fn on_text_changed( &self, handler: impl Fn(TextChangedEventArgs) + 'static, ) -> &Self

Source

pub fn on_selection_changed( &self, handler: impl Fn(SelectionChangedEventArgs) + 'static, ) -> &Self

Source

pub fn content(&self) -> String

Source

pub fn uses_default_selection_behavior(&self) -> bool

Source

pub fn is_editable_text(&self) -> bool

Source

pub fn is_selectable_text(&self) -> bool

Source

pub fn selection_start(&self) -> u32

Source

pub fn selection_end(&self) -> u32

Source

pub fn on_pan_gesture( &self, handler: impl Fn(&mut GestureEventArgs) + 'static, ) -> &Self

Source

pub fn on_pinch_gesture( &self, handler: impl Fn(&mut GestureEventArgs) + 'static, ) -> &Self

Source

pub fn long_press_options( &self, minimum_duration_ms: i32, movement_tolerance: f32, ) -> &Self

Source

pub fn on_long_press( &self, handler: impl Fn(&mut LongPressEventArgs) + 'static, ) -> &Self

Trait Implementations§

Source§

impl Clone for TextNode

Source§

fn clone(&self) -> TextNode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl HasTextNode for TextNode

Source§

impl Node for TextNode

Source§

fn node_id(&self, node_id: impl Into<String>) -> &Self
where Self: Sized,

Source§

fn semantic_role(&self, role: SemanticRole) -> &Self
where Self: Sized,

Source§

fn semantic_label(&self, label: impl Into<String>) -> &Self
where Self: Sized,

Source§

fn semantic_checked(&self, state: SemanticCheckedState) -> &Self
where Self: Sized,

Source§

fn semantic_disabled(&self, disabled: bool) -> &Self
where Self: Sized,

Source§

fn clear_semantic_disabled(&self) -> &Self
where Self: Sized,

Source§

fn semantic_selected(&self, selected: bool) -> &Self
where Self: Sized,

Source§

fn clear_semantic_selected(&self) -> &Self
where Self: Sized,

Source§

fn semantic_expanded(&self, expanded: bool) -> &Self
where Self: Sized,

Source§

fn clear_semantic_expanded(&self) -> &Self
where Self: Sized,

Source§

fn semantic_value_range( &self, value_now: f32, value_min: f32, value_max: f32, ) -> &Self
where Self: Sized,

Source§

fn clear_semantic_value_range(&self) -> &Self
where Self: Sized,

Source§

fn semantic_orientation(&self, orientation: Orientation) -> &Self
where Self: Sized,

Source§

fn request_semantic_announcement(&self) -> &Self
where Self: Sized,

Source§

fn child_count(&self) -> usize

Source§

fn is_enabled(&self) -> bool

Source§

fn is_visible(&self) -> bool

Source§

fn cursor_style(&self) -> CursorStyle

Source§

fn persist_state(&self, adapter: Rc<dyn PersistedStateAdapter>) -> &Self
where Self: Sized,

Source§

fn handle(&self) -> NodeHandle

Source§

fn has_built_handle(&self) -> bool

Source§

fn on_context_menu( &self, handler: impl Fn(ContextMenuEventArgs) + 'static, ) -> &Self
where Self: Sized,

Source§

fn clear_context_menu(&self) -> &Self
where Self: Sized,

Source§

fn disable_context_menu(&self, flag: bool) -> &Self
where Self: Sized,

Source§

fn on_pointer_click( &self, handler: impl Fn(&mut PointerEventArgs) + 'static, ) -> &Self
where Self: Sized,

Handles the low-level routed pointer-click event. Read more
Source§

fn on_pointer_double_click( &self, handler: impl Fn(&mut PointerEventArgs) + 'static, ) -> &Self
where Self: Sized,

Handles a low-level routed pointer double-click after the ordinary pointer-click callback.
Source§

fn on_pointer_triple_click( &self, handler: impl Fn(&mut PointerEventArgs) + 'static, ) -> &Self
where Self: Sized,

Handles a low-level routed pointer triple-click after the ordinary pointer-click callback.
Source§

fn on_pointer_down( &self, handler: impl Fn(&mut PointerEventArgs) + 'static, ) -> &Self
where Self: Sized,

Source§

fn on_pointer_move( &self, handler: impl Fn(&mut PointerEventArgs) + 'static, ) -> &Self
where Self: Sized,

Source§

fn on_pointer_up( &self, handler: impl Fn(&mut PointerEventArgs) + 'static, ) -> &Self
where Self: Sized,

Source§

fn on_pointer_enter( &self, handler: impl Fn(&mut PointerEventArgs) + 'static, ) -> &Self
where Self: Sized,

Source§

fn on_pointer_leave( &self, handler: impl Fn(&mut PointerEventArgs) + 'static, ) -> &Self
where Self: Sized,

Source§

fn on_pointer_cancel( &self, handler: impl Fn(&mut PointerEventArgs) + 'static, ) -> &Self
where Self: Sized,

Source§

fn on_wheel(&self, handler: impl Fn(&mut WheelEventArgs) + 'static) -> &Self
where Self: Sized,

Source§

fn on_pan_gesture( &self, handler: impl Fn(&mut GestureEventArgs) + 'static, ) -> &Self
where Self: Sized,

Source§

fn on_pinch_gesture( &self, handler: impl Fn(&mut GestureEventArgs) + 'static, ) -> &Self
where Self: Sized,

Source§

fn long_press_options( &self, minimum_duration_ms: i32, movement_tolerance: f32, ) -> &Self
where Self: Sized,

Source§

fn on_long_press( &self, handler: impl Fn(&mut LongPressEventArgs) + 'static, ) -> &Self
where Self: Sized,

Source§

fn focusable(&self, enabled: bool, tab_index: i32) -> &Self
where Self: Sized,

Source§

fn focus_now(&self) -> &Self
where Self: Sized,

Source§

fn enabled(&self, enabled: bool) -> &Self
where Self: Sized,

Source§

fn visibility(&self, visibility: Visibility) -> &Self
where Self: Sized,

Source§

fn cursor(&self, style: CursorStyle) -> &Self
where Self: Sized,

Source§

fn clear_cursor(&self) -> &Self
where Self: Sized,

Source§

fn on_key_down(&self, handler: impl Fn(&mut KeyEventArgs) + 'static) -> &Self
where Self: Sized,

Source§

fn on_key_up(&self, handler: impl Fn(&mut KeyEventArgs) + 'static) -> &Self
where Self: Sized,

Source§

fn on_focus_changed( &self, handler: impl Fn(FocusChangedEventArgs) + 'static, ) -> &Self
where Self: Sized,

Source§

fn drag_allowed_effects(&self, effects: DragDropEffects) -> &Self
where Self: Sized,

Source§

fn drag_data( &self, handler: impl Fn() -> Option<DragDataObject> + 'static, ) -> &Self
where Self: Sized,

Source§

fn clear_drag_data(&self) -> &Self
where Self: Sized,

Source§

fn allow_drop(&self, flag: bool) -> &Self
where Self: Sized,

Source§

fn on_drag_completed( &self, handler: impl Fn(DragCompletedEventArgs) + 'static, ) -> &Self
where Self: Sized,

Source§

fn on_drag_enter( &self, handler: impl Fn(DragEventArgs) -> DropProposal + 'static, ) -> &Self
where Self: Sized,

Source§

fn on_drag_over( &self, handler: impl Fn(DragEventArgs) -> DropProposal + 'static, ) -> &Self
where Self: Sized,

Source§

fn on_drag_leave(&self, handler: impl Fn(DragEventArgs) + 'static) -> &Self
where Self: Sized,

Source§

fn on_drop(&self, handler: impl Fn(DragEventArgs) + 'static) -> &Self
where Self: Sized,

Source§

fn allow_external_drop(&self, flag: bool) -> &Self
where Self: Sized,

Source§

fn on_external_drag_enter( &self, handler: impl Fn(ExternalDropEventArgs) -> DropProposal + 'static, ) -> &Self
where Self: Sized,

Source§

fn on_external_drag_over( &self, handler: impl Fn(ExternalDropEventArgs) -> DropProposal + 'static, ) -> &Self
where Self: Sized,

Source§

fn on_external_drag_leave( &self, handler: impl Fn(ExternalDropEventArgs) + 'static, ) -> &Self
where Self: Sized,

Source§

fn on_external_drop( &self, handler: impl Fn(ExternalDropEventArgs) + 'static, ) -> &Self
where Self: Sized,

Source§

fn get_bounds(&self) -> [f32; 4]

Source§

fn absolute_to_local_position( &self, absolute_x: f32, absolute_y: f32, ) -> [f32; 2]

Source§

fn local_to_absolute_position(&self, local_x: f32, local_y: f32) -> [f32; 2]

Source§

fn ensure_handle(&self)

Source§

fn build(&self)

Source§

fn dispose(&self)

Source§

fn build_children(&self)

Source§

fn append_child<T: Node>(&self, child: &T)

Source§

fn remove_child<T: Node>(&self, child: &T) -> bool

Source§

fn parent_handle(&self) -> Option<NodeHandle>

Source§

fn notify_retained_layout_mutation(&self)

Source§

fn notify_retained_mutation(&self)

Source§

fn notify_retained_child_layout_changed(&self)

Source§

fn preserve_selection_on_pointer_down(&self, preserve: bool) -> &Self
where Self: Sized,

Source§

fn tool_tip(&self, tool_tip: ToolTip) -> &Self
where Self: Sized,

Source§

fn tool_tip_text(&self, text: impl Into<String>) -> &Self
where Self: Sized,

Source§

fn clear_tool_tip(&self) -> &Self
where Self: Sized,

Source§

impl ThemeBindable for TextNode

Source§

fn bind_theme(&self, handler: impl Fn(&Self, Theme) + 'static) -> &Self

Auto Trait Implementations§

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Configure for T

Source§

fn configure(self, configure: impl FnOnce(&Self)) -> Self

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> TextContentSurface for T
where T: HasTextNode,

Source§

fn text(&self, content: impl Into<String>) -> &Self

Source§

fn content(&self) -> String

Source§

impl<T> TextEditingSurface for T
where T: HasTextNode,

Source§

fn is_editable_text(&self) -> bool

Source§

fn editable(&self, editable: bool) -> &Self

Source§

fn obscured(&self, obscured: bool) -> &Self

Source§

impl<T> TextEventSurface for T
where T: HasTextNode,

Source§

fn on_text_changed( &self, handler: impl Fn(TextChangedEventArgs) + 'static, ) -> &Self

Source§

fn on_selection_changed( &self, handler: impl Fn(SelectionChangedEventArgs) + 'static, ) -> &Self

Source§

impl<T> TextLayoutSurface for T
where T: HasTextNode,

Source§

fn width(&self, width: f32, unit: Unit) -> &Self

Source§

fn height(&self, height: f32, unit: Unit) -> &Self

Source§

fn width_len(&self, length: Length) -> &Self

Source§

fn height_len(&self, length: Length) -> &Self

Source§

fn fill_width(&self) -> &Self

Source§

fn fill_height(&self) -> &Self

Source§

fn fill_size(&self) -> &Self

Source§

fn fill_width_percent(&self, percent: f32) -> &Self

Source§

fn fill_height_percent(&self, percent: f32) -> &Self

Source§

fn min_width(&self, value: f32, unit: Unit) -> &Self

Source§

fn max_width(&self, value: f32, unit: Unit) -> &Self

Source§

fn min_height(&self, value: f32, unit: Unit) -> &Self

Source§

fn max_height(&self, value: f32, unit: Unit) -> &Self

Source§

fn text_align(&self, align: TextAlign) -> &Self

Source§

fn text_vertical_align(&self, align: TextVerticalAlign) -> &Self

Source§

fn text_limits(&self, max_chars: i32, max_lines: i32) -> &Self

Source§

fn max_lines(&self, max_lines: i32) -> &Self

Source§

fn wrapping(&self, wrap: bool) -> &Self

Source§

fn text_overflow(&self, overflow: TextOverflow) -> &Self

Source§

fn text_overflow_fade(&self, horizontal: bool, vertical: bool) -> &Self

Source§

impl<T> TextSelectionSurface for T
where T: HasTextNode,

Source§

fn uses_default_selection_behavior(&self) -> bool

Source§

fn is_selectable_text(&self) -> bool

Source§

fn selection_start(&self) -> u32

Source§

fn selection_end(&self) -> u32

Source§

fn selectable(&self, selectable: bool) -> &Self

Source§

fn selection_color(&self, color: u32) -> &Self

Source§

fn selection_range(&self, start: u32, end: u32) -> &Self

Source§

fn caret_color(&self, color: u32) -> &Self

Source§

impl<T> TextSurface for T

Source§

impl<T> TextTypographySurface for T
where T: HasTextNode,

Source§

fn font_stack(&self, stack: FontStack, size: f32) -> &Self

Source§

fn font_family(&self, family: FontFamily) -> &Self

Source§

fn font_weight(&self, weight: FontWeight) -> &Self

Source§

fn font_style(&self, style: FontStyle) -> &Self

Source§

fn font_size(&self, size: f32) -> &Self

Source§

fn line_height(&self, line_height: f32) -> &Self

Source§

fn text_color(&self, color: u32) -> &Self

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.