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>,
) -> PlatformInputHandler
pub fn from_delegate( delegate: Box<dyn PlatformInputHandlerDelegate>, ) -> PlatformInputHandler
Creates a handler from the delegate that implements it.
Sourcepub fn delegate_as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn delegate_as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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>>
Trait Implementations§
Source§impl PlatformInputHandlerExt for PlatformInputHandler
impl PlatformInputHandlerExt for PlatformInputHandler
Source§fn dispatch_input(&mut self, input: &str, window: &mut Window<'_>, cx: &mut App)
fn dispatch_input(&mut self, input: &str, window: &mut Window<'_>, cx: &mut App)
Applies text input directly to the focused input, bypassing the IME.
Source§fn selected_bounds(
&mut self,
window: &mut Window<'_>,
cx: &mut App,
) -> Option<Bounds<Pixels>>
fn selected_bounds( &mut self, window: &mut Window<'_>, cx: &mut App, ) -> Option<Bounds<Pixels>>
Bounds of the current IME candidate region.
Source§fn accepts_text_input(&mut self, window: &mut Window<'_>, cx: &mut App) -> bool
fn accepts_text_input(&mut self, window: &mut Window<'_>, cx: &mut App) -> bool
Whether the focused input currently accepts text.
Source§fn text_input_configuration(
&mut self,
window: &mut Window<'_>,
cx: &mut App,
) -> TextInputConfiguration
fn text_input_configuration( &mut self, window: &mut Window<'_>, cx: &mut App, ) -> TextInputConfiguration
The text input configuration of the focused input.
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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