Skip to main content

TextInputMethodConnection

Struct TextInputMethodConnection 

Source
pub struct TextInputMethodConnection { /* private fields */ }
Expand description

A manager-owned connection to one semantic input owner. Platform adapters capture it when the client is installed. It never redirects to a newer focused element, and retaining it does not retain its owner or client.

The input method manager creates a connection only for a client that opts in by implementing TextInputMethodEditing (TextInputMethodClient::input_method_editing returns Some); for every other client TextInputMethodClient::input_method_connection is None and the platform backends keep their upstream behaviour (docs/porting/winui-rich-text.md, decision D5).

Implementations§

Source§

impl TextInputMethodConnection

Source

pub fn owner(&self) -> Option<Ref<InputElement>>

The original input owner, only while this connection remains valid.

Source

pub fn is_current(&self) -> bool

Source

pub fn input_scope_names(&self) -> Option<Rc<[InputScopeNameValue]>>

The input scopes of the owner (TextInputOptions.InputScopeNames), while this connection remains valid. Backends read them here within 0.4, where they are not a field of TextInputOptions (decision D8).

Source

pub fn effective_input_scope(&self) -> Option<InputScopeNameValue>

The first input scope of the owner, for a platform with a single hint.

Source

pub fn effective_content_type( &self, options: &TextInputOptions, ) -> TextInputContentType

The content type that best matches the first input scope of the owner, or options.content_type without one.

Source

pub fn supports_composition(&self) -> bool

Source

pub fn supports_exact_edits(&self) -> bool

Source

pub fn edit_state(&self) -> Result<TextInputMethodState, TextInputMethodError>

Source

pub fn apply_edit( self: &Rc<Self>, edit: &TextInputMethodEdit, timestamp: u64, ) -> Result<bool, TextInputMethodError>

Applies a committed exact edit through the same raw/routed interception path as ordinary text. The owner’s acknowledgement is authoritative.

Source

pub fn select_exact( &self, selection: TextSelection, ) -> Result<(), TextInputMethodError>

Source

pub fn begin_composition( self: &Rc<Self>, ) -> Result<TextInputMethodComposition, TextInputMethodError>

Starts a new immutable platform session without deleting the current selection. Any previous session on this connection is superseded.

Source

pub fn commit_text( self: &Rc<Self>, text: &str, timestamp: u64, ) -> Result<bool, TextInputMethodError>

Sends ordinary committed input to a client with the atomic editing capability. A platform composing text should use its captured composition’s commit instead.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.