20 lines
665 B
Rust
20 lines
665 B
Rust
// src/state/canvas_state.rs
|
|
|
|
pub trait CanvasState {
|
|
fn current_field(&self) -> usize;
|
|
fn current_cursor_pos(&self) -> usize;
|
|
fn has_unsaved_changes(&self) -> bool;
|
|
fn inputs(&self) -> Vec<&String>;
|
|
fn get_current_input(&self) -> &str;
|
|
fn get_current_input_mut(&mut self) -> &mut String;
|
|
fn fields(&self) -> Vec<&str>;
|
|
|
|
fn set_current_field(&mut self, index: usize);
|
|
fn set_current_cursor_pos(&mut self, pos: usize);
|
|
fn set_has_unsaved_changes(&mut self, changed: bool);
|
|
|
|
// --- Autocomplete Support ---
|
|
fn get_suggestions(&self) -> Option<&[String]>;
|
|
fn get_selected_suggestion_index(&self) -> Option<usize>;
|
|
}
|