excel_cli/actions/
column.rs

1use super::{ActionType, Command};
2use crate::excel::Cell;
3use anyhow::Result;
4
5#[derive(Clone)]
6pub struct ColumnAction {
7    pub sheet_index: usize,
8    pub sheet_name: String,
9    pub col: usize,
10    pub column_data: Vec<Cell>,
11    pub column_width: usize,
12}
13
14impl Command for ColumnAction {
15    fn execute(&self) -> Result<()> {
16        unimplemented!("Requires an ActionExecutor implementation")
17    }
18
19    fn undo(&self) -> Result<()> {
20        unimplemented!("Requires an ActionExecutor implementation")
21    }
22
23    fn action_type(&self) -> ActionType {
24        ActionType::DeleteColumn
25    }
26}
27
28#[derive(Clone)]
29pub struct MultiColumnAction {
30    pub sheet_index: usize,
31    pub sheet_name: String,
32    pub start_col: usize,
33    pub end_col: usize,
34    pub columns_data: Vec<Vec<Cell>>,
35    pub column_widths: Vec<usize>,
36}
37
38impl Command for MultiColumnAction {
39    fn execute(&self) -> Result<()> {
40        unimplemented!("Requires an ActionExecutor implementation")
41    }
42
43    fn undo(&self) -> Result<()> {
44        unimplemented!("Requires an ActionExecutor implementation")
45    }
46
47    fn action_type(&self) -> ActionType {
48        ActionType::DeleteMultiColumns
49    }
50}