Introduce instruction::Target in test crate
This commit is contained in:
parent
f9755b0b7a
commit
bdcaadbe00
8 changed files with 150 additions and 82 deletions
|
|
@ -5,12 +5,20 @@ use crate::widget::operation::Operation;
|
|||
|
||||
/// The internal state of a widget that has text input.
|
||||
pub trait TextInput {
|
||||
/// Returns the current _visible_ text of the text input
|
||||
///
|
||||
/// Normally, this is either its value or its placeholder.
|
||||
fn text(&self) -> &str;
|
||||
|
||||
/// Moves the cursor of the text input to the front of the input text.
|
||||
fn move_cursor_to_front(&mut self);
|
||||
|
||||
/// Moves the cursor of the text input to the end of the input text.
|
||||
fn move_cursor_to_end(&mut self);
|
||||
|
||||
/// Moves the cursor of the text input to an arbitrary location.
|
||||
fn move_cursor_to(&mut self, position: usize);
|
||||
|
||||
/// Selects all the content of the text input.
|
||||
fn select_all(&mut self);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue