Files
gpx.studio/gpx-rs/engine/src/engine/action.rs
T

24 lines
605 B
Rust
Raw Normal View History

2026-10-03 16:40:17 +02:00
use crate::{Command, FileId};
/// Everything the frontend can ask the engine to do.
///
/// Only [`Action::Edit`] changes the files (and records an undo step); the others act on the
2026-10-03 17:42:26 +02:00
/// history, on the selection or on the file order.
2026-10-03 16:40:17 +02:00
#[derive(Debug)]
pub enum Action<'a> {
Edit(Command<'a>),
Undo,
Redo,
2026-10-03 17:42:26 +02:00
Select {
file_ids: Vec<FileId>,
},
AddSelect {
file_ids: Vec<FileId>,
},
2026-10-03 16:40:17 +02:00
SelectAll,
2026-10-03 17:42:26 +02:00
/// Moves the files to `index` among the other files, in the given order. Not undoable.
Reorder {
file_ids: Vec<FileId>,
index: usize,
},
2026-10-03 16:40:17 +02:00
}