Class SBCUndoStack#
This class describes an undo stack.
#include "SBCUndoStack.hpp"
Public Functions#
Type | Name |
---|---|
SBCUndoStack () Constructors and destructors. |
|
SB_DECLARE_DATA (SBCUndoStack) |
|
void | beginHolding (const std::string & name) Begins holding. |
void | beginUndoCommandGroup (const std::string & name) Begins a new command group to the current command group. |
void | clear () Clears the stack. |
void | connectUndoSignalToSlot (SBCReferenceTarget * observer, void(SBCReferenceTarget::*)(SBCUndoEvent *) functionPointer) Connects the undo signal to the slot of the observer. |
void | disableHolding () Pauses holding. |
void | disableUndoRedo () Disables undo and redo. |
void | disconnectUndoSignalFromSlot (SBCReferenceTarget * observer, void(SBCReferenceTarget::*)(SBCUndoEvent *) functionPointer) Disconnects the undo signal to the slot of the observer. |
void | enableHolding () Resumes holding. |
void | enableUndoRedo () Enables undo and redo. |
void | endHolding () Ends holding. |
void | endUndoCommandGroup () Ends a new command group to the current command group. |
SBCContainerVector< SBCUndoCommand * > * | getCommandVector () const Returns a vector of undo commands. |
unsigned int | getDisablingUndoRedoCounter () Returns the counter for disabling undo and redo. |
unsigned int | getNextRedoIndex () const Returns the next redo index. |
void | hold (SBCUndoCommand * undoCommand) Adds a new command to the current command group. |
void | hold (void * object) Holds an object allocated on the heap. |
void | hold (SBPointerTarget * pointerTarget) Holds a pointer target allocated on the heap. |
void | holdArray (void * array) Holds an array allocated on the heap. |
bool | isHolding () const Storing commands. |
bool | isRedoing () const Returns true while redoing. |
bool | isUndoing () const Returns true while undoing. |
virtual void | print (unsigned int offset=0) const Prints debugging information. |
void | redo () Redo one command. |
void | undo () Undo and redo. |
bool | undoSignalIsConnectedToSlot (SBCReferenceTarget * observer, void(SBCReferenceTarget::*)(SBCUndoEvent *) functionPointer) const Returns whether the undo signal is connected to the slot of the observer. |
virtual | ~SBCUndoStack () Destructor. |
Protected Attributes#
Type | Name |
---|---|
SBCUndoStackData * | dataPointer A pointer to the private data. |
Public Functions Documentation#
function SBCUndoStack#
Constructors and destructors.
Default constructor
function SB_DECLARE_DATA#
function beginHolding#
Begins holding.
function beginUndoCommandGroup#
Begins a new command group to the current command group.
function clear#
Clears the stack.
function connectUndoSignalToSlot#
Connects the undo signal to the slot of the observer.
void SBCUndoStack::connectUndoSignalToSlot (
SBCReferenceTarget * observer,
void(SBCReferenceTarget::*)( SBCUndoEvent *) functionPointer
)
function disableHolding#
Pauses holding.
function disableUndoRedo#
Disables undo and redo.
function disconnectUndoSignalFromSlot#
Disconnects the undo signal to the slot of the observer.
void SBCUndoStack::disconnectUndoSignalFromSlot (
SBCReferenceTarget * observer,
void(SBCReferenceTarget::*)( SBCUndoEvent *) functionPointer
)
function enableHolding#
Resumes holding.
function enableUndoRedo#
Enables undo and redo.
function endHolding#
Ends holding.
function endUndoCommandGroup#
Ends a new command group to the current command group.
function getCommandVector#
Returns a vector of undo commands.
function getDisablingUndoRedoCounter#
Returns the counter for disabling undo and redo.
function getNextRedoIndex#
Returns the next redo index.
function hold [1/3]#
Adds a new command to the current command group.
function hold [2/3]#
Holds an object allocated on the heap.
function hold [3/3]#
Holds a pointer target allocated on the heap.
function holdArray#
Holds an array allocated on the heap.
function isHolding#
Storing commands.
Returns true
while holding
function isRedoing#
Returns true
while redoing.
function isUndoing#
Returns true
while undoing.
function print#
Prints debugging information.
function redo#
Redo one command.
function undo#
Undo and redo.
Undo one command
function undoSignalIsConnectedToSlot#
Returns whether the undo signal is connected to the slot of the observer.
bool SBCUndoStack::undoSignalIsConnectedToSlot (
SBCReferenceTarget * observer,
void(SBCReferenceTarget::*)( SBCUndoEvent *) functionPointer
) const
function ~SBCUndoStack#
Destructor.
Protected Attributes Documentation#
variable dataPointer#
A pointer to the private data.