pub trait ZwpInputMethodContextV1: Dispatcher {
    const INTERFACE: &'static str = "zwp_input_method_context_v1";
    const VERSION: u32 = 1u32;
Show 21 methods // Required methods fn destroy( &self, client: &mut Client, sender_id: ObjectId, ) -> impl Future<Output = Result<()>> + Send; fn commit_string( &self, client: &mut Client, sender_id: ObjectId, serial: u32, text: String, ) -> impl Future<Output = Result<()>> + Send; fn preedit_string( &self, client: &mut Client, sender_id: ObjectId, serial: u32, text: String, commit: String, ) -> impl Future<Output = Result<()>> + Send; fn preedit_styling( &self, client: &mut Client, sender_id: ObjectId, index: u32, length: u32, style: u32, ) -> impl Future<Output = Result<()>> + Send; fn preedit_cursor( &self, client: &mut Client, sender_id: ObjectId, index: i32, ) -> impl Future<Output = Result<()>> + Send; fn delete_surrounding_text( &self, client: &mut Client, sender_id: ObjectId, index: i32, length: u32, ) -> impl Future<Output = Result<()>> + Send; fn cursor_position( &self, client: &mut Client, sender_id: ObjectId, index: i32, anchor: i32, ) -> impl Future<Output = Result<()>> + Send; fn modifiers_map( &self, client: &mut Client, sender_id: ObjectId, map: Vec<u8>, ) -> impl Future<Output = Result<()>> + Send; fn keysym( &self, client: &mut Client, sender_id: ObjectId, serial: u32, time: u32, sym: u32, state: u32, modifiers: u32, ) -> impl Future<Output = Result<()>> + Send; fn grab_keyboard( &self, client: &mut Client, sender_id: ObjectId, keyboard: ObjectId, ) -> impl Future<Output = Result<()>> + Send; fn key( &self, client: &mut Client, sender_id: ObjectId, serial: u32, time: u32, key: u32, state: u32, ) -> impl Future<Output = Result<()>> + Send; fn modifiers( &self, client: &mut Client, sender_id: ObjectId, serial: u32, mods_depressed: u32, mods_latched: u32, mods_locked: u32, group: u32, ) -> impl Future<Output = Result<()>> + Send; fn language( &self, client: &mut Client, sender_id: ObjectId, serial: u32, language: String, ) -> impl Future<Output = Result<()>> + Send; fn text_direction( &self, client: &mut Client, sender_id: ObjectId, serial: u32, direction: u32, ) -> impl Future<Output = Result<()>> + Send; // Provided methods fn handle_request( &self, client: &mut Client, sender_id: ObjectId, message: &mut Message, ) -> impl Future<Output = Result<()>> + Send { ... } fn surrounding_text( &self, client: &mut Client, sender_id: ObjectId, text: String, cursor: u32, anchor: u32, ) -> impl Future<Output = Result<()>> + Send { ... } fn reset( &self, client: &mut Client, sender_id: ObjectId, ) -> impl Future<Output = Result<()>> + Send { ... } fn content_type( &self, client: &mut Client, sender_id: ObjectId, hint: u32, purpose: u32, ) -> impl Future<Output = Result<()>> + Send { ... } fn invoke_action( &self, client: &mut Client, sender_id: ObjectId, button: u32, index: u32, ) -> impl Future<Output = Result<()>> + Send { ... } fn commit_state( &self, client: &mut Client, sender_id: ObjectId, serial: u32, ) -> impl Future<Output = Result<()>> + Send { ... } fn preferred_language( &self, client: &mut Client, sender_id: ObjectId, language: String, ) -> impl Future<Output = Result<()>> + Send { ... }
}
Available on crate features server and unstable only.
Expand description

Trait to implement the zwp_input_method_context_v1 interface. See the module level documentation for more info

Provided Associated Constants§

Source

const INTERFACE: &'static str = "zwp_input_method_context_v1"

Source

const VERSION: u32 = 1u32

Required Methods§

Source

fn destroy( &self, client: &mut Client, sender_id: ObjectId, ) -> impl Future<Output = Result<()>> + Send

Source

fn commit_string( &self, client: &mut Client, sender_id: ObjectId, serial: u32, text: String, ) -> impl Future<Output = Result<()>> + Send

Send the commit string text for insertion to the application.

The text to commit could be either just a single character after a key press or the result of some composing (pre-edit). It could be also an empty text when some text should be removed (see delete_surrounding_text) or when the input cursor should be moved (see cursor_position).

Any previously set composing text will be removed.

Source

fn preedit_string( &self, client: &mut Client, sender_id: ObjectId, serial: u32, text: String, commit: String, ) -> impl Future<Output = Result<()>> + Send

Send the pre-edit string text to the application text input.

The commit text can be used to replace the pre-edit text on reset (for example on unfocus).

Previously sent preedit_style and preedit_cursor requests are also processed by the text_input.

Source

fn preedit_styling( &self, client: &mut Client, sender_id: ObjectId, index: u32, length: u32, style: u32, ) -> impl Future<Output = Result<()>> + Send

Set the styling information on composing text. The style is applied for length in bytes from index relative to the beginning of the composing text (as byte offset). Multiple styles can be applied to a composing text.

This request should be sent before sending a preedit_string request.

Source

fn preedit_cursor( &self, client: &mut Client, sender_id: ObjectId, index: i32, ) -> impl Future<Output = Result<()>> + Send

Set the cursor position inside the composing text (as byte offset) relative to the start of the composing text.

When index is negative no cursor should be displayed.

This request should be sent before sending a preedit_string request.

Source

fn delete_surrounding_text( &self, client: &mut Client, sender_id: ObjectId, index: i32, length: u32, ) -> impl Future<Output = Result<()>> + Send

Remove the surrounding text.

This request will be handled on the text_input side directly following a commit_string request.

Source

fn cursor_position( &self, client: &mut Client, sender_id: ObjectId, index: i32, anchor: i32, ) -> impl Future<Output = Result<()>> + Send

Set the cursor and anchor to a new position. Index is the new cursor position in bytes (when >= 0 this is relative to the end of the inserted text, otherwise it is relative to the beginning of the inserted text). Anchor is the new anchor position in bytes (when >= 0 this is relative to the end of the inserted text, otherwise it is relative to the beginning of the inserted text). When there should be no selected text, anchor should be the same as index.

This request will be handled on the text_input side directly following a commit_string request.

Source

fn modifiers_map( &self, client: &mut Client, sender_id: ObjectId, map: Vec<u8>, ) -> impl Future<Output = Result<()>> + Send

Source

fn keysym( &self, client: &mut Client, sender_id: ObjectId, serial: u32, time: u32, sym: u32, state: u32, modifiers: u32, ) -> impl Future<Output = Result<()>> + Send

Notify when a key event was sent. Key events should not be used for normal text input operations, which should be done with commit_string, delete_surrounding_text, etc. The key event follows the wl_keyboard key event convention. Sym is an XKB keysym, state is a wl_keyboard key_state.

Source

fn grab_keyboard( &self, client: &mut Client, sender_id: ObjectId, keyboard: ObjectId, ) -> impl Future<Output = Result<()>> + Send

Allow an input method to receive hardware keyboard input and process key events to generate text events (with pre-edit) over the wire. This allows input methods which compose multiple key events for inputting text like it is done for CJK languages.

Source

fn key( &self, client: &mut Client, sender_id: ObjectId, serial: u32, time: u32, key: u32, state: u32, ) -> impl Future<Output = Result<()>> + Send

Forward a wl_keyboard::key event to the client that was not processed by the input method itself. Should be used when filtering key events with grab_keyboard. The arguments should be the ones from the wl_keyboard::key event.

For generating custom key events use the keysym request instead.

Source

fn modifiers( &self, client: &mut Client, sender_id: ObjectId, serial: u32, mods_depressed: u32, mods_latched: u32, mods_locked: u32, group: u32, ) -> impl Future<Output = Result<()>> + Send

Forward a wl_keyboard::modifiers event to the client that was not processed by the input method itself. Should be used when filtering key events with grab_keyboard. The arguments should be the ones from the wl_keyboard::modifiers event.

Source

fn language( &self, client: &mut Client, sender_id: ObjectId, serial: u32, language: String, ) -> impl Future<Output = Result<()>> + Send

Source

fn text_direction( &self, client: &mut Client, sender_id: ObjectId, serial: u32, direction: u32, ) -> impl Future<Output = Result<()>> + Send

Provided Methods§

Source

fn handle_request( &self, client: &mut Client, sender_id: ObjectId, message: &mut Message, ) -> impl Future<Output = Result<()>> + Send

Source

fn surrounding_text( &self, client: &mut Client, sender_id: ObjectId, text: String, cursor: u32, anchor: u32, ) -> impl Future<Output = Result<()>> + Send

The plain surrounding text around the input position. Cursor is the position in bytes within the surrounding text relative to the beginning of the text. Anchor is the position in bytes of the selection anchor within the surrounding text relative to the beginning of the text. If there is no selected text then anchor is the same as cursor.

Source

fn reset( &self, client: &mut Client, sender_id: ObjectId, ) -> impl Future<Output = Result<()>> + Send

Source

fn content_type( &self, client: &mut Client, sender_id: ObjectId, hint: u32, purpose: u32, ) -> impl Future<Output = Result<()>> + Send

Source

fn invoke_action( &self, client: &mut Client, sender_id: ObjectId, button: u32, index: u32, ) -> impl Future<Output = Result<()>> + Send

Source

fn commit_state( &self, client: &mut Client, sender_id: ObjectId, serial: u32, ) -> impl Future<Output = Result<()>> + Send

Source

fn preferred_language( &self, client: &mut Client, sender_id: ObjectId, language: String, ) -> impl Future<Output = Result<()>> + Send

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§