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
impl TextInputMethodConnection
Sourcepub fn owner(&self) -> Option<Ref<InputElement>>
pub fn owner(&self) -> Option<Ref<InputElement>>
The original input owner, only while this connection remains valid.
pub fn is_current(&self) -> bool
Sourcepub fn input_scope_names(&self) -> Option<Rc<[InputScopeNameValue]>>
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).
Sourcepub fn effective_input_scope(&self) -> Option<InputScopeNameValue>
pub fn effective_input_scope(&self) -> Option<InputScopeNameValue>
The first input scope of the owner, for a platform with a single hint.
Sourcepub fn effective_content_type(
&self,
options: &TextInputOptions,
) -> TextInputContentType
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.
pub fn supports_composition(&self) -> bool
pub fn supports_exact_edits(&self) -> bool
pub fn edit_state(&self) -> Result<TextInputMethodState, TextInputMethodError>
Sourcepub fn apply_edit(
self: &Rc<Self>,
edit: &TextInputMethodEdit,
timestamp: u64,
) -> Result<bool, TextInputMethodError>
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.
pub fn select_exact( &self, selection: TextSelection, ) -> Result<(), TextInputMethodError>
Sourcepub fn begin_composition(
self: &Rc<Self>,
) -> Result<TextInputMethodComposition, TextInputMethodError>
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.
Sourcepub fn commit_text(
self: &Rc<Self>,
text: &str,
timestamp: u64,
) -> Result<bool, TextInputMethodError>
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§
impl !Freeze for TextInputMethodConnection
impl !RefUnwindSafe for TextInputMethodConnection
impl !Send for TextInputMethodConnection
impl !Sync for TextInputMethodConnection
impl !UnwindSafe for TextInputMethodConnection
impl Unpin for TextInputMethodConnection
impl UnsafeUnpin for TextInputMethodConnection
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more