yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
menu_orchestrator.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_MENU_MENU_ORCHESTRATOR_H_
2#define YAZE_APP_EDITOR_MENU_MENU_ORCHESTRATOR_H_
3
4#include <functional>
5#include <string>
6
7#include "absl/status/status.h"
8#include "app/editor/editor.h"
13
14namespace yaze {
15namespace editor {
16
17// Forward declarations to avoid circular dependencies
18class EditorManager;
19class RomFileManager;
20class ProjectManager;
21class EditorRegistry;
22class PanelManager;
23class SessionCoordinator;
24class ToastManager;
25class PopupManager;
26
43 public:
44 // Constructor takes references to the managers it coordinates with
45 MenuOrchestrator(EditorManager* editor_manager, MenuBuilder& menu_builder,
46 RomFileManager& rom_manager, ProjectManager& project_manager,
47 EditorRegistry& editor_registry,
48 SessionCoordinator& session_coordinator,
49 ToastManager& toast_manager, PopupManager& popup_manager);
50 ~MenuOrchestrator() = default;
51
52 // Set optional dependencies for advanced features
53 void SetPanelManager(PanelManager* manager) { panel_manager_ = manager; }
54 void SetStatusBar(StatusBar* bar) { status_bar_ = bar; }
55 void SetUserSettings(UserSettings* settings) { user_settings_ = settings; }
56
57 // Non-copyable due to reference members
60
61 // Main menu building interface
62 void BuildMainMenu();
63 void BuildFileMenu();
64 void BuildEditMenu();
65 void BuildViewMenu();
66 void BuildToolsMenu(); // Also contains former Debug menu items
67 void BuildWindowMenu();
68 void BuildHelpMenu();
69
70 // Menu state management
71 void ClearMenu();
72 void RefreshMenu();
73
74 // Menu item callbacks (delegated to appropriate managers)
75 void OnOpenRom();
76 void OnSaveRom();
77 void OnSaveRomAs();
78 void OnCreateProject();
79 void OnOpenProject();
80 void OnSaveProject();
81 void OnSaveProjectAs();
84
85 // Edit menu actions (delegate to current editor)
86 void OnUndo();
87 void OnRedo();
88 void OnCut();
89 void OnCopy();
90 void OnPaste();
91 void OnFind();
92
93 // Editor-specific menu actions
94 void OnSwitchToEditor(EditorType editor_type);
96 void OnShowDisplaySettings(); // Display settings popup
97 void OnShowHexEditor();
98 void OnShowEmulator();
99 void OnShowPanelBrowser();
100 void OnShowWelcomeScreen();
101
102#ifdef YAZE_BUILD_AGENT_UI
103 void OnShowAIAgent();
104 void OnShowChatHistory();
105 void OnShowProposalDrawer();
106#endif
107
108 // Session management menu actions
109 void OnCreateNewSession();
112 void OnSwitchToSession(size_t session_index);
115
116 // Window management menu actions
117 void OnShowAllWindows();
118 void OnHideAllWindows();
122 void OnShowLayoutPresets();
125 void OnLoadModderLayout();
126
127 // Tool menu actions
128 void OnShowGlobalSearch();
131 void OnShowImGuiDemo();
132 void OnShowImGuiMetrics();
133 void OnShowMemoryEditor();
135
136 // ROM Analysis menu actions
137 void OnShowRomInfo();
138 void OnCreateBackup();
139 void OnValidateRom();
141 void OnTestSaveLoad();
142
143 // ZSCustomOverworld menu actions
144 void OnCheckRomVersion();
145 void OnUpgradeRom();
147
148 // Asar Integration menu actions
149 void OnToggleAsarPatch();
150 void OnLoadAsmFile();
151
152 // Editor launch actions
154
155#ifdef YAZE_ENABLE_TESTING
156 void OnShowTestDashboard();
157 void OnRunAllTests();
158 void OnRunUnitTests();
159 void OnRunIntegrationTests();
160 void OnRunE2ETests();
161#endif
162
163#ifdef YAZE_WITH_GRPC
164 void OnStartCollaboration();
165 void OnJoinCollaboration();
166 void OnShowNetworkStatus();
167#endif
168
169 // Help menu actions
170 void OnShowAbout();
176 void OnShowCLIUsage();
178 void OnShowContributing();
179 void OnShowWhatsNew();
181
182 // Additional File menu actions
183 void OnShowSettings();
184 void OnQuit();
185
186 private:
187 // References to coordinated managers
196
197 // Optional dependencies for advanced features
201
202 // Menu state
204
205 // Helper methods for menu construction
206 void AddFileMenuItems();
207 void AddEditMenuItems();
208 void AddViewMenuItems();
209 void AddToolsMenuItems(); // Also contains former Debug menu items
210 void AddWindowMenuItems();
211 void AddHelpMenuItems();
212
213 // Auto-generated menu helpers
214 void AddPanelsSubmenu();
215
216 // Menu item validation helpers
217 bool CanSaveRom() const;
218 bool CanSaveProject() const;
219 bool HasActiveRom() const;
220 bool HasActiveProject() const;
221 bool HasProjectFile() const;
222 bool HasCurrentEditor() const;
223 bool HasMultipleSessions() const;
224
225 // Menu item text generation
226 std::string GetRomFilename() const;
227 std::string GetProjectName() const;
228 std::string GetCurrentEditorName() const;
229
230 // Shortcut key management
231 std::string GetShortcutForAction(const std::string& action) const;
233};
234
235} // namespace editor
236} // namespace yaze
237
238#endif // YAZE_APP_EDITOR_MENU_MENU_ORCHESTRATOR_H_
The EditorManager controls the main editor window and manages the various editor classes.
Manages editor types, categories, and lifecycle.
Fluent interface for building ImGui menus with icons.
Handles all menu building and UI coordination logic.
void OnSwitchToSession(size_t session_index)
void SetUserSettings(UserSettings *settings)
void OnSwitchToEditor(EditorType editor_type)
SessionCoordinator & session_coordinator_
void SetStatusBar(StatusBar *bar)
MenuOrchestrator & operator=(const MenuOrchestrator &)=delete
void SetPanelManager(PanelManager *manager)
MenuOrchestrator(EditorManager *editor_manager, MenuBuilder &menu_builder, RomFileManager &rom_manager, ProjectManager &project_manager, EditorRegistry &editor_registry, SessionCoordinator &session_coordinator, ToastManager &toast_manager, PopupManager &popup_manager)
std::string GetShortcutForAction(const std::string &action) const
MenuOrchestrator(const MenuOrchestrator &)=delete
Central registry for all editor cards with session awareness and dependency injection.
Handles all project file operations with ROM-first workflow.
Handles all ROM file I/O operations.
High-level orchestrator for multi-session UI.
A session-aware status bar displayed at the bottom of the application.
Definition status_bar.h:38
Manages user preferences and settings persistence.