QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Signals | Public Member Functions | Private Member Functions | Private Attributes | List of all members
QgsAddRemoveItemCommand Class Reference

A composer command class for adding / removing composer items. More...

#include <qgsaddremoveitemcommand.h>

Collaboration diagram for QgsAddRemoveItemCommand:
Collaboration graph
[legend]

Public Types

enum  State { Added = 0, Removed }

Signals

void itemAdded (QgsComposerItem *item)
void itemRemoved (QgsComposerItem *item)

Public Member Functions

 QgsAddRemoveItemCommand (State s, QgsComposerItem *item, QgsComposition *c, const QString &text, QUndoCommand *parent=0)
 ~QgsAddRemoveItemCommand ()
void redo ()
void undo ()

Private Member Functions

void switchState ()

Private Attributes

QgsComposerItemmItem
QgsCompositionmComposition
State mState
bool mFirstRun

Detailed Description

A composer command class for adding / removing composer items.

If mState == Removed, the command owns the item

Definition at line 26 of file qgsaddremoveitemcommand.h.

Member Enumeration Documentation

Enumerator:
Added 
Removed 

Definition at line 32 of file qgsaddremoveitemcommand.h.

Constructor & Destructor Documentation

QgsAddRemoveItemCommand::QgsAddRemoveItemCommand ( State  s,
QgsComposerItem item,
QgsComposition c,
const QString &  text,
QUndoCommand *  parent = 0 
)

Definition at line 23 of file qgsaddremoveitemcommand.cpp.

QgsAddRemoveItemCommand::~QgsAddRemoveItemCommand ( )

Definition at line 28 of file qgsaddremoveitemcommand.cpp.

References mItem, mState, and Removed.

Member Function Documentation

void QgsAddRemoveItemCommand::itemAdded ( QgsComposerItem item)
signal

Referenced by switchState().

void QgsAddRemoveItemCommand::itemRemoved ( QgsComposerItem item)
signal

Referenced by switchState().

void QgsAddRemoveItemCommand::redo ( )

Definition at line 36 of file qgsaddremoveitemcommand.cpp.

References mFirstRun, and switchState().

void QgsAddRemoveItemCommand::switchState ( )
private
void QgsAddRemoveItemCommand::undo ( )

Definition at line 46 of file qgsaddremoveitemcommand.cpp.

References mFirstRun, and switchState().

Member Data Documentation

QgsComposition* QgsAddRemoveItemCommand::mComposition
private

Definition at line 50 of file qgsaddremoveitemcommand.h.

Referenced by switchState().

bool QgsAddRemoveItemCommand::mFirstRun
private

Definition at line 52 of file qgsaddremoveitemcommand.h.

Referenced by redo(), and undo().

QgsComposerItem* QgsAddRemoveItemCommand::mItem
private

Definition at line 49 of file qgsaddremoveitemcommand.h.

Referenced by switchState(), and ~QgsAddRemoveItemCommand().

State QgsAddRemoveItemCommand::mState
private

Definition at line 51 of file qgsaddremoveitemcommand.h.

Referenced by switchState(), and ~QgsAddRemoveItemCommand().


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