pub struct ImeArgs {
pub timestamp: DInstant,
pub target: WidgetPath,
pub txt: Txt,
pub preview_caret: Option<(usize, usize)>,
pub propagation: EventPropagationHandle,
}Expand description
Arguments for IME_EVENT.
Fields§
§timestamp: DInstantInstant the event happened.
target: WidgetPathThe enabled text input widget.
txt: TxtThe text, preview or actual insert.
preview_caret: Option<(usize, usize)>Caret/selection within the txt when it is preview.
The indexes are in char byte offsets and indicate where the caret or selection must be placed on
the inserted or preview txt, if not set the position is at the end of the insert.
If this is None the text must commit.
propagation: EventPropagationHandlePropagation handle associated with this event instance.
Cloned arguments share the same handle, some arguments may also share the handle of another event if they share the same cause.
Implementations§
Source§impl ImeArgs
impl ImeArgs
Source§impl ImeArgs
impl ImeArgs
Sourcepub fn commit(&self) -> bool
pub fn commit(&self) -> bool
If the text must be actually inserted.
If true the txt must be actually inserted at the last non-preview caret/selection, the caret then must be moved to
after the inserted text.
If false the widget must visually adjust the text and caret to look as if the input has committed, but the
actual text must not be altered, and if the txt is empty the previous caret/selection must be restored.
Usually the preview text is rendered with an underline effect, otherwise it has the same appearance as the
committed text.
Trait Implementations§
Source§impl AnyEventArgs for ImeArgs
impl AnyEventArgs for ImeArgs
Source§fn is_in_target(&self, id: WidgetId) -> bool
fn is_in_target(&self, id: WidgetId) -> bool
Target.
Source§fn propagation(&self) -> &EventPropagationHandle
fn propagation(&self) -> &EventPropagationHandle
Source§fn clone_boxed(&self) -> Box<dyn AnyEventArgs>
fn clone_boxed(&self) -> Box<dyn AnyEventArgs>
impl EventArgs for ImeArgs
impl StructuralPartialEq for ImeArgs
Auto Trait Implementations§
impl Freeze for ImeArgs
impl RefUnwindSafe for ImeArgs
impl Send for ImeArgs
impl Sync for ImeArgs
impl Unpin for ImeArgs
impl UnwindSafe for ImeArgs
Blanket Implementations§
Source§impl<T> AnyVarValue for T
impl<T> AnyVarValue for T
Source§fn clone_boxed(&self) -> BoxAnyVarValue
fn clone_boxed(&self) -> BoxAnyVarValue
Source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
self and other are equal.Source§fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
fn try_swap(&mut self, other: &mut (dyn AnyVarValue + 'static)) -> bool
other if both are of the same type.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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more