use crate::{FormatDiscoveryOp, RehearsalObservationOp};
use alux_sdk::trait_algebra;
use std::path::PathBuf;
use std::time::Duration;
#[trait_algebra(derive(Clone, Debug, PartialEq, Eq))]
pub trait TransferObservation {
fn pause_capability(&self, supported: bool);
fn started(&self);
fn elapsed(&self, elapsed: Duration);
fn progress(&self, destination: PathBuf, downloaded: u64, total: Option<u64>);
fn completed(&self, destination: PathBuf, bytes: u64);
fn failed(&self, destination: PathBuf, message: String);
fn program_failed(&self, summary: String, detail: String);
}
#[trait_algebra(derive(Clone, Debug, PartialEq, Eq))]
pub trait ManagerIntent {
type Id;
type Source;
type Format;
type Change;
fn add_sources(&self, requests: Vec<Self::Source>);
fn set_draft(&self, draft: String);
fn insert_text(&self, text: String);
fn set_output_draft(&self, draft: String);
fn set_input_draft(&self, draft: String);
fn source_metadata(&self, id: Self::Id, media_id: String, title: Option<String>);
fn format_catalog(&self, id: Self::Id, event: FormatDiscoveryOp<Self::Format>);
fn rehearsal(&self, id: Self::Id, event: RehearsalObservationOp<Self::Change>);
fn transfer(&self, id: Self::Id, event: TransferObservationOp);
fn open_add_sources(&self);
fn submit_draft(&self);
fn delete_before_cursor(&self);
fn delete_at_cursor(&self);
fn move_cursor_left(&self);
fn move_cursor_right(&self);
fn move_cursor_home(&self);
fn move_cursor_end(&self);
fn select_previous(&self);
fn select_next(&self);
fn open_selected(&self);
fn select_previous_detail(&self);
fn select_next_detail(&self);
fn activate_detail(&self);
fn open_formats(&self);
fn open_output(&self);
fn open_input(&self);
fn submit_input(&self);
fn open_report(&self);
fn toggle_dry_run(&self);
fn submit_output(&self);
fn back(&self);
fn apply_selected_space(&self);
fn select_previous_format(&self);
fn select_next_format(&self);
fn duplicate_selected(&self);
fn remove_selected(&self);
fn restart_selected(&self);
fn safe_exit_requested(&self);
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SpaceAction {
Start,
Rehearse,
Pause,
Resume,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ManagerPage<Id> {
Collection,
AddSources,
Details(Id),
Formats(Id),
Output(Id),
Input(Id),
Log(Id),
Report(Id),
Command(Id),
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DetailControl {
Input,
Output,
Format,
Command,
Restart,
Duplicate,
DryRun,
Report,
Log,
Delete,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Breadcrumb {
pub label: String,
}