use serde::{Deserialize, Serialize};

#[derive(
    Debug,
    Clone,
    Copy,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    Serialize,
    Deserialize,
    strum::EnumIter,
)]
#[serde(rename_all = "snake_case")]
pub enum ListAction {
    MoveUp,
    MoveDown,
    MoveLeft,
    MoveRight,
    Open,
    Delete,
    Quit,
    Help,
    OpenLocation,
    CycleFocus,
    ReverseCycleFocus,
    Confirm,
    Cancel,
    ToggleExternalEditor,
    NewFromTemplate,
    CreateFolder,
    CreateNote,
    RenameFolder,
    MoveNote,
    MoveToParent,
    ManageTags,
    RemoveTagsFromSelected,
    CollapseFolder,
    ExpandFolder,
    OpenCommandPalette,

    Rename,
    Duplicate,
    TogglePin,
    CycleSort,
    Search,
    JumpToTop,
    JumpToBottom,
    PageUp,
    PageDown,
    OpenTrash,
    TogglePreview,
    TogglePreviewFullscreen,
    ToggleWrap,
    PreviewPageUp,
    PreviewPageDown,
    ToggleCalendar,
    OpenGraph,
    OpenCanvas,
    CreatePinstar,
    ToggleSelectMode,
    ToggleSelectItem,
    CollapseAll,
    ExpandAll,
    ExpandToLevel,
    ToggleFoldersFirst,
    RefreshNotes,
    ManageSubnotes,
    ShowInfo,
}

#[derive(
    Debug,
    Clone,
    Copy,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    Serialize,
    Deserialize,
    strum::EnumIter,
)]
#[serde(rename_all = "snake_case")]
pub enum EditAction {
    Back,
    CycleFocus,
    InsertTab,

    SelectAll,
    Copy,
    Cut,
    Paste,
    Undo,
    Redo,
    DeleteWord,
    DeleteNextWord,
    MoveToTop,
    MoveToBottom,
    ToggleMarkdownPreview,
    TogglePreviewFullscreen,
    ToggleWrap,
    PreviewPageUp,
    PreviewPageDown,
    ManageSubnotes,
    PasteImage,
    InsertImageFromFile,
    Find,
    InsertDate,
    ToggleOutline,
    ToggleLinks,
    PreviewLink,
    GoToLine,
}

#[derive(
    Debug,
    Clone,
    Copy,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    Serialize,
    Deserialize,
    strum::EnumIter,
)]
#[serde(rename_all = "snake_case")]
pub enum HelpAction {
    Close,
    ScrollUp,
    ScrollDown,
    NextTab,
    PrevTab,
    Search,
    Reroll,
}

#[derive(
    Debug,
    Clone,
    Copy,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    Serialize,
    Deserialize,
    strum::EnumIter,
)]
#[serde(rename_all = "snake_case")]
pub enum GraphAction {
    Quit,
    PanUp,
    PanDown,
    PanLeft,
    PanRight,
    ZoomIn,
    ZoomOut,
    OpenNote,
    AutoFit,
    Help,
    ToggleSearch,
    ToggleMinimap,
    ToggleLegend,
    ToggleGrid,
    ToggleStatus,
    Refresh,
    ReloadConfig,
    TogglePreview,
}

#[derive(
    Debug,
    Clone,
    Copy,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    Serialize,
    Deserialize,
    strum::EnumIter,
)]
#[serde(rename_all = "snake_case")]
pub enum DrawAction {
    Quit,
    Help,
    SelectDrawTool,
    ToggleShapeSelector,
    SelectTextTool,
    SelectEraseTool,
    ShapeSelectorUp,
    ShapeSelectorDown,
    ShapeSelectorConfirm,
    ShapeSelectorCancel,
    TextEditorConfirm,
    TextEditorCancel,
    ToggleGrid,
}

#[derive(
    Debug,
    Clone,
    Copy,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    Serialize,
    Deserialize,
    strum::EnumIter,
)]
#[serde(rename_all = "snake_case")]
pub enum CanvasAction {
    Quit,
    Save,
    ZoomFineIn,
    ZoomFineOut,
    ZoomIn,
    ZoomOut,
    MoveLeft,
    MoveRight,
    MoveUp,
    MoveDown,
    EditOrConnect,
    OpenContextMenu,
    ToggleGrid,
    ToggleEditorPane,
    CycleFocus,
    Help,
    RenameConfirm,
    RenameCancel,
    MenuClose,
    MenuUp,
    MenuDown,
    MenuSelect,
    CloseEditor,
    CloseEditorAlt,
    ConfirmResize,
    CancelResize,
    EditorUnfocus,
    EditorSyncRaw,
}

#[derive(
    Debug,
    Clone,
    Copy,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    Serialize,
    Deserialize,
    strum::EnumIter,
)]
#[serde(rename_all = "snake_case")]
pub enum BackupAction {
    Back,
    MoveDown,
    MoveUp,
    ScrollDiffDown,
    ScrollDiffUp,
    Refresh,
    EnterCommit,
    Push,
    OpenSettings,
    CycleSection,
    CancelCommit,
    ConfirmCommit,
    CloseSettings,
    NextField,
    PrevField,
    ActivateField,
    CancelEditField,
    ConfirmEditField,
    Help,
    Pull,
    StageFile,
    UnstageFile,
    StageAll,
}

#[derive(
    Debug,
    Clone,
    Copy,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    Serialize,
    Deserialize,
    strum::EnumIter,
)]
#[serde(rename_all = "snake_case")]
pub enum OutlineAction {
    MoveUp,
    MoveDown,
    ToggleCollapse,
    ExpandAll,
    CollapseAll,
    Open,
    Back,
    Help,
}

#[derive(
    Debug,
    Clone,
    Copy,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    Serialize,
    Deserialize,
    strum::EnumIter,
)]
#[serde(rename_all = "snake_case")]
pub enum SetupAction {
    Up,
    Down,
    CycleNext,
    CyclePrev,
    Activate,
    Finish,
}
