#pragma once #include #include #include #include #include namespace XCEngine::UI::Editor { enum class UIEditorCommandPanelSource : std::uint8_t { None = 0, FixedPanelId, ActivePanel }; struct UIEditorWorkspaceCommandDescriptor { UIEditorWorkspaceCommandKind kind = UIEditorWorkspaceCommandKind::ActivatePanel; UIEditorCommandPanelSource panelSource = UIEditorCommandPanelSource::FixedPanelId; std::string panelId = {}; }; struct UIEditorCommandDescriptor { std::string commandId = {}; std::string displayName = {}; UIEditorWorkspaceCommandDescriptor workspaceCommand = {}; }; struct UIEditorCommandRegistry { std::vector commands = {}; }; enum class UIEditorCommandRegistryValidationCode : std::uint8_t { None = 0, EmptyCommandId, EmptyDisplayName, DuplicateCommandId, MissingPanelSource, MissingFixedPanelId, UnexpectedPanelSource }; struct UIEditorCommandRegistryValidationResult { UIEditorCommandRegistryValidationCode code = UIEditorCommandRegistryValidationCode::None; std::string message = {}; [[nodiscard]] bool IsValid() const { return code == UIEditorCommandRegistryValidationCode::None; } }; std::string_view GetUIEditorCommandPanelSourceName(UIEditorCommandPanelSource source); const UIEditorCommandDescriptor* FindUIEditorCommandDescriptor( const UIEditorCommandRegistry& registry, std::string_view commandId); UIEditorCommandRegistryValidationResult ValidateUIEditorCommandRegistry( const UIEditorCommandRegistry& registry); } // namespace XCEngine::UI::Editor