Struct AppState

Source
pub struct AppState<'a> {
Show 30 fields pub workbook: Workbook, pub file_path: PathBuf, pub selected_cell: (usize, usize), pub start_row: usize, pub start_col: usize, pub visible_rows: usize, pub visible_cols: usize, pub input_mode: InputMode, pub input_buffer: String, pub text_area: TextArea<'a>, pub should_quit: bool, pub column_widths: Vec<usize>, pub sheet_column_widths: HashMap<String, Vec<usize>>, pub sheet_cell_positions: HashMap<String, CellPosition>, pub clipboard: Option<String>, pub g_pressed: bool, pub row_number_width: usize, pub search_query: String, pub search_results: Vec<(usize, usize)>, pub current_search_idx: Option<usize>, pub search_direction: bool, pub highlight_enabled: bool, pub info_panel_height: usize, pub notification_messages: Vec<String>, pub max_notifications: usize, pub help_text: String, pub help_scroll: usize, pub help_visible_lines: usize, pub undo_history: UndoHistory, pub vim_state: Option<VimState>,
}

Fields§

§workbook: Workbook§file_path: PathBuf§selected_cell: (usize, usize)§start_row: usize§start_col: usize§visible_rows: usize§visible_cols: usize§input_mode: InputMode§input_buffer: String§text_area: TextArea<'a>§should_quit: bool§column_widths: Vec<usize>§sheet_column_widths: HashMap<String, Vec<usize>>§sheet_cell_positions: HashMap<String, CellPosition>§clipboard: Option<String>§g_pressed: bool§row_number_width: usize§search_query: String§search_results: Vec<(usize, usize)>§current_search_idx: Option<usize>§search_direction: bool§highlight_enabled: bool§info_panel_height: usize§notification_messages: Vec<String>§max_notifications: usize§help_text: String§help_scroll: usize§help_visible_lines: usize§undo_history: UndoHistory§vim_state: Option<VimState>

Implementations§

Source§

impl AppState<'_>

Source

pub fn start_editing(&mut self)

Source

pub fn handle_vim_input(&mut self, input: Input) -> Result<()>

Source

pub fn confirm_edit(&mut self) -> Result<()>

Source

pub fn copy_cell(&mut self)

Source

pub fn cut_cell(&mut self) -> Result<()>

Source

pub fn paste_cell(&mut self) -> Result<()>

Source§

impl AppState<'_>

Source

pub fn move_cursor(&mut self, delta_row: isize, delta_col: isize)

Source

pub fn handle_scrolling(&mut self)

Source

pub fn jump_to_first_row(&mut self)

Source

pub fn jump_to_last_row(&mut self)

Source

pub fn jump_to_first_column(&mut self)

Source

pub fn jump_to_first_non_empty_column(&mut self)

Source

pub fn jump_to_last_column(&mut self)

Source

pub fn jump_to_prev_non_empty_cell_left(&mut self)

Source

pub fn jump_to_prev_non_empty_cell_right(&mut self)

Source

pub fn jump_to_prev_non_empty_cell_up(&mut self)

Source

pub fn jump_to_prev_non_empty_cell_down(&mut self)

Source

pub fn ensure_column_visible(&mut self, column: usize)

Source§

impl AppState<'_>

Source

pub fn start_search_forward(&mut self)

Source

pub fn start_search_backward(&mut self)

Source

pub fn find_all_matches(&self, query: &str) -> Vec<(usize, usize)>

Source

pub fn jump_to_next_search_result(&mut self)

Source

pub fn jump_to_prev_search_result(&mut self)

Source

pub fn disable_search_highlight(&mut self)

Source§

impl AppState<'_>

Source

pub fn next_sheet(&mut self) -> Result<()>

Source

pub fn prev_sheet(&mut self) -> Result<()>

Source

pub fn switch_sheet_by_index(&mut self, index: usize) -> Result<()>

Source

pub fn switch_to_sheet(&mut self, name_or_index: &str)

Source

pub fn delete_current_sheet(&mut self)

Source

pub fn delete_current_row(&mut self) -> Result<()>

Source

pub fn delete_row(&mut self, row: usize) -> Result<()>

Source

pub fn delete_rows(&mut self, start_row: usize, end_row: usize) -> Result<()>

Source

pub fn delete_current_column(&mut self) -> Result<()>

Source

pub fn delete_column(&mut self, col: usize) -> Result<()>

Source

pub fn delete_columns(&mut self, start_col: usize, end_col: usize) -> Result<()>

Source

pub fn auto_adjust_column_width(&mut self, col: Option<usize>)

Source

pub fn get_column_width(&self, col: usize) -> usize

Source

pub fn ensure_column_widths(&mut self)

Source§

impl AppState<'_>

Source

pub fn new(workbook: Workbook, file_path: PathBuf) -> Result<Self>

Source

pub fn add_notification(&mut self, message: String)

Source

pub fn update_row_number_width(&mut self)

Updates the row number width based on the maximum row number in the current sheet

Source

pub fn adjust_info_panel_height(&mut self, delta: isize)

Source

pub fn get_cell_content(&self, row: usize, col: usize) -> String

Source

pub fn get_cell_content_mut(&mut self, row: usize, col: usize) -> String

Source

pub fn cancel_input(&mut self)

Source

pub fn add_char_to_input(&mut self, c: char)

Source

pub fn delete_char_from_input(&mut self)

Source

pub fn start_command_mode(&mut self)

Source

pub fn start_command_in_lazy_loading_mode(&mut self)

Source§

impl AppState<'_>

Source

pub fn show_help(&mut self)

Source

pub fn save_and_exit(&mut self)

Source

pub fn save(&mut self) -> Result<(), Error>

Source

pub fn exit_without_saving(&mut self)

Source§

impl AppState<'_>

Source

pub fn undo(&mut self) -> Result<()>

Source

pub fn redo(&mut self) -> Result<()>

Source§

impl AppState<'_>

Source

pub fn execute_command(&mut self)

Trait Implementations§

Auto Trait Implementations§

§

impl<'a> !Freeze for AppState<'a>

§

impl<'a> RefUnwindSafe for AppState<'a>

§

impl<'a> !Send for AppState<'a>

§

impl<'a> !Sync for AppState<'a>

§

impl<'a> Unpin for AppState<'a>

§

impl<'a> UnwindSafe for AppState<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.