Struct QueryComposition
pub struct QueryComposition { /* private fields */ }Expand description
Implementations§
§impl QueryComposition
impl QueryComposition
pub fn new() -> QueryComposition
pub fn is_composing(&self) -> bool
pub fn clear(&mut self)
pub fn pointer_selection(
&self,
text: &str,
position: Point,
) -> Option<Selection>
pub fn pointer_selection( &self, text: &str, position: Point, ) -> Option<Selection>
Place an inline query caret using its last shaped, painted layout. Stale text or active IME composition keeps the existing selection.
pub fn handle_ime(
&mut self,
ime: &Ime,
text: &mut String,
selection: &mut Selection,
) -> QueryImeChange
pub fn handle_ime( &mut self, ime: &Ime, text: &mut String, selection: &mut Selection, ) -> QueryImeChange
Apply one platform IME event. Preedit changes only this helper; commit replaces the owner’s current selection as one atomic string edit.
pub fn handle_event(
&mut self,
event: &WindowEvent,
text: &mut String,
selection: &mut Selection,
shift: bool,
command: bool,
) -> QueryEventChange
pub fn handle_event( &mut self, event: &WindowEvent, text: &mut String, selection: &mut Selection, shift: bool, command: bool, ) -> QueryEventChange
Apply the ordinary editing subset of a window event to a transient query. Navigation/activation keys such as Up, Down, Enter, Escape and Tab are intentionally left to the owning popup.
The owner supplies modifier state because winit reports it separately
from KeyEvent. command should be true for Ctrl on Linux/Windows or
Command on macOS.
pub fn display_text(&mut self, text: &str, selection: &Selection) -> String
pub fn display_text(&mut self, text: &str, selection: &Selection) -> String
Display text including the composition, shown at the caret. The
committed text is untouched until the IME commits.
pub fn draw(
&mut self,
ctx: &mut PaintCtx<'_>,
query: QueryView<'_>,
rect: Rect,
style: &TextStyle,
ink: QueryInk,
)
pub fn draw( &mut self, ctx: &mut PaintCtx<'_>, query: QueryView<'_>, rect: Rect, style: &TextStyle, ink: QueryInk, )
Paint an unwrapped query into a clipped viewport. The shaped caret is kept visible by horizontal scrolling; placeholder, selection and preedit use the same layout and baseline.
pub fn ime_edit_fingerprint(
&self,
text: &str,
selection: &Selection,
key: &[u8; 32],
) -> Option<[u8; 32]>
pub fn ime_edit_fingerprint( &self, text: &str, selection: &Selection, key: &[u8; 32], ) -> Option<[u8; 32]>
Private text/selection equality without retaining a query snapshot.
pub fn ime_cursor_rect(&self) -> Option<Rect>
Trait Implementations§
§impl Default for QueryComposition
impl Default for QueryComposition
§fn default() -> QueryComposition
fn default() -> QueryComposition
Auto Trait Implementations§
impl Freeze for QueryComposition
impl !RefUnwindSafe for QueryComposition
impl Send for QueryComposition
impl Sync for QueryComposition
impl Unpin for QueryComposition
impl UnsafeUnpin for QueryComposition
impl !UnwindSafe for QueryComposition
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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