#[non_exhaustive]pub struct InputMethodProperties {
pub text: SharedString,
pub cursor_position: usize,
pub anchor_position: Option<usize>,
pub preedit_text: SharedString,
pub preedit_offset: usize,
pub cursor_rect_origin: LogicalPosition,
pub cursor_rect_size: LogicalSize,
pub anchor_point: LogicalPosition,
pub input_type: InputType,
}
Expand description
This struct holds properties related to an input method.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.text: SharedString
The text surrounding the cursor.
This field does not include pre-edit text or composition.
cursor_position: usize
The position of the cursor in bytes within the text
.
anchor_position: Option<usize>
When there is a selection, this is the position of the second anchor for the beginning (or the end) of the selection.
preedit_text: SharedString
The current value of the pre-edit text as known by the input method. This is the text currently being edited but not yet committed. When empty, there is no pre-edit text.
preedit_offset: usize
When the preedit_text
is not empty, this is the offset of the pre-edit within the text
.
cursor_rect_origin: LogicalPosition
The top-left corner of the cursor rectangle in window coordinates.
cursor_rect_size: LogicalSize
The size of the cursor rectangle.
anchor_point: LogicalPosition
The position of the anchor (bottom). Only meaningful if anchor_position is Some
input_type: InputType
The type of input for the text edit.
Trait Implementations§
Source§impl Clone for InputMethodProperties
impl Clone for InputMethodProperties
Source§fn clone(&self) -> InputMethodProperties
fn clone(&self) -> InputMethodProperties
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more