55 lines
2.0 KiB
C++
55 lines
2.0 KiB
C++
#pragma once
|
|
|
|
#include "Composition/EditorEditCommandRoute.h"
|
|
#include "State/EditorSession.h"
|
|
|
|
#include <XCEditor/Foundation/UIEditorCommandDispatcher.h>
|
|
|
|
#include <functional>
|
|
#include <string_view>
|
|
|
|
namespace XCEngine::UI::Editor::App {
|
|
|
|
class EditorHostCommandBridge : public UIEditorHostCommandHandler {
|
|
public:
|
|
void BindSession(EditorSession& session);
|
|
void BindEditCommandRoutes(
|
|
EditorEditCommandRoute* hierarchyRoute,
|
|
EditorEditCommandRoute* projectRoute);
|
|
void SetExitRequestHandler(std::function<void()> handler);
|
|
|
|
UIEditorHostCommandEvaluationResult EvaluateHostCommand(
|
|
std::string_view commandId) const override;
|
|
UIEditorHostCommandDispatchResult DispatchHostCommand(
|
|
std::string_view commandId) override;
|
|
|
|
private:
|
|
UIEditorHostCommandEvaluationResult BuildDisabledResult(
|
|
std::string_view message) const;
|
|
UIEditorHostCommandEvaluationResult BuildExecutableResult(
|
|
std::string_view message) const;
|
|
UIEditorHostCommandEvaluationResult EvaluateFileCommand(
|
|
std::string_view commandId) const;
|
|
UIEditorHostCommandEvaluationResult EvaluateAssetCommand(
|
|
std::string_view commandId) const;
|
|
UIEditorHostCommandEvaluationResult EvaluateRunCommand(
|
|
std::string_view commandId) const;
|
|
UIEditorHostCommandEvaluationResult EvaluateScriptCommand(
|
|
std::string_view commandId) const;
|
|
UIEditorHostCommandEvaluationResult EvaluateEditCommand(
|
|
std::string_view commandId) const;
|
|
UIEditorHostCommandDispatchResult DispatchEditCommand(
|
|
std::string_view commandId);
|
|
UIEditorHostCommandEvaluationResult EvaluateUnsupportedHostCommand(
|
|
std::string_view commandId) const;
|
|
EditorEditCommandRoute* ResolveEditCommandRoute(EditorActionRoute route) const;
|
|
|
|
EditorSession* m_session = nullptr;
|
|
EditorEditCommandRoute* m_hierarchyRoute = nullptr;
|
|
EditorEditCommandRoute* m_projectRoute = nullptr;
|
|
std::function<void()> m_requestExit = {};
|
|
};
|
|
|
|
} // namespace XCEngine::UI::Editor::App
|
|
|