kwave
18.07.70
|
#include <UndoAction.h>
Public Member Functions | |
virtual | ~UndoAction () |
virtual QString | description ()=0 |
virtual qint64 | undoSize ()=0 |
virtual qint64 | redoSize ()=0 |
virtual bool | store (Kwave::SignalManager &manager)=0 |
virtual Kwave::UndoAction * | undo (Kwave::SignalManager &manager, bool with_redo)=0 |
virtual bool | containsModification () const |
virtual void | dump (const QString &indent) |
This is an abstract base class used for implementation of undo and redo. The constructor should take all information needed for storing the undo data and for being able to guess the amount of the needed memory. After construction, the caller can call size() for retaining the amount of needed memory and o provide enough space. The store() function can then save the data for further undo. Calling the undo() function also creates a new UndoAction object that is responsible for holding all information for undoing that undo (redo).
Definition at line 44 of file UndoAction.h.
|
inlinevirtual |
|
inlinevirtual |
Determines whether a undo action has to do with a modification of the signal or meta information and leads to a "modified" file. The default implementation returns "true". An example for a implementation that returns "false" is the UndoSelection class which contains only information about a change in selected samples.
Reimplemented in Kwave::SelectionTracker::Undo, and Kwave::UndoSelection.
Definition at line 102 of file UndoAction.h.
Referenced by Kwave::UndoTransaction::containsModification().
|
pure virtual |
Returns a verbose short description of the action.
Implemented in Kwave::SelectionTracker::Undo, Kwave::UndoSelection, Kwave::UndoDeleteAction, Kwave::UndoAddMetaDataAction, Kwave::UndoDeleteTrack, Kwave::UndoInsertAction, Kwave::UndoInsertTrack, Kwave::UndoDeleteMetaDataAction, Kwave::UndoModifyMetaDataAction, Kwave::UndoModifyAction, and Kwave::UndoReverseAction.
Referenced by Kwave::UndoTransaction::description().
|
inlinevirtual |
dump, for debugging purposes
Reimplemented in Kwave::SelectionTracker::Undo, Kwave::UndoSelection, Kwave::UndoDeleteAction, Kwave::UndoInsertAction, Kwave::UndoDeleteMetaDataAction, and Kwave::UndoModifyMetaDataAction.
Definition at line 105 of file UndoAction.h.
References DBG.
Referenced by Kwave::UndoTransaction::dump().
|
pure virtual |
Returns the difference of needed memory that is needed for redo.
Implemented in Kwave::SelectionTracker::Undo, Kwave::UndoSelection, Kwave::UndoDeleteAction, Kwave::UndoAddMetaDataAction, Kwave::UndoDeleteTrack, Kwave::UndoInsertAction, Kwave::UndoInsertTrack, Kwave::UndoReverseAction, Kwave::UndoDeleteMetaDataAction, Kwave::UndoModifyMetaDataAction, and Kwave::UndoModifyAction.
Referenced by Kwave::UndoTransaction::redoSize().
|
pure virtual |
Stores the data needed for undo.
manager | the SignalManager for modifying the signal |
Implemented in Kwave::SelectionTracker::Undo, Kwave::UndoSelection, Kwave::UndoDeleteAction, Kwave::UndoReverseAction, Kwave::UndoInsertAction, Kwave::UndoAddMetaDataAction, Kwave::UndoDeleteTrack, Kwave::UndoInsertTrack, Kwave::UndoDeleteMetaDataAction, Kwave::UndoModifyAction, and Kwave::UndoModifyMetaDataAction.
Referenced by Kwave::SignalManager::registerUndoAction(), Kwave::ReversePlugin::run(), Kwave::SelectionTracker::saveUndoData(), Kwave::SignalManager::startUndoTransaction(), Kwave::UndoDeleteMetaDataAction::undo(), Kwave::UndoInsertTrack::undo(), Kwave::UndoAddMetaDataAction::undo(), Kwave::UndoDeleteTrack::undo(), Kwave::UndoInsertAction::undo(), and Kwave::UndoDeleteAction::undo().
|
pure virtual |
Takes back an action by creating a new undo action (for further redo) and restoring the previous state.
manager | the SignalManager for modifying the signal |
with_redo | if true a UndoAction for redo will be created |
Implemented in Kwave::SelectionTracker::Undo, Kwave::UndoReverseAction, Kwave::UndoDeleteAction, Kwave::UndoSelection, Kwave::UndoInsertAction, Kwave::UndoModifyAction, Kwave::UndoAddMetaDataAction, Kwave::UndoDeleteTrack, Kwave::UndoInsertTrack, Kwave::UndoDeleteMetaDataAction, and Kwave::UndoModifyMetaDataAction.
Referenced by Kwave::SignalManager::closeUndoTransaction(), Kwave::SignalManager::redo(), and Kwave::SignalManager::undo().
|
pure virtual |
Returns the required amount of memory that is needed for storing undo data for the operation. This will be called to determine the free memory to be reserved.
Implemented in Kwave::SelectionTracker::Undo, Kwave::UndoSelection, Kwave::UndoDeleteAction, Kwave::UndoAddMetaDataAction, Kwave::UndoDeleteTrack, Kwave::UndoInsertAction, Kwave::UndoInsertTrack, Kwave::UndoDeleteMetaDataAction, Kwave::UndoModifyMetaDataAction, Kwave::UndoReverseAction, and Kwave::UndoModifyAction.
Referenced by Kwave::SignalManager::registerUndoAction(), and Kwave::UndoTransaction::undoSize().