⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

InputMethodEditor

Struct InputMethodEditor 

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

Input Method Editor framework.

Provides the state machine and data structures for input composition. Actual input method dictionaries would be loaded from user space.

Implementations§

Source§

impl InputMethodEditor

Source

pub fn new() -> Self

Create a new IME with basic Pinyin stub entries.

Source

pub fn set_enabled(&mut self, enabled: bool)

Enable or disable the IME.

Source

pub fn is_enabled(&self) -> bool

Check if IME is enabled.

Source

pub fn state(&self) -> ImeState

Get current IME state.

Source

pub fn preedit(&self) -> &str

Get the preedit string (what the user is typing).

Source

pub fn preedit_cursor(&self) -> usize

Get the preedit cursor position.

Source

pub fn candidates(&self) -> &[ImeCandidate]

Get the candidate list.

Source

pub fn selected_candidate(&self) -> usize

Get the selected candidate index.

Source

pub fn take_committed(&mut self) -> String

Get and clear the committed text.

Source

pub fn feed_char(&mut self, ch: char)

Feed a character into the IME.

Source

pub fn feed_backspace(&mut self)

Feed a backspace into the IME.

Source

pub fn feed_enter(&mut self)

Feed an Enter key: commit preedit as-is.

Source

pub fn feed_escape(&mut self)

Feed Escape: cancel composition.

Source

pub fn candidate_prev(&mut self)

Move candidate selection up.

Source

pub fn candidate_next(&mut self)

Move candidate selection down.

Source

pub fn reset(&mut self)

Reset the IME to inactive state.

Trait Implementations§

Source§

impl Debug for InputMethodEditor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InputMethodEditor

Available on crate feature alloc only.
Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for InputMethodEditor

§

impl RefUnwindSafe for InputMethodEditor

§

impl Send for InputMethodEditor

§

impl Sync for InputMethodEditor

§

impl Unpin for InputMethodEditor

§

impl UnwindSafe for InputMethodEditor

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.