Skip to main content

PlatformInputHandlerDelegate

Trait PlatformInputHandlerDelegate 

Source
pub trait PlatformInputHandlerDelegate: Any {
Show 17 methods // Required methods fn selected_text_range( &mut self, ignore_disabled_input: bool, ) -> Option<UTF16Selection>; fn marked_text_range(&mut self) -> Option<Range<usize>>; fn text_for_range( &mut self, range_utf16: Range<usize>, adjusted: &mut Option<Range<usize>>, ) -> Option<String>; fn replace_text_in_range( &mut self, replacement_range: Option<Range<usize>>, text: &str, ); fn replace_and_mark_text_in_range( &mut self, range_utf16: Option<Range<usize>>, new_text: &str, new_selected_range: Option<Range<usize>>, ); fn unmark_text(&mut self); fn paste(&mut self, item: ClipboardItem); fn bounds_for_range( &mut self, range_utf16: Range<usize>, ) -> Option<Bounds<Pixels>>; fn apple_press_and_hold_enabled(&mut self) -> bool; fn character_index_for_point( &mut self, point: Point<Pixels>, ) -> Option<usize>; fn set_selected_text_range(&mut self, range_utf16: Range<usize>); fn element_bounds(&mut self) -> Option<Bounds<Pixels>>; fn text_length_utf16(&mut self) -> Option<usize>; fn query_accepts_text_input(&mut self) -> bool; fn query_prefers_ime_for_printable_keys(&mut self) -> bool; fn text_input_editable_range(&mut self) -> Option<Range<usize>>; fn as_any_mut(&mut self) -> &mut (dyn Any + 'static);
}
Expand description

The gpui-side implementation backing a PlatformInputHandler.

Platform backends only ever call the methods on PlatformInputHandler; gpui provides the implementation, which is where the Window/App dependencies live.

Required Methods§

Source

fn selected_text_range( &mut self, ignore_disabled_input: bool, ) -> Option<UTF16Selection>

Source

fn marked_text_range(&mut self) -> Option<Range<usize>>

Source

fn text_for_range( &mut self, range_utf16: Range<usize>, adjusted: &mut Option<Range<usize>>, ) -> Option<String>

Source

fn replace_text_in_range( &mut self, replacement_range: Option<Range<usize>>, text: &str, )

Source

fn replace_and_mark_text_in_range( &mut self, range_utf16: Option<Range<usize>>, new_text: &str, new_selected_range: Option<Range<usize>>, )

Source

fn unmark_text(&mut self)

Source

fn paste(&mut self, item: ClipboardItem)

Source

fn bounds_for_range( &mut self, range_utf16: Range<usize>, ) -> Option<Bounds<Pixels>>

Source

fn apple_press_and_hold_enabled(&mut self) -> bool

Source

fn character_index_for_point(&mut self, point: Point<Pixels>) -> Option<usize>

Source

fn set_selected_text_range(&mut self, range_utf16: Range<usize>)

Source

fn element_bounds(&mut self) -> Option<Bounds<Pixels>>

Source

fn text_length_utf16(&mut self) -> Option<usize>

Source

fn query_accepts_text_input(&mut self) -> bool

Source

fn query_prefers_ime_for_printable_keys(&mut self) -> bool

Source

fn text_input_editable_range(&mut self) -> Option<Range<usize>>

Source

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Allows gpui to recover its concrete delegate for the methods that require a Window or App.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§