Files
XCEngine/editor/src/Core/IUndoManager.h
ssdfasd 5c3566774b docs: 更新 containers 和 threading 模块文档
- containers: 更新 string 类的多个方法文档
- threading: 更新 mutex 和 task-group 方法文档
2026-03-26 01:59:14 +08:00

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