Trait TextExt

Source
pub trait TextExt: 'static {
Show 21 methods // Required methods fn add_selection(&self, start_offset: i32, end_offset: i32) -> bool; fn get_bounded_ranges( &self, rect: &mut TextRectangle, coord_type: CoordType, x_clip_type: TextClipType, y_clip_type: TextClipType, ) -> Vec<TextRange>; fn get_caret_offset(&self) -> i32; fn get_character_at_offset(&self, offset: i32) -> char; fn get_character_count(&self) -> i32; fn get_character_extents( &self, offset: i32, coords: CoordType, ) -> (i32, i32, i32, i32); fn get_n_selections(&self) -> i32; fn get_offset_at_point(&self, x: i32, y: i32, coords: CoordType) -> i32; fn get_range_extents( &self, start_offset: i32, end_offset: i32, coord_type: CoordType, ) -> TextRectangle; fn get_selection(&self, selection_num: i32) -> (GString, i32, i32); fn get_string_at_offset( &self, offset: i32, granularity: TextGranularity, ) -> (Option<GString>, i32, i32); fn get_text(&self, start_offset: i32, end_offset: i32) -> Option<GString>; fn get_text_at_offset( &self, offset: i32, boundary_type: TextBoundary, ) -> (GString, i32, i32); fn remove_selection(&self, selection_num: i32) -> bool; fn set_caret_offset(&self, offset: i32) -> bool; fn set_selection( &self, selection_num: i32, start_offset: i32, end_offset: i32, ) -> bool; fn connect_text_attributes_changed<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId; fn connect_text_caret_moved<F: Fn(&Self, i32) + 'static>( &self, f: F, ) -> SignalHandlerId; fn connect_text_insert<F: Fn(&Self, i32, i32, &str) + 'static>( &self, f: F, ) -> SignalHandlerId; fn connect_text_remove<F: Fn(&Self, i32, i32, &str) + 'static>( &self, f: F, ) -> SignalHandlerId; fn connect_text_selection_changed<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId;
}

Required Methods§

Source

fn add_selection(&self, start_offset: i32, end_offset: i32) -> bool

Source

fn get_bounded_ranges( &self, rect: &mut TextRectangle, coord_type: CoordType, x_clip_type: TextClipType, y_clip_type: TextClipType, ) -> Vec<TextRange>

Source

fn get_caret_offset(&self) -> i32

Source

fn get_character_at_offset(&self, offset: i32) -> char

Source

fn get_character_count(&self) -> i32

Source

fn get_character_extents( &self, offset: i32, coords: CoordType, ) -> (i32, i32, i32, i32)

Source

fn get_n_selections(&self) -> i32

Source

fn get_offset_at_point(&self, x: i32, y: i32, coords: CoordType) -> i32

Source

fn get_range_extents( &self, start_offset: i32, end_offset: i32, coord_type: CoordType, ) -> TextRectangle

Source

fn get_selection(&self, selection_num: i32) -> (GString, i32, i32)

Source

fn get_string_at_offset( &self, offset: i32, granularity: TextGranularity, ) -> (Option<GString>, i32, i32)

Source

fn get_text(&self, start_offset: i32, end_offset: i32) -> Option<GString>

Source

fn get_text_at_offset( &self, offset: i32, boundary_type: TextBoundary, ) -> (GString, i32, i32)

Source

fn remove_selection(&self, selection_num: i32) -> bool

Source

fn set_caret_offset(&self, offset: i32) -> bool

Source

fn set_selection( &self, selection_num: i32, start_offset: i32, end_offset: i32, ) -> bool

Source

fn connect_text_attributes_changed<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_text_caret_moved<F: Fn(&Self, i32) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_text_insert<F: Fn(&Self, i32, i32, &str) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_text_remove<F: Fn(&Self, i32, i32, &str) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_text_selection_changed<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

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.

Implementors§

Source§

impl<O: IsA<Text>> TextExt for O