41 lines
1.0 KiB
C++
41 lines
1.0 KiB
C++
#pragma once
|
|
|
|
#include "SceneSnapshot.h"
|
|
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace XCEngine {
|
|
namespace Editor {
|
|
|
|
struct UndoStateSnapshot {
|
|
SceneSnapshot scene;
|
|
std::vector<uint64_t> selectionIds;
|
|
};
|
|
|
|
class IUndoManager {
|
|
public:
|
|
virtual ~IUndoManager() = default;
|
|
|
|
virtual void ClearHistory() = 0;
|
|
virtual bool CanUndo() const = 0;
|
|
virtual bool CanRedo() const = 0;
|
|
virtual const std::string& GetUndoLabel() const = 0;
|
|
virtual const std::string& GetRedoLabel() const = 0;
|
|
|
|
virtual void Undo() = 0;
|
|
virtual void Redo() = 0;
|
|
|
|
virtual UndoStateSnapshot CaptureCurrentState() const = 0;
|
|
virtual void PushCommand(const std::string& label, UndoStateSnapshot before, UndoStateSnapshot after) = 0;
|
|
|
|
virtual void BeginInteractiveChange(const std::string& label) = 0;
|
|
virtual bool HasPendingInteractiveChange() const = 0;
|
|
virtual void FinalizeInteractiveChange() = 0;
|
|
virtual void CancelInteractiveChange() = 0;
|
|
};
|
|
|
|
} // namespace Editor
|
|
} // namespace XCEngine
|