FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    TextInputMethodClient

    trait · ferroui-base · v0.5.0

    trait TextInputMethodClient
    

    The text editing side of a text input method: what a text editing control gives the input method of the platform to work with.

    Implementations embed a TextInputMethodClientEvents and provide the members describing the text; the events and the methods raising them are provided. Clients are compared by reference.

    View source

    Members

    events

    fn events(self: &Self) -> &TextInputMethodClientEvents
    

    The events of the client.

    Source

    input_method_owner

    fn input_method_owner(self: &Self) -> Option<Ref<InputElement>>
    

    The semantic control that receives input and supplies options/geometry. Existing clients default to the element queried by the input manager.

    Source

    retains_input_method_focus

    fn retains_input_method_focus(self: &Self, _focused: &InputElement) -> bool
    

    Whether a focus destination belongs to this client's active editing UI. The client must check actual object identity and current ownership.

    Source

    input_method_connection

    fn input_method_connection(self: &Self) -> Option<Rc<TextInputMethodConnection>>
    

    The current manager connection; adapters capture it during set_client. The manager connects only a client that implements input_method_editing; for any other client this is None, and the platform backends keep their upstream behaviour.

    Source

    input_method_editing

    fn input_method_editing(self: &Self) -> Option<&dyn TextInputMethodEditing>
    

    Atomic composition, when implemented by this editing control. Returning Some opts the client in to the exact-edit connection (TextInputMethodConnection): its owner's options are published again when they change, and a reset gives it a new connection.

    Source

    input_method_state_revision

    fn input_method_state_revision(self: &Self) -> Option<u64>
    

    Optional identity of the current editing state, including changes whose public text/selection notifications are still deferred. A supporting client advances this revision for changes to its document, selection or composition state; reading it must describe the current state.

    This getter is observational: it may update a private cache used to produce the revision, but must not initiate edits, input operations or ownership transitions. The connection defensively rejects observable reentrancy; it cannot identify an unreported edit made by the getter itself when the getter returns that edit's new revision.

    Input sessions compare both this revision and the public event version. Existing clients that return None continue to use their events alone.

    Source

    text_view_visual

    fn text_view_visual(self: &Self) -> Option<Ref<Visual>>
    

    The visual that's showing the text, or None when the client has none (a text box without a template).

    Source

    supports_preedit

    fn supports_preedit(self: &Self) -> bool
    

    Indicates if the text input method client is capable of displaying non-committed input on the cursor position.

    Source

    supports_surrounding_text

    fn supports_surrounding_text(self: &Self) -> bool
    

    Indicates if the text input method client supports sending surrounding text.

    Source

    input_options

    fn input_options(self: &Self, _focused_element: &Ref<InputElement>, options: TextInputOptions) -> TextInputOptions
    

    Finalizes this client's native input options without overwriting the focused element's attached values. The default keeps the supplied options.

    Source

    surrounding_text

    fn surrounding_text(self: &Self) -> String
    

    Returns the text around the cursor, usually the current paragraph.

    Source

    cursor_rectangle

    fn cursor_rectangle(self: &Self) -> Rect
    

    Gets the cursor rectangle relative to the semantic input owner. The text-view visual is observed for layout changes; it may be a descendant.

    Source

    text_range_geometry

    fn text_range_geometry(self: &Self, _range: TextSelection) -> Result<TextInputMethodRangeGeometry, TextInputMethodError>
    

    Queries an ordered range of the visible UTF-16 story, including any composition preview. The result covers the requested range without changing selection, scrolling, composition or history. Read-only range endpoints can lie inside a shaped cluster or a surrogate pair: use the formatter's cluster bounds and insertion-edge rules for those positions.

    Unsupported preserves the platform's legacy caret fallback. A client that implements this capability returns Unavailable for hidden or unformatted text, InvalidRange for invalid offsets, and StateChanged for reentrant invalidation; these must never fall back to another caret.

    Source

    selection

    fn selection(self: &Self) -> TextSelection
    

    Gets the selection that is currently active.

    Source

    set_selection

    fn set_selection(self: &Self, value: TextSelection)
    

    Sets the selection that is currently active.

    Source

    set_preedit_text

    fn set_preedit_text(self: &Self, _preedit_text: Option<&str>)
    

    Sets the non-committed input string.

    Source

    execute_context_menu_action

    fn execute_context_menu_action(self: &Self, _action: ContextMenuAction)
    

    Executes a context menu action.

    Source

    set_preedit_text_with_cursor

    fn set_preedit_text_with_cursor(self: &Self, preedit_text: Option<&str>, _cursor_pos: Option<i32>)
    

    Sets the non-committed input string and the cursor offset in that string.

    Source

    text_view_visual_changed

    fn text_view_visual_changed(self: &Self, handler: Rc<dyn Fn() -> ()>) -> Rc<dyn IDisposable>
    

    Fires when the text view visual has changed. Disposing the returned handle unsubscribes.

    Source

    cursor_rectangle_changed

    fn cursor_rectangle_changed(self: &Self, handler: Rc<dyn Fn() -> ()>) -> Rc<dyn IDisposable>
    

    Fires when the cursor rectangle has changed. Disposing the returned handle unsubscribes.

    Source

    surrounding_text_changed

    fn surrounding_text_changed(self: &Self, handler: Rc<dyn Fn() -> ()>) -> Rc<dyn IDisposable>
    

    Fires when the surrounding text has changed. Disposing the returned handle unsubscribes.

    Source

    selection_changed

    fn selection_changed(self: &Self, handler: Rc<dyn Fn() -> ()>) -> Rc<dyn IDisposable>
    

    Fires when the selection has changed. Disposing the returned handle unsubscribes.

    Source

    reset_requested

    fn reset_requested(self: &Self, handler: Rc<dyn Fn() -> ()>) -> Rc<dyn IDisposable>
    

    Fires when client wants to reset the input state. Disposing the returned handle unsubscribes.

    Source

    input_pane_activation_requested

    fn input_pane_activation_requested(self: &Self, handler: Rc<dyn Fn() -> ()>) -> Rc<dyn IDisposable>
    

    Fires when the client requires the input pane (on-screen keyboard) to be shown. Disposing the returned handle unsubscribes.

    Source

    raise_text_view_visual_changed

    fn raise_text_view_visual_changed(self: &Self)
    

    Raises the event telling that the text view visual has changed.

    Source

    raise_cursor_rectangle_changed

    fn raise_cursor_rectangle_changed(self: &Self)
    

    Raises the event telling that the cursor rectangle has changed.

    Source

    raise_surrounding_text_changed

    fn raise_surrounding_text_changed(self: &Self)
    

    Raises the event telling that the surrounding text has changed.

    Source

    raise_selection_changed

    fn raise_selection_changed(self: &Self)
    

    Raises the event telling that the selection has changed.

    Source

    raise_input_pane_activation_requested

    fn raise_input_pane_activation_requested(self: &Self)
    

    Raises the event asking for the input pane to be shown.

    Source

    request_reset

    fn request_reset(self: &Self)
    

    Asks for the input state to be reset.

    Source

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.