pub struct ImePreeditState { /* private fields */ }Expand description
Active OS Input Method Editor (IME) preedit composition state for CJK and dead-key input.
Implementations§
Source§impl ImePreeditState
Composition update and sanitization methods for ImePreeditState.
impl ImePreeditState
Composition update and sanitization methods for ImePreeditState.
Sourcepub fn update(
&mut self,
composition: String,
cursor_start_byte: usize,
cursor_end_byte: usize,
underlines: Vec<ImeUnderlineSpan>,
anchor_rect: Rect,
)
pub fn update( &mut self, composition: String, cursor_start_byte: usize, cursor_end_byte: usize, underlines: Vec<ImeUnderlineSpan>, anchor_rect: Rect, )
Starts or updates an active IME preedit composition string, cursor range, underline clauses, and candidate anchor rectangle.
§Arguments
String- Uncommitted UTF-8 composition string.usize- Inclusive UTF-8 cursor start offset withincomposition.usize- Exclusive UTF-8 cursor end offset withincomposition.Vec<ImeUnderlineSpan>- Clause underline spans withincomposition.Rect- Screen-space logical anchor rectangle for OS candidate popups.
Sourcepub fn set_candidate_anchor_rect_safe(&mut self, anchor_rect: Rect)
pub fn set_candidate_anchor_rect_safe(&mut self, anchor_rect: Rect)
Updates candidate_anchor_rect with finite non-negative dimensions.
§Arguments
Rect- Screen-space candidate anchor rectangle.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Clears the active IME composition text, cursor offsets, and underline clauses while keeping the anchor rectangle.
Sourcepub fn is_composing(&self) -> bool
pub fn is_composing(&self) -> bool
Returns true when an active non-empty IME composition is in progress.
§Returns
bool-truewhen actively composing preedit text.
Source§impl ImePreeditState
impl ImePreeditState
pub fn get_active(&self) -> bool
pub fn get_mut_active(&mut self) -> &mut bool
pub fn set_active(&mut self, val: bool) -> &mut Self
pub fn get_composition(&self) -> &String
pub fn get_mut_composition(&mut self) -> &mut String
pub fn set_composition(&mut self, val: String) -> &mut Self
pub fn get_cursor_start_byte(&self) -> usize
pub fn get_mut_cursor_start_byte(&mut self) -> &mut usize
pub fn set_cursor_start_byte(&mut self, val: usize) -> &mut Self
pub fn get_cursor_end_byte(&self) -> usize
pub fn get_mut_cursor_end_byte(&mut self) -> &mut usize
pub fn set_cursor_end_byte(&mut self, val: usize) -> &mut Self
pub fn get_underlines(&self) -> &Vec<ImeUnderlineSpan>
pub fn get_mut_underlines(&mut self) -> &mut Vec<ImeUnderlineSpan>
pub fn set_underlines(&mut self, val: Vec<ImeUnderlineSpan>) -> &mut Self
pub fn get_candidate_anchor_rect(&self) -> Rect
pub fn get_mut_candidate_anchor_rect(&mut self) -> &mut Rect
pub fn set_candidate_anchor_rect(&mut self, val: Rect) -> &mut Self
Trait Implementations§
Source§impl Clone for ImePreeditState
impl Clone for ImePreeditState
Source§impl Debug for ImePreeditState
impl Debug for ImePreeditState
Source§impl Default for ImePreeditState
impl Default for ImePreeditState
Source§impl PartialEq for ImePreeditState
impl PartialEq for ImePreeditState
impl StructuralPartialEq for ImePreeditState
Auto Trait Implementations§
impl Forget for ImePreeditState
impl Freeze for ImePreeditState
impl Move for ImePreeditState
impl RefUnwindSafe for ImePreeditState
impl Send for ImePreeditStatewhere
RawVecInner: Send,
impl Sync for ImePreeditStatewhere
RawVecInner: Sync,
impl Unpin for ImePreeditState
impl UnsafeUnpin for ImePreeditStatewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<ImeUnderlineSpan>: UnsafeUnpin,
impl UnwindSafe for ImePreeditStatewhere
RawVecInner: UnwindSafe,
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