use wayscriber::config::keybindings::KeybindingsConfig;

use super::KeybindingField;

impl KeybindingField {
    pub(in crate::models::keybindings) fn get<'a>(
        &self,
        config: &'a KeybindingsConfig,
    ) -> &'a Vec<String> {
        match self {
            Self::Exit => &config.core.exit,
            Self::EnterTextMode => &config.core.enter_text_mode,
            Self::EnterStickyNoteMode => &config.core.enter_sticky_note_mode,
            Self::ClearCanvas => &config.core.clear_canvas,
            Self::Undo => &config.core.undo,
            Self::Redo => &config.core.redo,
            Self::UndoAll => &config.core.undo_all,
            Self::RedoAll => &config.core.redo_all,
            Self::UndoAllDelayed => &config.core.undo_all_delayed,
            Self::RedoAllDelayed => &config.core.redo_all_delayed,
            Self::DuplicateSelection => &config.selection.duplicate_selection,
            Self::CopySelection => &config.selection.copy_selection,
            Self::PasteSelection => &config.selection.paste_selection,
            Self::SelectAll => &config.selection.select_all,
            Self::MoveSelectionToFront => &config.selection.move_selection_to_front,
            Self::MoveSelectionToBack => &config.selection.move_selection_to_back,
            Self::NudgeSelectionUp => &config.selection.nudge_selection_up,
            Self::NudgeSelectionDown => &config.selection.nudge_selection_down,
            Self::NudgeSelectionLeft => &config.selection.nudge_selection_left,
            Self::NudgeSelectionRight => &config.selection.nudge_selection_right,
            Self::NudgeSelectionUpLarge => &config.selection.nudge_selection_up_large,
            Self::NudgeSelectionDownLarge => &config.selection.nudge_selection_down_large,
            Self::MoveSelectionToStart => &config.selection.move_selection_to_start,
            Self::MoveSelectionToEnd => &config.selection.move_selection_to_end,
            Self::MoveSelectionToTop => &config.selection.move_selection_to_top,
            Self::MoveSelectionToBottom => &config.selection.move_selection_to_bottom,
            Self::DeleteSelection => &config.selection.delete_selection,
            Self::IncreaseThickness => &config.tools.increase_thickness,
            Self::DecreaseThickness => &config.tools.decrease_thickness,
            Self::IncreaseMarkerOpacity => &config.tools.increase_marker_opacity,
            Self::DecreaseMarkerOpacity => &config.tools.decrease_marker_opacity,
            Self::SelectSelectionTool => &config.tools.select_selection_tool,
            Self::SelectPenTool => &config.tools.select_pen_tool,
            Self::SelectEraserTool => &config.tools.select_eraser_tool,
            Self::ToggleEraserMode => &config.tools.toggle_eraser_mode,
            Self::SelectMarkerTool => &config.tools.select_marker_tool,
            Self::SelectLineTool => &config.tools.select_line_tool,
            Self::SelectRectTool => &config.tools.select_rect_tool,
            Self::SelectEllipseTool => &config.tools.select_ellipse_tool,
            Self::SelectArrowTool => &config.tools.select_arrow_tool,
            Self::SelectHighlightTool => &config.tools.select_highlight_tool,
            Self::IncreaseFontSize => &config.tools.increase_font_size,
            Self::DecreaseFontSize => &config.tools.decrease_font_size,
            Self::ToggleWhiteboard => &config.board.toggle_whiteboard,
            Self::ToggleBlackboard => &config.board.toggle_blackboard,
            Self::ReturnToTransparent => &config.board.return_to_transparent,
            Self::PagePrev => &config.board.page_prev,
            Self::PageNext => &config.board.page_next,
            Self::PageNew => &config.board.page_new,
            Self::PageDuplicate => &config.board.page_duplicate,
            Self::PageDelete => &config.board.page_delete,
            Self::Board1 => &config.board.board_1,
            Self::Board2 => &config.board.board_2,
            Self::Board3 => &config.board.board_3,
            Self::Board4 => &config.board.board_4,
            Self::Board5 => &config.board.board_5,
            Self::Board6 => &config.board.board_6,
            Self::Board7 => &config.board.board_7,
            Self::Board8 => &config.board.board_8,
            Self::Board9 => &config.board.board_9,
            Self::BoardNext => &config.board.board_next,
            Self::BoardPrev => &config.board.board_prev,
            Self::BoardNew => &config.board.board_new,
            Self::BoardDuplicate => &config.board.board_duplicate,
            Self::BoardDelete => &config.board.board_delete,
            Self::BoardPicker => &config.board.board_picker,
            Self::ToggleHelp => &config.ui.toggle_help,
            Self::ToggleQuickHelp => &config.ui.toggle_quick_help,
            Self::ToggleStatusBar => &config.ui.toggle_status_bar,
            Self::ToggleClickHighlight => &config.ui.toggle_click_highlight,
            Self::ToggleToolbar => &config.ui.toggle_toolbar,
            Self::TogglePresenterMode => &config.ui.toggle_presenter_mode,
            Self::ToggleFill => &config.ui.toggle_fill,
            Self::ToggleHighlightTool => &config.tools.toggle_highlight_tool,
            Self::ToggleSelectionProperties => &config.ui.toggle_selection_properties,
            Self::OpenContextMenu => &config.ui.open_context_menu,
            Self::OpenConfigurator => &config.ui.open_configurator,
            Self::ToggleCommandPalette => &config.ui.toggle_command_palette,
            Self::SetColorRed => &config.colors.set_color_red,
            Self::SetColorGreen => &config.colors.set_color_green,
            Self::SetColorBlue => &config.colors.set_color_blue,
            Self::SetColorYellow => &config.colors.set_color_yellow,
            Self::SetColorOrange => &config.colors.set_color_orange,
            Self::SetColorPink => &config.colors.set_color_pink,
            Self::SetColorWhite => &config.colors.set_color_white,
            Self::SetColorBlack => &config.colors.set_color_black,
            Self::CaptureFullScreen => &config.capture.capture_full_screen,
            Self::CaptureActiveWindow => &config.capture.capture_active_window,
            Self::CaptureSelection => &config.capture.capture_selection,
            Self::CaptureClipboardFull => &config.capture.capture_clipboard_full,
            Self::CaptureFileFull => &config.capture.capture_file_full,
            Self::CaptureClipboardSelection => &config.capture.capture_clipboard_selection,
            Self::CaptureFileSelection => &config.capture.capture_file_selection,
            Self::CaptureClipboardRegion => &config.capture.capture_clipboard_region,
            Self::CaptureFileRegion => &config.capture.capture_file_region,
            Self::OpenCaptureFolder => &config.capture.open_capture_folder,
            Self::ToggleFrozenMode => &config.zoom.toggle_frozen_mode,
            Self::ZoomIn => &config.zoom.zoom_in,
            Self::ZoomOut => &config.zoom.zoom_out,
            Self::ResetZoom => &config.zoom.reset_zoom,
            Self::ToggleZoomLock => &config.zoom.toggle_zoom_lock,
            Self::RefreshZoomCapture => &config.zoom.refresh_zoom_capture,
            Self::ResetArrowLabels => &config.tools.reset_arrow_labels,
            Self::ApplyPreset1 => &config.presets.apply_preset_1,
            Self::ApplyPreset2 => &config.presets.apply_preset_2,
            Self::ApplyPreset3 => &config.presets.apply_preset_3,
            Self::ApplyPreset4 => &config.presets.apply_preset_4,
            Self::ApplyPreset5 => &config.presets.apply_preset_5,
            Self::SavePreset1 => &config.presets.save_preset_1,
            Self::SavePreset2 => &config.presets.save_preset_2,
            Self::SavePreset3 => &config.presets.save_preset_3,
            Self::SavePreset4 => &config.presets.save_preset_4,
            Self::SavePreset5 => &config.presets.save_preset_5,
            Self::ClearPreset1 => &config.presets.clear_preset_1,
            Self::ClearPreset2 => &config.presets.clear_preset_2,
            Self::ClearPreset3 => &config.presets.clear_preset_3,
            Self::ClearPreset4 => &config.presets.clear_preset_4,
            Self::ClearPreset5 => &config.presets.clear_preset_5,
        }
    }

    pub(in crate::models::keybindings) fn set(
        &self,
        config: &mut KeybindingsConfig,
        value: Vec<String>,
    ) {
        match self {
            Self::Exit => config.core.exit = value,
            Self::EnterTextMode => config.core.enter_text_mode = value,
            Self::EnterStickyNoteMode => config.core.enter_sticky_note_mode = value,
            Self::ClearCanvas => config.core.clear_canvas = value,
            Self::Undo => config.core.undo = value,
            Self::Redo => config.core.redo = value,
            Self::UndoAll => config.core.undo_all = value,
            Self::RedoAll => config.core.redo_all = value,
            Self::UndoAllDelayed => config.core.undo_all_delayed = value,
            Self::RedoAllDelayed => config.core.redo_all_delayed = value,
            Self::DuplicateSelection => config.selection.duplicate_selection = value,
            Self::CopySelection => config.selection.copy_selection = value,
            Self::PasteSelection => config.selection.paste_selection = value,
            Self::SelectAll => config.selection.select_all = value,
            Self::MoveSelectionToFront => config.selection.move_selection_to_front = value,
            Self::MoveSelectionToBack => config.selection.move_selection_to_back = value,
            Self::NudgeSelectionUp => config.selection.nudge_selection_up = value,
            Self::NudgeSelectionDown => config.selection.nudge_selection_down = value,
            Self::NudgeSelectionLeft => config.selection.nudge_selection_left = value,
            Self::NudgeSelectionRight => config.selection.nudge_selection_right = value,
            Self::NudgeSelectionUpLarge => config.selection.nudge_selection_up_large = value,
            Self::NudgeSelectionDownLarge => config.selection.nudge_selection_down_large = value,
            Self::MoveSelectionToStart => config.selection.move_selection_to_start = value,
            Self::MoveSelectionToEnd => config.selection.move_selection_to_end = value,
            Self::MoveSelectionToTop => config.selection.move_selection_to_top = value,
            Self::MoveSelectionToBottom => config.selection.move_selection_to_bottom = value,
            Self::DeleteSelection => config.selection.delete_selection = value,
            Self::IncreaseThickness => config.tools.increase_thickness = value,
            Self::DecreaseThickness => config.tools.decrease_thickness = value,
            Self::IncreaseMarkerOpacity => config.tools.increase_marker_opacity = value,
            Self::DecreaseMarkerOpacity => config.tools.decrease_marker_opacity = value,
            Self::SelectSelectionTool => config.tools.select_selection_tool = value,
            Self::SelectPenTool => config.tools.select_pen_tool = value,
            Self::SelectEraserTool => config.tools.select_eraser_tool = value,
            Self::ToggleEraserMode => config.tools.toggle_eraser_mode = value,
            Self::SelectMarkerTool => config.tools.select_marker_tool = value,
            Self::SelectLineTool => config.tools.select_line_tool = value,
            Self::SelectRectTool => config.tools.select_rect_tool = value,
            Self::SelectEllipseTool => config.tools.select_ellipse_tool = value,
            Self::SelectArrowTool => config.tools.select_arrow_tool = value,
            Self::SelectHighlightTool => config.tools.select_highlight_tool = value,
            Self::IncreaseFontSize => config.tools.increase_font_size = value,
            Self::DecreaseFontSize => config.tools.decrease_font_size = value,
            Self::ToggleWhiteboard => config.board.toggle_whiteboard = value,
            Self::ToggleBlackboard => config.board.toggle_blackboard = value,
            Self::ReturnToTransparent => config.board.return_to_transparent = value,
            Self::PagePrev => config.board.page_prev = value,
            Self::PageNext => config.board.page_next = value,
            Self::PageNew => config.board.page_new = value,
            Self::PageDuplicate => config.board.page_duplicate = value,
            Self::PageDelete => config.board.page_delete = value,
            Self::Board1 => config.board.board_1 = value,
            Self::Board2 => config.board.board_2 = value,
            Self::Board3 => config.board.board_3 = value,
            Self::Board4 => config.board.board_4 = value,
            Self::Board5 => config.board.board_5 = value,
            Self::Board6 => config.board.board_6 = value,
            Self::Board7 => config.board.board_7 = value,
            Self::Board8 => config.board.board_8 = value,
            Self::Board9 => config.board.board_9 = value,
            Self::BoardNext => config.board.board_next = value,
            Self::BoardPrev => config.board.board_prev = value,
            Self::BoardNew => config.board.board_new = value,
            Self::BoardDuplicate => config.board.board_duplicate = value,
            Self::BoardDelete => config.board.board_delete = value,
            Self::BoardPicker => config.board.board_picker = value,
            Self::ToggleHelp => config.ui.toggle_help = value,
            Self::ToggleQuickHelp => config.ui.toggle_quick_help = value,
            Self::ToggleStatusBar => config.ui.toggle_status_bar = value,
            Self::ToggleClickHighlight => config.ui.toggle_click_highlight = value,
            Self::ToggleToolbar => config.ui.toggle_toolbar = value,
            Self::TogglePresenterMode => config.ui.toggle_presenter_mode = value,
            Self::ToggleFill => config.ui.toggle_fill = value,
            Self::ToggleHighlightTool => config.tools.toggle_highlight_tool = value,
            Self::ToggleSelectionProperties => config.ui.toggle_selection_properties = value,
            Self::OpenContextMenu => config.ui.open_context_menu = value,
            Self::OpenConfigurator => config.ui.open_configurator = value,
            Self::ToggleCommandPalette => config.ui.toggle_command_palette = value,
            Self::SetColorRed => config.colors.set_color_red = value,
            Self::SetColorGreen => config.colors.set_color_green = value,
            Self::SetColorBlue => config.colors.set_color_blue = value,
            Self::SetColorYellow => config.colors.set_color_yellow = value,
            Self::SetColorOrange => config.colors.set_color_orange = value,
            Self::SetColorPink => config.colors.set_color_pink = value,
            Self::SetColorWhite => config.colors.set_color_white = value,
            Self::SetColorBlack => config.colors.set_color_black = value,
            Self::CaptureFullScreen => config.capture.capture_full_screen = value,
            Self::CaptureActiveWindow => config.capture.capture_active_window = value,
            Self::CaptureSelection => config.capture.capture_selection = value,
            Self::CaptureClipboardFull => config.capture.capture_clipboard_full = value,
            Self::CaptureFileFull => config.capture.capture_file_full = value,
            Self::CaptureClipboardSelection => config.capture.capture_clipboard_selection = value,
            Self::CaptureFileSelection => config.capture.capture_file_selection = value,
            Self::CaptureClipboardRegion => config.capture.capture_clipboard_region = value,
            Self::CaptureFileRegion => config.capture.capture_file_region = value,
            Self::OpenCaptureFolder => config.capture.open_capture_folder = value,
            Self::ToggleFrozenMode => config.zoom.toggle_frozen_mode = value,
            Self::ZoomIn => config.zoom.zoom_in = value,
            Self::ZoomOut => config.zoom.zoom_out = value,
            Self::ResetZoom => config.zoom.reset_zoom = value,
            Self::ToggleZoomLock => config.zoom.toggle_zoom_lock = value,
            Self::RefreshZoomCapture => config.zoom.refresh_zoom_capture = value,
            Self::ResetArrowLabels => config.tools.reset_arrow_labels = value,
            Self::ApplyPreset1 => config.presets.apply_preset_1 = value,
            Self::ApplyPreset2 => config.presets.apply_preset_2 = value,
            Self::ApplyPreset3 => config.presets.apply_preset_3 = value,
            Self::ApplyPreset4 => config.presets.apply_preset_4 = value,
            Self::ApplyPreset5 => config.presets.apply_preset_5 = value,
            Self::SavePreset1 => config.presets.save_preset_1 = value,
            Self::SavePreset2 => config.presets.save_preset_2 = value,
            Self::SavePreset3 => config.presets.save_preset_3 = value,
            Self::SavePreset4 => config.presets.save_preset_4 = value,
            Self::SavePreset5 => config.presets.save_preset_5 = value,
            Self::ClearPreset1 => config.presets.clear_preset_1 = value,
            Self::ClearPreset2 => config.presets.clear_preset_2 = value,
            Self::ClearPreset3 => config.presets.clear_preset_3 = value,
            Self::ClearPreset4 => config.presets.clear_preset_4 = value,
            Self::ClearPreset5 => config.presets.clear_preset_5 = value,
        }
    }
}
