Stores the undo / redo stacks of transactions done on a document.
More...
#include <CommandHistory.h>
|
| plCommandHistory (plDocument *pDocument) |
|
const plDocument * | GetDocument () const |
|
plStatus | Undo (plUInt32 uiNumEntries=1) |
|
plStatus | Redo (plUInt32 uiNumEntries=1) |
|
bool | CanUndo () const |
|
bool | CanRedo () const |
|
plStringView | GetUndoDisplayString () const |
|
plStringView | GetRedoDisplayString () const |
|
void | StartTransaction (const plFormatString &displayString) |
|
void | CancelTransaction () |
|
void | FinishTransaction () |
|
bool | IsInTransaction () const |
| Returns true, if between StartTransaction / EndTransaction. False during Undo/Redo.
|
|
bool | IsInUndoRedo () const |
|
void | BeginTemporaryCommands (plStringView sDisplayString, bool bFireEventsWhenUndoingTempCommands=false) |
| Call this to start a series of transactions that typically change the same value over and over (e.g. dragging an object to a position). Every time a new transaction is started, the previous one is undone first. At the end of a series of temporary transactions, only the last transaction will be stored as a single undo step. Call this first and then start a transaction inside it.
|
|
void | CancelTemporaryCommands () |
|
void | FinishTemporaryCommands () |
|
bool | InTemporaryTransaction () const |
|
void | SuspendTemporaryTransaction () |
|
void | ResumeTemporaryTransaction () |
|
plStatus | AddCommand (plCommand &ref_command) |
|
void | ClearUndoHistory () |
|
void | ClearRedoHistory () |
|
void | MergeLastTwoTransactions () |
|
plUInt32 | GetUndoStackSize () const |
|
plUInt32 | GetRedoStackSize () const |
|
const plCommandTransaction * | GetUndoStackEntry (plUInt32 uiIndex) const |
|
const plCommandTransaction * | GetRedoStackEntry (plUInt32 uiIndex) const |
|
plSharedPtr< plCommandHistory::Storage > | SwapStorage (plSharedPtr< plCommandHistory::Storage > pNewStorage) |
|
plSharedPtr< plCommandHistory::Storage > | GetStorage () |
|
Stores the undo / redo stacks of transactions done on a document.
◆ MergeLastTwoTransactions()
void plCommandHistory::MergeLastTwoTransactions |
( |
| ) |
|
- Todo
- This would not be necessary, if hierarchical transactions would not crash
◆ StartTransaction()
void plCommandHistory::StartTransaction |
( |
const plFormatString & | displayString | ) |
|
- Todo
- Allow to have a limited transaction history and clean up transactions after a while
The documentation for this class was generated from the following files:
- Code/Tools/Libs/ToolsFoundation/CommandHistory/CommandHistory.h
- Code/Tools/Libs/ToolsFoundation/CommandHistory/Implementation/CommandHistory.cpp