|
QGIS API Documentation
2.4.0-Chugiak
|
Undo command to undo/redo all composer item related changes. More...
#include <qgscomposeritemcommand.h>


Public Member Functions | |
| QgsComposerItemCommand (QgsComposerItem *item, const QString &text, QUndoCommand *parent=0) | |
| virtual | ~QgsComposerItemCommand () |
| void | undo () |
| Reverses the command. More... | |
| void | redo () |
| Replays the command. More... | |
| void | savePreviousState () |
| Saves current item state as previous state. More... | |
| void | saveAfterState () |
| Saves current item state as after state. More... | |
| QDomDocument | previousState () const |
| QDomDocument | afterState () const |
| bool | containsChange () const |
| Returns true if previous state and after state are valid and different. More... | |
| const QgsComposerItem * | item () const |
Protected Member Functions | |
| void | saveState (QDomDocument &stateDoc) const |
| void | restoreState (QDomDocument &stateDoc) const |
Protected Attributes | |
| QgsComposerItem * | mItem |
| Target item of the command. More... | |
| QDomDocument | mPreviousState |
| XML that saves the state before executing the command. More... | |
| QDomDocument | mAfterState |
| XML containing the state after executing the command. More... | |
| bool | mFirstRun |
| Flag to prevent the first redo() if the command is pushed to the undo stack. More... | |
Undo command to undo/redo all composer item related changes.
Definition at line 27 of file qgscomposeritemcommand.h.
| QgsComposerItemCommand::QgsComposerItemCommand | ( | QgsComposerItem * | item, |
| const QString & | text, | ||
| QUndoCommand * | parent = 0 |
||
| ) |
Definition at line 22 of file qgscomposeritemcommand.cpp.
|
virtual |
Definition at line 27 of file qgscomposeritemcommand.cpp.
|
inline |
Definition at line 44 of file qgscomposeritemcommand.h.
Referenced by QgsComposerMergeCommand::mergeWith().
| bool QgsComposerItemCommand::containsChange | ( | ) | const |
Returns true if previous state and after state are valid and different.
Definition at line 46 of file qgscomposeritemcommand.cpp.
References mAfterState, and mPreviousState.
Referenced by QgsComposition::endCommand().
|
inline |
Definition at line 49 of file qgscomposeritemcommand.h.
Referenced by QgsComposerMergeCommand::mergeWith().
|
inline |
Definition at line 43 of file qgscomposeritemcommand.h.
| void QgsComposerItemCommand::redo | ( | ) |
Replays the command.
Definition at line 36 of file qgscomposeritemcommand.cpp.
References mAfterState, mFirstRun, and restoreState().
|
protected |
Definition at line 72 of file qgscomposeritemcommand.cpp.
References QgsProject::dirty(), QgsProject::instance(), mItem, QgsComposerItem::readXML(), and QgsComposerItem::repaint().
| void QgsComposerItemCommand::saveAfterState | ( | ) |
Saves current item state as after state.
Definition at line 56 of file qgscomposeritemcommand.cpp.
References mAfterState, and saveState().
Referenced by QgsComposition::alignSelectedItemsBottom(), QgsComposition::alignSelectedItemsHCenter(), QgsComposition::alignSelectedItemsLeft(), QgsComposition::alignSelectedItemsRight(), QgsComposition::alignSelectedItemsTop(), QgsComposition::alignSelectedItemsVCenter(), QgsComposition::endCommand(), QgsComposition::lockSelectedItems(), QgsComposerMouseHandles::mouseReleaseEvent(), QgsComposition::unlockAllItems(), and QgsComposition::updateZValues().
| void QgsComposerItemCommand::savePreviousState | ( | ) |
Saves current item state as previous state.
Definition at line 51 of file qgscomposeritemcommand.cpp.
References mPreviousState, and saveState().
Referenced by QgsComposition::alignSelectedItemsBottom(), QgsComposition::alignSelectedItemsHCenter(), QgsComposition::alignSelectedItemsLeft(), QgsComposition::alignSelectedItemsRight(), QgsComposition::alignSelectedItemsTop(), QgsComposition::alignSelectedItemsVCenter(), QgsComposition::beginCommand(), QgsComposition::lockSelectedItems(), QgsComposerMouseHandles::mouseReleaseEvent(), QgsComposition::unlockAllItems(), and QgsComposition::updateZValues().
|
protected |
Definition at line 61 of file qgscomposeritemcommand.cpp.
References mItem, and QgsComposerItem::writeXML().
Referenced by saveAfterState(), and savePreviousState().
| void QgsComposerItemCommand::undo | ( | ) |
Reverses the command.
Definition at line 31 of file qgscomposeritemcommand.cpp.
References mPreviousState, and restoreState().
|
protected |
XML containing the state after executing the command.
Definition at line 57 of file qgscomposeritemcommand.h.
Referenced by containsChange(), QgsComposerMergeCommand::mergeWith(), redo(), and saveAfterState().
|
protected |
Flag to prevent the first redo() if the command is pushed to the undo stack.
Definition at line 60 of file qgscomposeritemcommand.h.
Referenced by redo().
|
protected |
Target item of the command.
Definition at line 53 of file qgscomposeritemcommand.h.
Referenced by QgsComposerMergeCommand::mergeWith(), restoreState(), and saveState().
|
protected |
XML that saves the state before executing the command.
Definition at line 55 of file qgscomposeritemcommand.h.
Referenced by containsChange(), savePreviousState(), and undo().
1.8.7