pub struct PlatformInputHandler { /* private fields */ }Expand description
Handles text input from the platform’s IME system on behalf of a window.
This is the vocabulary platform backends speak; the behavior is supplied by
a PlatformInputHandlerDelegate.
Implementations§
Source§impl PlatformInputHandler
impl PlatformInputHandler
Sourcepub fn from_delegate(delegate: Box<dyn PlatformInputHandlerDelegate>) -> Self
pub fn from_delegate(delegate: Box<dyn PlatformInputHandlerDelegate>) -> Self
Creates a handler from the delegate that implements it.
Sourcepub fn delegate_as_any_mut(&mut self) -> &mut dyn Any
pub fn delegate_as_any_mut(&mut self) -> &mut dyn Any
Exposes the delegate as Any so gpui can downcast to its own
implementation for the Window/App methods.
pub fn selected_text_range( &mut self, ignore_disabled_input: bool, ) -> Option<UTF16Selection>
pub fn marked_text_range(&mut self) -> Option<Range<usize>>
pub fn text_for_range( &mut self, range_utf16: Range<usize>, adjusted: &mut Option<Range<usize>>, ) -> Option<String>
pub fn replace_text_in_range( &mut self, replacement_range: Option<Range<usize>>, text: &str, )
pub fn replace_and_mark_text_in_range( &mut self, range_utf16: Option<Range<usize>>, new_text: &str, new_selected_range: Option<Range<usize>>, )
pub fn unmark_text(&mut self)
pub fn paste(&mut self, item: ClipboardItem)
pub fn bounds_for_range( &mut self, range_utf16: Range<usize>, ) -> Option<Bounds<Pixels>>
pub fn apple_press_and_hold_enabled(&mut self) -> bool
pub fn character_index_for_point( &mut self, point: Point<Pixels>, ) -> Option<usize>
pub fn set_selected_text_range(&mut self, range_utf16: Range<usize>)
pub fn element_bounds(&mut self) -> Option<Bounds<Pixels>>
pub fn text_length_utf16(&mut self) -> Option<usize>
pub fn query_accepts_text_input(&mut self) -> bool
pub fn query_prefers_ime_for_printable_keys(&mut self) -> bool
pub fn text_input_editable_range(&mut self) -> Option<Range<usize>>
pub fn compute_ime_candidate_bounds( marked_range: Option<Range<usize>>, selection: &UTF16Selection, bounds_for_range: impl FnMut(Range<usize>) -> Option<Bounds<Pixels>>, ) -> Option<Bounds<Pixels>>
pub fn ime_candidate_bounds(&mut self) -> Option<Bounds<Pixels>>
Auto Trait Implementations§
impl !RefUnwindSafe for PlatformInputHandler
impl !Send for PlatformInputHandler
impl !Sync for PlatformInputHandler
impl !UnwindSafe for PlatformInputHandler
impl Freeze for PlatformInputHandler
impl Unpin for PlatformInputHandler
impl UnsafeUnpin for PlatformInputHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more