pub trait ImeHandlerRef {
    // Required methods
    fn is_alive(&self) -> bool;
    fn acquire(
        &self,
        mutable: bool
    ) -> Option<Box<dyn InputHandler + 'static, Global>>;
    fn release(&self) -> bool;
}
Expand description

A trait for input handlers registered by widgets.

A widget registers itself as accepting text input by calling LifeCycleCtx::register_text_input while handling the LifeCycle::WidgetAdded event.

The widget does not explicitly deregister afterwards; rather anytime the widget tree changes, druid will call is_alive on each registered ImeHandlerRef, and deregister those that return false.

Required Methods§

fn is_alive(&self) -> bool

Returns true if this handler is still active.

fn acquire( &self, mutable: bool ) -> Option<Box<dyn InputHandler + 'static, Global>>

Mark the session as locked, and return a handle.

The lock can be read-write or read-only, indicated by the mutable flag.

if is_alive is true, this should always return Some(_).

fn release(&self) -> bool

Mark the session as released.

Implementors§