QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsComposerItemCommand Class Reference

Undo command to undo/redo all composer item related changes. More...

#include <qgscomposeritemcommand.h>

Inheritance diagram for QgsComposerItemCommand:
Inheritance graph
[legend]

Public Member Functions

 QgsComposerItemCommand (QgsComposerItem *item, const QString &text, QUndoCommand *parent=0)
virtual ~QgsComposerItemCommand ()
void undo ()
 Reverses the command.
void redo ()
 Replays the command.
void savePreviousState ()
 Saves current item state as previous state.
void saveAfterState ()
 Saves current item state as after state.
QDomDocument previousState () const
QDomDocument afterState () const
bool containsChange () const
 Returns true if previous state and after state are valid and different.
QgsComposerItemitem () const
 Returns the target item the command applies to.

Protected Member Functions

void saveState (QDomDocument &stateDoc) const
void restoreState (QDomDocument &stateDoc) const

Protected Attributes

QgsComposerItemmItem
 Target item of the command.
QDomDocument mPreviousState
 XML that saves the state before executing the command.
QDomDocument mAfterState
 XML containing the state after executing the command.
QgsComposerMultiFramemMultiFrame
 Parameters for frame items.
int mFrameNumber
bool mFirstRun
 Flag to prevent the first redo() if the command is pushed to the undo stack.

Detailed Description

Undo command to undo/redo all composer item related changes.

Constructor & Destructor Documentation

QgsComposerItemCommand::QgsComposerItemCommand ( QgsComposerItem item,
const QString &  text,
QUndoCommand *  parent = 0 
)
QgsComposerItemCommand::~QgsComposerItemCommand ( )
virtual

Member Function Documentation

QDomDocument QgsComposerItemCommand::afterState ( ) const
inline
bool QgsComposerItemCommand::containsChange ( ) const

Returns true if previous state and after state are valid and different.

QgsComposerItem * QgsComposerItemCommand::item ( ) const

Returns the target item the command applies to.

Returns
target composer item
QDomDocument QgsComposerItemCommand::previousState ( ) const
inline
void QgsComposerItemCommand::redo ( )

Replays the command.

void QgsComposerItemCommand::restoreState ( QDomDocument &  stateDoc) const
protected
void QgsComposerItemCommand::saveAfterState ( )

Saves current item state as after state.

void QgsComposerItemCommand::savePreviousState ( )

Saves current item state as previous state.

void QgsComposerItemCommand::saveState ( QDomDocument &  stateDoc) const
protected
void QgsComposerItemCommand::undo ( )

Reverses the command.

Member Data Documentation

QDomDocument QgsComposerItemCommand::mAfterState
protected

XML containing the state after executing the command.

bool QgsComposerItemCommand::mFirstRun
protected

Flag to prevent the first redo() if the command is pushed to the undo stack.

int QgsComposerItemCommand::mFrameNumber
protected
QgsComposerItem* QgsComposerItemCommand::mItem
protected

Target item of the command.

QgsComposerMultiFrame* QgsComposerItemCommand::mMultiFrame
protected

Parameters for frame items.

Parent multiframe

QDomDocument QgsComposerItemCommand::mPreviousState
protected

XML that saves the state before executing the command.


The documentation for this class was generated from the following files: