Plasma Engine  2.0
Loading...
Searching...
No Matches
plCommandHistory Class Reference

Stores the undo / redo stacks of transactions done on a document. More...

#include <CommandHistory.h>

Classes

class  Storage
 

Public Member Functions

 plCommandHistory (plDocument *pDocument)
 
const plDocumentGetDocument () 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 plCommandTransactionGetUndoStackEntry (plUInt32 uiIndex) const
 
const plCommandTransactionGetRedoStackEntry (plUInt32 uiIndex) const
 
plSharedPtr< plCommandHistory::StorageSwapStorage (plSharedPtr< plCommandHistory::Storage > pNewStorage)
 
plSharedPtr< plCommandHistory::StorageGetStorage ()
 

Public Attributes

plEvent< const plCommandHistoryEvent &, plMutexm_Events
 

Friends

class plCommand
 

Detailed Description

Stores the undo / redo stacks of transactions done on a document.

Member Function Documentation

◆ 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: