yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
command_palette_providers.h
Go to the documentation of this file.
1#ifndef YAZE_APP_EDITOR_SYSTEM_COMMAND_PALETTE_PROVIDERS_H_
2#define YAZE_APP_EDITOR_SYSTEM_COMMAND_PALETTE_PROVIDERS_H_
3
4#include <functional>
5#include <string>
6#include <vector>
7
9
10namespace yaze {
11namespace editor {
12
13class WorkspaceWindowManager;
14class RecentProjectsModel;
15class UserSettings;
16
28 public:
30 size_t session_id);
31 std::string ProviderId() const override { return "panels"; }
32 void Provide(CommandPalette* palette) override;
33
34 private:
37};
38
41 public:
43 std::function<void(const std::string&)> switch_callback);
44 std::string ProviderId() const override { return "editors"; }
45 void Provide(CommandPalette* palette) override;
46
47 private:
48 std::function<void(const std::string&)> switch_callback_;
49};
50
53 public:
55 std::function<void(const std::string&)> open_callback);
56 std::string ProviderId() const override { return "recent-files"; }
57 void Provide(CommandPalette* palette) override;
58
59 private:
60 std::function<void(const std::string&)> open_callback_;
61};
62
65 public:
66 explicit DungeonRoomCommandsProvider(size_t session_id);
67 std::string ProviderId() const override { return "dungeon-rooms"; }
68 void Provide(CommandPalette* palette) override;
69
70 private:
72};
73
76 public:
78 size_t session_id);
79 std::string ProviderId() const override { return "workflow"; }
80 void Provide(CommandPalette* palette) override;
81
82 private:
85};
86
92 public:
94 UserSettings* user_settings, size_t session_id);
95 std::string ProviderId() const override { return "sidebar"; }
96 void Provide(CommandPalette* palette) override;
97
98 private:
102};
103
108 public:
109 struct Callbacks {
110 const RecentProjectsModel* model = nullptr;
111 std::vector<std::string> template_names;
112 std::function<void(const std::string&)> remove;
113 std::function<void(const std::string&)> toggle_pin;
114 std::function<void()> undo_remove;
115 std::function<void()> clear_recents;
116 std::function<void(const std::string&)> create_from_template;
117 std::function<void()> dismiss_welcome;
118 std::function<void()> show_welcome;
119 };
120 explicit WelcomeCommandsProvider(Callbacks callbacks);
121 std::string ProviderId() const override { return "welcome"; }
122 void Provide(CommandPalette* palette) override;
123
124 private:
126};
127
128} // namespace editor
129} // namespace yaze
130
131#endif // YAZE_APP_EDITOR_SYSTEM_COMMAND_PALETTE_PROVIDERS_H_
Plug-in command source for the palette.
ID: "dungeon-rooms". One-shot; only depends on the session id.
std::string ProviderId() const override
Stable identifier. Used for selective refresh; must be unique.
void Provide(CommandPalette *palette) override
Populate palette with this source's commands.
ID: "editors". Rebuilds on editor-registry changes (rare).
void Provide(CommandPalette *palette) override
Populate palette with this source's commands.
EditorCommandsProvider(std::function< void(const std::string &)> switch_callback)
std::function< void(const std::string &) switch_callback_)
std::string ProviderId() const override
Stable identifier. Used for selective refresh; must be unique.
ID: "panels". Rebuilds when the set of open windows/panels changes.
void Provide(CommandPalette *palette) override
Populate palette with this source's commands.
PanelCommandsProvider(WorkspaceWindowManager *window_manager, size_t session_id)
std::string ProviderId() const override
Stable identifier. Used for selective refresh; must be unique.
ID: "recent-files". Refresh after RecentFilesManager mutates.
void Provide(CommandPalette *palette) override
Populate palette with this source's commands.
std::function< void(const std::string &) open_callback_)
std::string ProviderId() const override
Stable identifier. Used for selective refresh; must be unique.
RecentFilesCommandsProvider(std::function< void(const std::string &)> open_callback)
void Provide(CommandPalette *palette) override
Populate palette with this source's commands.
std::string ProviderId() const override
Stable identifier. Used for selective refresh; must be unique.
SidebarCommandsProvider(WorkspaceWindowManager *window_manager, UserSettings *user_settings, size_t session_id)
Manages user preferences and settings persistence.
void Provide(CommandPalette *palette) override
Populate palette with this source's commands.
std::string ProviderId() const override
Stable identifier. Used for selective refresh; must be unique.
ID: "workflow". Refresh when workflow actions change.
std::string ProviderId() const override
Stable identifier. Used for selective refresh; must be unique.
void Provide(CommandPalette *palette) override
Populate palette with this source's commands.
WorkflowCommandsProvider(WorkspaceWindowManager *window_manager, size_t session_id)
Central registry for all editor cards with session awareness and dependency injection.
std::function< void(const std::string &) toggle_pin)
std::function< void(const std::string &) remove)
std::function< void(const std::string &) create_from_template)