25 lines
806 B
Rust
25 lines
806 B
Rust
// src/state/pages/canvas_state.rs
|
|
|
|
use common::proto::multieko2::search::search_response::Hit;
|
|
|
|
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>;
|
|
fn get_rich_suggestions(&self) -> Option<&[Hit]> {
|
|
None
|
|
}
|
|
}
|