18#ifndef UNDOREDOMANAGER_H
19#define UNDOREDOMANAGER_H
21#include "basemanager.h"
25#include "preferencesdef.h"
42enum class UndoRedoRecordType {
56 const qreal rotationAngle,
63 this->rotationAngle = rotationAngle;
64 this->scaleX = scaleX;
65 this->scaleY = scaleY;
66 this->translation = translation;
67 this->anchor = anchor;
71 qreal rotationAngle = 0.0;
82 Layer::LAYER_TYPE layerType = Layer::UNDEFINED;
84 std::unique_ptr<KeyFrame> keyframe =
nullptr;
85 std::unique_ptr<SelectionSaveState> selectionState =
nullptr;
87 UndoRedoRecordType recordType = UndoRedoRecordType::INVALID;
121 void updateUndoAction(
QAction* undoAction);
122 void updateRedoAction(
QAction* redoAction);
131 void legacyBackup(
const QString& undoText);
132 bool legacyBackup(
int backupLayer,
int backupFrame,
const QString& undoText);
144 void restoreLegacyKey();
146 void rememberLastModifiedFrame(
int layerNumber,
int frameNumber);
148 void onSettingChanged(SETTING setting);
151 void didUpdateUndoStack();
169 int mLegacyBackupIndex = -1;
173 int mLegacyLastModifiedLayer = -1;
174 int mLegacyLastModifiedFrame = -1;
176 bool mNewBackupSystemEnabled =
false;
void record(const UndoSaveState *&undoState, const QString &description)
Records the given save state.
bool hasUnsavedChanges() const
Checks whether there are unsaved changes.
void sanitizeLegacyBackupElementsAfterLayerDeletion(int layerIndex)
Restores integrity of the backup elements after a layer has been deleted.
void clearStack()
Clears the undo stack.
const UndoSaveState * state(UndoRedoRecordType recordType) const
Prepares and returns a save state with the given scope.
QObject * parent() const const
This is the main undo/redo state structure which is meant to populate whatever states that needs to b...