Skip to main content

AppState

Struct AppState 

Source
pub struct AppState {
Show 23 fields pub day_data: DayData, pub current_date: Date, pub mode: AppMode, pub selected_index: usize, pub edit_field: EditField, pub input_buffer: String, pub time_cursor: usize, pub should_quit: bool, pub visual_start: usize, pub visual_end: usize, pub command_palette_input: String, pub command_palette_selected: usize, pub available_commands: Vec<Command>, pub date_changed: bool, pub calendar_selected_date: Date, pub calendar_view_month: Month, pub calendar_view_year: i32, pub config: Config, pub theme: Theme, pub last_error_message: Option<String>, pub task_picker_selected: usize, pub active_timer: Option<TimerState>, pub last_file_modified: Option<SystemTime>, /* private fields */
}

Fields§

§day_data: DayData§current_date: Date§mode: AppMode§selected_index: usize§edit_field: EditField§input_buffer: String§time_cursor: usize§should_quit: bool§visual_start: usize§visual_end: usize§command_palette_input: String§command_palette_selected: usize§available_commands: Vec<Command>§date_changed: bool§calendar_selected_date: Date§calendar_view_month: Month§calendar_view_year: i32§config: Config§theme: Theme§last_error_message: Option<String>§task_picker_selected: usize§active_timer: Option<TimerState>§last_file_modified: Option<SystemTime>

Implementations§

Source§

impl AppState

Source

pub fn new(day_data: DayData) -> Self

Source

pub fn get_selected_record(&self) -> Option<&WorkRecord>

Source

pub fn show_project_column(&self) -> bool

Source

pub fn show_customer_column(&self) -> bool

Source

pub fn show_description_column(&self) -> bool

Source

pub fn visible_edit_fields(&self) -> Vec<EditField>

Source

pub fn move_selection_up(&mut self)

Source

pub fn move_selection_down(&mut self)

Source

pub fn enter_edit_mode(&mut self)

Source

pub fn change_task_name(&mut self)

Source

pub fn exit_edit_mode(&mut self)

Source

pub fn next_field(&mut self)

Source

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

Source

pub fn handle_backspace(&mut self)

Source

pub fn save_edit(&mut self) -> Result<(), String>

Source

pub fn add_new_record(&mut self)

Source

pub fn add_break(&mut self)

Source

pub fn delete_selected_record(&mut self)

Source

pub fn move_field_left(&mut self)

Source

pub fn move_field_right(&mut self)

Source

pub fn set_current_time_on_field(&mut self)

Source

pub fn enter_visual_mode(&mut self)

Source

pub fn exit_visual_mode(&mut self)

Source

pub fn is_in_visual_selection(&self, index: usize) -> bool

Source

pub fn delete_visual_selection(&mut self)

Source

pub fn undo(&mut self)

Source

pub fn redo(&mut self)

Source

pub fn open_command_palette(&mut self)

Source

pub fn close_command_palette(&mut self)

Source

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

Source

pub fn handle_command_palette_backspace(&mut self)

Source

pub fn move_command_palette_up(&mut self)

Source

pub fn move_command_palette_down(&mut self, filtered_count: usize)

Source

pub fn get_filtered_commands(&self) -> Vec<(usize, i64, &Command)>

Source

pub fn execute_selected_command(&mut self) -> Option<CommandAction>

Source

pub fn navigate_to_previous_day(&mut self)

Source

pub fn navigate_to_next_day(&mut self)

Source

pub fn load_new_day_data(&mut self, new_day_data: DayData)

Source

pub fn open_calendar(&mut self)

Source

pub fn close_calendar(&mut self)

Source

pub fn calendar_navigate_left(&mut self)

Source

pub fn calendar_navigate_right(&mut self)

Source

pub fn calendar_navigate_up(&mut self)

Source

pub fn calendar_navigate_down(&mut self)

Source

pub fn calendar_previous_month(&mut self)

Source

pub fn calendar_next_month(&mut self)

Source

pub fn calendar_select_date(&mut self)

Source

pub fn open_ticket_in_browser(&mut self)

Source

pub fn open_worklog_in_browser(&mut self)

Source

pub fn clear_error(&mut self)

Source

pub fn close_task_picker(&mut self)

Source

pub fn get_unique_task_names(&self) -> Vec<String>

Source

pub fn get_filtered_task_names(&self) -> Vec<String>

Source

pub fn move_task_picker_up(&mut self)

Source

pub fn move_task_picker_down(&mut self, task_count: usize)

Source

pub fn select_task_from_picker(&mut self)

Source

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

Source

pub fn handle_task_picker_backspace(&mut self)

Source

pub fn start_timer_for_selected( &mut self, storage: &StorageManager, ) -> Result<(), String>

Start a new timer with the current selected task

Source

pub fn stop_active_timer( &mut self, storage: &mut StorageManager, ) -> Result<(), String>

Stop the active timer and convert to work record

Source

pub fn pause_active_timer( &mut self, storage: &StorageManager, ) -> Result<(), String>

Pause the active timer

Source

pub fn resume_active_timer( &mut self, storage: &StorageManager, ) -> Result<(), String>

Resume a paused timer

Source

pub fn get_timer_status(&self) -> Option<&TimerState>

Get current status of active timer or None if no timer running

Source

pub fn check_and_reload_if_modified( &mut self, storage: &mut StorageManager, ) -> bool

Check if the data file has been modified externally and reload if needed Returns true if the file was reloaded

Auto Trait Implementations§

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.