pub trait FocusedTextFieldHandler {
// Required methods
fn handle_key(&self, event: &KeyEvent) -> bool;
fn insert_text(&self, text: &str);
fn delete_surrounding(&self, before_bytes: usize, after_bytes: usize);
fn copy_selection(&self) -> Option<String>;
fn cut_selection(&self) -> Option<String>;
fn set_composition(&self, text: &str, cursor: Option<(usize, usize)>);
}Expand description
Handler trait for focused text field operations. Stored in focus module for O(1) key/clipboard dispatch.
Required Methods§
Sourcefn handle_key(&self, event: &KeyEvent) -> bool
fn handle_key(&self, event: &KeyEvent) -> bool
Handle a key event. Returns true if consumed.
Sourcefn insert_text(&self, text: &str)
fn insert_text(&self, text: &str)
Insert pasted text.
Sourcefn delete_surrounding(&self, before_bytes: usize, after_bytes: usize)
fn delete_surrounding(&self, before_bytes: usize, after_bytes: usize)
Delete text surrounding the cursor or selection.
Sourcefn copy_selection(&self) -> Option<String>
fn copy_selection(&self) -> Option<String>
Copy current selection. Returns None if nothing selected.
Sourcefn cut_selection(&self) -> Option<String>
fn cut_selection(&self) -> Option<String>
Cut current selection (copy + delete). Returns None if nothing selected.