action.rs 692 B

1234567891011121314151617
  1. use crate::entities::GroupRowsChangesetPB;
  2. use crate::services::group::controller::MoveGroupRowContext;
  3. use flowy_grid_data_model::revision::RowRevision;
  4. pub trait GroupAction: Send + Sync {
  5. type CellDataType;
  6. fn can_group(&self, content: &str, cell_data: &Self::CellDataType) -> bool;
  7. fn add_row_if_match(&mut self, row_rev: &RowRevision, cell_data: &Self::CellDataType) -> Vec<GroupRowsChangesetPB>;
  8. fn remove_row_if_match(
  9. &mut self,
  10. row_rev: &RowRevision,
  11. cell_data: &Self::CellDataType,
  12. ) -> Vec<GroupRowsChangesetPB>;
  13. fn move_row(&mut self, cell_data: &Self::CellDataType, context: MoveGroupRowContext) -> Vec<GroupRowsChangesetPB>;
  14. }