20#include <mlUndoContext.h>
63 void openGroup(
const std::string& description =
"Contour Operation");
117 static void _undoContextCB(
void* userData,
BaseEvent* event);
120 int _currentGroupDepth;
126 ml::UndoContextPtr _undoContext;
129 ml::UndoContextPtr _defaultUndoContext;
#define MLCSO_EXPORT
Defines export symbols for classes, so they can be used in other DLLs.
Base class for a CSOCommand for the undo/redo mechanism.
bool isInRedoMode() const
Returns whether the manager is in redo mode.
bool canRedo() const
Returns whether there are possible redos.
void openGroup(const std::string &description="Contour Operation")
Opens a group of commands that are undone/redone as one.
UNDO_MODE
The undo (and redo) modes.
@ MODE_REDOING
The manager is in redo mode.
@ MODE_UNDOING
The manager is in undo mode.
@ MODE_NORMAL
The manager is no special mode and pushes commands onto the undo stack.
int numUndos() const
Returns the number of stored undo steps.
CSOUndoRedoManager(CSOList *csoList)
Constructor.
void clearAll()
Clears the undo and redo stack.
void enableUndoRedo()
Enables this undo/redo manager.
void closeGroup()
Closes a group of commands that are undone/redone as one.
bool isEnabled()
Returns whether this undo/redo manager is currently enabled.
void closeAllGroups()
Closes all undo/redo groups.
void undo()
Performs an undo of the last modification (if undo stack is not empty).
int maxNumUndos() const
Returns the maximum number of possible undos. If a -1 is returned, the undo stack has no limitation.
void redo()
Performs a redo (if the undo stack is not empty).
int getCurrentUndoGroupDepth()
bool isInUndoMode() const
Returns whether the manager is in undo mode.
void setUndoContext(ml::UndoContextPtr undoContext)
Sets a new undo context.
void setMaxNumUndos(MLint newMaxNumUndos)
void setMaxNumUndos(int newMaxNumUndos)
Sets the maximum number of possible undos. If a -1 is passed, the undo stack has no limitation.
~CSOUndoRedoManager()
Destructor.
int numRedos() const
Returns the number of stored redo steps.
bool canUndo() const
Returns whether there are possible undos.
void addCommand(CSOCommand *command)