Skip to main content

TextEditorSurface

Trait TextEditorSurface 

Source
pub trait TextEditorSurface: Sized {
Show 23 methods // Required methods fn text(&self, value: impl Into<String>) -> &Self; fn value(&self) -> String; fn selection_start(&self) -> u32; fn selection_end(&self) -> u32; fn selection_start_byte_offset(&self) -> u32; fn selection_end_byte_offset(&self) -> u32; fn placeholder(&self, value: impl Into<String>) -> &Self; fn max_chars(&self, limit: i32) -> &Self; fn read_only(&self, flag: bool) -> &Self; fn accepts_tab(&self, flag: bool) -> &Self; fn selection_range(&self, start: u32, end: u32) -> &Self; fn caret(&self, position: u32) -> &Self; fn caret_to_end(&self) -> &Self; fn colors(&self, colors: TextInputColors) -> &Self; fn clear_colors(&self) -> &Self; fn template(&self, template: Rc<dyn TextInputTemplate>) -> &Self; fn clear_template(&self) -> &Self; fn line_height(&self, value: f32) -> &Self; fn font_family(&self, family: FontFamily) -> &Self; fn font_size(&self, size: f32) -> &Self; fn on_changed( &self, handler: impl Fn(TextChangedEventArgs) + 'static, ) -> &Self; fn on_text_changed( &self, handler: impl Fn(TextChangedEventArgs) + 'static, ) -> &Self; fn on_selection_changed( &self, handler: impl Fn(SelectionChangedEventArgs) + 'static, ) -> &Self;
}
Expand description

Shared editable-text behavior implemented by TextInput and TextArea.

Selection and caret positions use Unicode scalar-value indices. The explicitly named byte-offset getters expose the corresponding UTF-8 runtime offsets for diagnostics and low-level interop only.

Required Methods§

Source

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

Source

fn value(&self) -> String

Source

fn selection_start(&self) -> u32

Source

fn selection_end(&self) -> u32

Source

fn selection_start_byte_offset(&self) -> u32

Source

fn selection_end_byte_offset(&self) -> u32

Source

fn placeholder(&self, value: impl Into<String>) -> &Self

Source

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

Source

fn read_only(&self, flag: bool) -> &Self

Source

fn accepts_tab(&self, flag: bool) -> &Self

Source

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

Source

fn caret(&self, position: u32) -> &Self

Source

fn caret_to_end(&self) -> &Self

Source

fn colors(&self, colors: TextInputColors) -> &Self

Source

fn clear_colors(&self) -> &Self

Source

fn template(&self, template: Rc<dyn TextInputTemplate>) -> &Self

Source

fn clear_template(&self) -> &Self

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§