Refactor new editor boundaries and test ownership
This commit is contained in:
53
new_editor/app/Composition/EditorWindowWorkspaceStore.h
Normal file
53
new_editor/app/Composition/EditorWindowWorkspaceStore.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#pragma once
|
||||
|
||||
#include <XCEditor/Workspace/UIEditorWindowWorkspaceController.h>
|
||||
#include <XCEditor/Workspace/UIEditorWorkspaceController.h>
|
||||
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
namespace XCEngine::UI::Editor::App::Internal {
|
||||
|
||||
class EditorWindowWorkspaceStore final {
|
||||
public:
|
||||
explicit EditorWindowWorkspaceStore(UIEditorPanelRegistry panelRegistry);
|
||||
|
||||
const UIEditorPanelRegistry& GetPanelRegistry() const {
|
||||
return m_panelRegistry;
|
||||
}
|
||||
|
||||
bool HasState() const {
|
||||
return !m_windowSet.windows.empty();
|
||||
}
|
||||
|
||||
const UIEditorWindowWorkspaceSet& GetWindowSet() const {
|
||||
return m_windowSet;
|
||||
}
|
||||
|
||||
UIEditorWindowWorkspaceController BuildMutationController() const;
|
||||
|
||||
bool RegisterWindowProjection(
|
||||
std::string_view windowId,
|
||||
bool primary,
|
||||
const UIEditorWorkspaceController& workspaceController,
|
||||
std::string& outError);
|
||||
|
||||
bool CommitWindowProjection(
|
||||
std::string_view windowId,
|
||||
const UIEditorWorkspaceController& workspaceController,
|
||||
std::string& outError);
|
||||
|
||||
bool ValidateWindowSet(
|
||||
const UIEditorWindowWorkspaceSet& windowSet,
|
||||
std::string& outError) const;
|
||||
|
||||
void ReplaceWindowSet(UIEditorWindowWorkspaceSet windowSet);
|
||||
|
||||
void RemoveWindow(std::string_view windowId, bool primary);
|
||||
|
||||
private:
|
||||
UIEditorPanelRegistry m_panelRegistry = {};
|
||||
UIEditorWindowWorkspaceSet m_windowSet = {};
|
||||
};
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App::Internal
|
||||
Reference in New Issue
Block a user