FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    TextPresenter

    struct · ferroui-controls · v0.5.0

    struct TextPresenter
    

    The control that displays the text of a text box: the text, the selection, the pre-edit text of an input method and the caret.

    Every text position (CaretIndex, SelectionStart, SelectionEnd, the positions of CharacterHit) is a UTF-16 code unit index.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<TextPresenter>
    

    Returns a strong reference to this object.

    Source

    create_text_layout

    fn create_text_layout(self: &Self) -> Rc<TextLayout>
    

    Creates the TextLayout used to render the text.

    Source

    invalidate_text_layout

    fn invalidate_text_layout(self: &Self)
    

    Drops the text layout and the shaped runs it was built from.

    Source

    text_paragraph_styles_property

    fn text_paragraph_styles_property() -> &'static StyledProperty<Option<TextParagraphStyles>>
    

    Defines the TextParagraphStyles property.

    Source

    text_style_overrides_property

    fn text_style_overrides_property() -> &'static StyledProperty<Option<TextStyleOverrides>>
    

    Defines the TextStyleOverrides property.

    Source

    show_selection_highlight_property

    fn show_selection_highlight_property() -> &'static StyledProperty<bool>
    

    Defines the ShowSelectionHighlight property.

    Source

    caret_index_property

    fn caret_index_property() -> &'static StyledProperty<i32>
    

    Defines the CaretIndex property.

    Source

    reveal_password_property

    fn reveal_password_property() -> &'static StyledProperty<bool>
    

    Defines the RevealPassword property.

    Source

    password_char_property

    fn password_char_property() -> &'static StyledProperty<char>
    

    Defines the PasswordChar property.

    Source

    selection_brush_property

    fn selection_brush_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
    

    Defines the SelectionBrush property.

    Source

    selection_foreground_brush_property

    fn selection_foreground_brush_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
    

    Defines the SelectionForegroundBrush property.

    Source

    caret_brush_property

    fn caret_brush_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
    

    Defines the CaretBrush property.

    Source

    fn caret_blink_interval_property() -> &'static StyledProperty<Duration>
    

    Defines the CaretBlinkInterval property.

    Source

    selection_start_property

    fn selection_start_property() -> &'static StyledProperty<i32>
    

    Defines the SelectionStart property.

    Source

    selection_end_property

    fn selection_end_property() -> &'static StyledProperty<i32>
    

    Defines the SelectionEnd property.

    Source

    text_property

    fn text_property() -> &'static StyledProperty<Option<String>>
    

    Defines the Text property.

    Source

    preedit_text_property

    fn preedit_text_property() -> &'static StyledProperty<Option<String>>
    

    Defines the PreeditText property.

    Source

    preedit_text_cursor_position_property

    fn preedit_text_cursor_position_property() -> &'static StyledProperty<Option<i32>>
    

    Defines the PreeditTextCursorPosition property.

    Source

    text_alignment_property

    fn text_alignment_property() -> &'static AttachedProperty<TextAlignment>
    

    Defines the TextAlignment property.

    Source

    text_wrapping_property

    fn text_wrapping_property() -> &'static AttachedProperty<TextWrapping>
    

    Defines the TextWrapping property.

    Source

    line_height_property

    fn line_height_property() -> &'static AttachedProperty<f64>
    

    Defines the LineHeight property.

    Source

    letter_spacing_property

    fn letter_spacing_property() -> &'static AttachedProperty<f64>
    

    Defines the LetterSpacing property.

    Source

    background_property

    fn background_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
    

    Defines the Background property.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see ferroui_base::FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Initializes a new instance of the TextPresenter class.

    Source

    caret_bounds_changed

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

    Occurs when the bounds of the caret change.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the presenter.

    Source

    background

    fn background(self: &Self) -> Option<Rc<dyn IBrush>>
    

    A brush used to paint the control's background.

    Source

    set_background

    fn set_background(self: &Self, value: Option<Rc<dyn IBrush>>)
    

    Source

    show_selection_highlight

    fn show_selection_highlight(self: &Self) -> bool
    

    Whether the presenter shows a selection highlight.

    Source

    set_show_selection_highlight

    fn set_show_selection_highlight(self: &Self, value: bool)
    

    Source

    text

    fn text(self: &Self) -> Option<String>
    

    The text.

    Source

    set_text

    fn set_text(self: &Self, value: Option<&str>)
    

    Source

    preedit_text

    fn preedit_text(self: &Self) -> Option<String>
    

    The text an input method is composing, displayed at the caret.

    Source

    set_preedit_text

    fn set_preedit_text(self: &Self, value: Option<&str>)
    

    Source

    preedit_text_cursor_position

    fn preedit_text_cursor_position(self: &Self) -> Option<i32>
    

    The position of the cursor within the pre-edit text.

    Source

    set_preedit_text_cursor_position

    fn set_preedit_text_cursor_position(self: &Self, value: Option<i32>)
    

    Source

    text_style_overrides

    fn text_style_overrides(self: &Self) -> Option<TextStyleOverrides>
    

    Complete run properties at UTF-16 ranges of committed Text.

    Source

    text_paragraph_styles

    fn text_paragraph_styles(self: &Self) -> Option<TextParagraphStyles>
    

    Source

    set_text_paragraph_styles

    fn set_text_paragraph_styles(self: &Self, value: Option<TextParagraphStyles>)
    

    Source

    set_text_style_overrides

    fn set_text_style_overrides(self: &Self, value: Option<TextStyleOverrides>)
    

    Selection colors and IME decorations preserve these properties. The collection is immutable; assign a new one after editing the text.

    Source

    font_family

    fn font_family(self: &Self) -> FontFamily
    

    The font family.

    Source

    set_font_family

    fn set_font_family(self: &Self, value: FontFamily)
    

    Source

    font_features

    fn font_features(self: &Self) -> Option<FontFeatureCollection>
    

    The font features.

    Source

    set_font_features

    fn set_font_features(self: &Self, value: Option<FontFeatureCollection>)
    

    Source

    font_size

    fn font_size(self: &Self) -> f64
    

    The font size.

    Source

    set_font_size

    fn set_font_size(self: &Self, value: f64)
    

    Source

    font_style

    fn font_style(self: &Self) -> FontStyle
    

    The font style.

    Source

    set_font_style

    fn set_font_style(self: &Self, value: FontStyle)
    

    Source

    font_weight

    fn font_weight(self: &Self) -> FontWeight
    

    The font weight.

    Source

    set_font_weight

    fn set_font_weight(self: &Self, value: FontWeight)
    

    Source

    font_stretch

    fn font_stretch(self: &Self) -> FontStretch
    

    The font stretch.

    Source

    set_font_stretch

    fn set_font_stretch(self: &Self, value: FontStretch)
    

    Source

    foreground

    fn foreground(self: &Self) -> Option<Rc<dyn IBrush>>
    

    A brush used to paint the text.

    Source

    set_foreground

    fn set_foreground(self: &Self, value: Option<Rc<dyn IBrush>>)
    

    Source

    text_wrapping

    fn text_wrapping(self: &Self) -> TextWrapping
    

    The control's text wrapping mode.

    Source

    set_text_wrapping

    fn set_text_wrapping(self: &Self, value: TextWrapping)
    

    Source

    line_height

    fn line_height(self: &Self) -> f64
    

    The line height. By default, this is set to NaN, which determines the appropriate height automatically.

    Source

    set_line_height

    fn set_line_height(self: &Self, value: f64)
    

    Source

    letter_spacing

    fn letter_spacing(self: &Self) -> f64
    

    The letter spacing.

    Source

    set_letter_spacing

    fn set_letter_spacing(self: &Self, value: f64)
    

    Source

    text_alignment

    fn text_alignment(self: &Self) -> TextAlignment
    

    The text alignment.

    Source

    set_text_alignment

    fn set_text_alignment(self: &Self, value: TextAlignment)
    

    Source

    text_layout

    fn text_layout(self: &Self) -> Rc<TextLayout>
    

    The TextLayout used to render the text.

    Source

    caret_index

    fn caret_index(self: &Self) -> i32
    

    Source

    set_caret_index

    fn set_caret_index(self: &Self, value: i32)
    

    Source

    cursor_rectangle

    fn cursor_rectangle(self: &Self) -> Rect
    

    The caret rectangle relative to this presenter.

    The rectangle has zero width. Its X/Y position and height describe the caret location within the presenter's text layout coordinates.

    Source

    password_char

    fn password_char(self: &Self) -> char
    

    The character displayed in place of every character of the text ('\0': none).

    Source

    set_password_char

    fn set_password_char(self: &Self, value: char)
    

    Source

    reveal_password

    fn reveal_password(self: &Self) -> bool
    

    Source

    set_reveal_password

    fn set_reveal_password(self: &Self, value: bool)
    

    Source

    selection_brush

    fn selection_brush(self: &Self) -> Option<Rc<dyn IBrush>>
    

    Source

    set_selection_brush

    fn set_selection_brush(self: &Self, value: Option<Rc<dyn IBrush>>)
    

    Source

    selection_foreground_brush

    fn selection_foreground_brush(self: &Self) -> Option<Rc<dyn IBrush>>
    

    Source

    set_selection_foreground_brush

    fn set_selection_foreground_brush(self: &Self, value: Option<Rc<dyn IBrush>>)
    

    Source

    caret_brush

    fn caret_brush(self: &Self) -> Option<Rc<dyn IBrush>>
    

    Source

    set_caret_brush

    fn set_caret_brush(self: &Self, value: Option<Rc<dyn IBrush>>)
    

    Source

    fn caret_blink_interval(self: &Self) -> Duration
    

    The caret blink rate.

    Source

    fn set_caret_blink_interval(self: &Self, value: Duration)
    

    Source

    selection_start

    fn selection_start(self: &Self) -> i32
    

    Source

    set_selection_start

    fn set_selection_start(self: &Self, value: i32)
    

    Source

    selection_end

    fn selection_end(self: &Self) -> i32
    

    Source

    set_selection_end

    fn set_selection_end(self: &Self, value: i32)
    

    Source

    current_im_client

    fn current_im_client(self: &Self) -> Option<Rc<TextBoxTextInputMethodClient>>
    

    The input method client that currently edits the text of the presenter. The client refers to the presenter, so the presenter refers to it weakly.

    Source

    set_current_im_client

    fn set_current_im_client(self: &Self, value: Option<Rc<TextBoxTextInputMethodClient>>)
    

    Source

    show_caret

    fn show_caret(self: &Self)
    

    Source

    hide_caret

    fn hide_caret(self: &Self)
    

    Source

    move_caret_to_text_position

    fn move_caret_to_text_position(self: &Self, text_position: i32, trailing_edge: bool)
    

    Source

    move_caret_to_point

    fn move_caret_to_point(self: &Self, point: Point)
    

    Source

    move_caret_vertical

    fn move_caret_vertical(self: &Self, direction: LogicalDirection)
    

    Source

    get_next_character_hit

    fn get_next_character_hit(self: &Self, direction: LogicalDirection) -> CharacterHit
    

    Source

    move_caret_horizontal

    fn move_caret_horizontal(self: &Self, direction: LogicalDirection)
    

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.