QgsAttributeAction Class Reference

Storage and management of actions associated with Qgis layer attributes. More...

#include <qgsattributeaction.h>

Collaboration diagram for QgsAttributeAction:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 QgsAttributeAction (QgsVectorLayer *layer)
 Constructor.
virtual ~QgsAttributeAction ()
 Destructor.
void addAction (QgsAction::ActionType type, QString name, QString action, bool capture=false)
 Add an action with the given name and action details.
void doAction (int index, const QgsAttributeMap &attributes, int defaultValueIndex=0, void(*executePython)(const QString &)=0)
 Does the action using the given values. defaultValueIndex is an.
void clearActions ()
 Removes all actions.
QString expandAction (QString action, const QgsAttributeMap &attributes, uint defaultValueIndex)
 Expands the given action, replacing all 's with the value as.
bool writeXML (QDomNode &layer_node, QDomDocument &doc) const
 Writes the actions out in XML format.
bool readXML (const QDomNode &layer_node)
 Reads the actions in in XML format.
int size () const
QgsActionat (int idx)
QgsActionoperator[] (int idx)

Static Public Member Functions

static void setPythonExecute (void(*)(const QString &))

Private Attributes

QList< QgsActionmActions
QgsVectorLayermLayer

Static Private Attributes

static void(* smPythonExecute )(const QString &)


Detailed Description

Storage and management of actions associated with Qgis layer attributes.

Definition at line 95 of file qgsattributeaction.h.


Constructor & Destructor Documentation

QgsAttributeAction::QgsAttributeAction ( QgsVectorLayer layer  )  [inline]

Constructor.

Definition at line 99 of file qgsattributeaction.h.

virtual QgsAttributeAction::~QgsAttributeAction (  )  [inline, virtual]

Destructor.

Definition at line 102 of file qgsattributeaction.h.


Member Function Documentation

void QgsAttributeAction::addAction ( QgsAction::ActionType  type,
QString  name,
QString  action,
bool  capture = false 
)

Add an action with the given name and action details.

Definition at line 37 of file qgsattributeaction.cpp.

References mActions.

Referenced by readXML().

void QgsAttributeAction::doAction ( int  index,
const QgsAttributeMap attributes,
int  defaultValueIndex = 0,
void(*)(const QString &)  executePython = 0 
)

Does the action using the given values. defaultValueIndex is an.

Definition at line 42 of file qgsattributeaction.cpp.

References QgsAction::action(), at(), QgsAction::capture(), QgsRunProcess::create(), expandAction(), QgsAction::GenericPython, QgsAction::runable(), size(), smPythonExecute, and QgsAction::type().

void QgsAttributeAction::clearActions (  )  [inline]

Removes all actions.

Definition at line 121 of file qgsattributeaction.h.

QString QgsAttributeAction::expandAction ( QString  action,
const QgsAttributeMap attributes,
uint  defaultValueIndex 
)

Expands the given action, replacing all 's with the value as.

Definition at line 83 of file qgsattributeaction.cpp.

References QgsVectorLayer::attributeDisplayName(), mLayer, and QgsVectorLayer::pendingFields().

Referenced by doAction().

bool QgsAttributeAction::writeXML ( QDomNode &  layer_node,
QDomDocument &  doc 
) const

Writes the actions out in XML format.

Definition at line 134 of file qgsattributeaction.cpp.

References mActions.

Referenced by QgsVectorLayer::writeSymbology().

bool QgsAttributeAction::readXML ( const QDomNode &  layer_node  ) 

Reads the actions in in XML format.

Definition at line 152 of file qgsattributeaction.cpp.

References addAction(), and mActions.

Referenced by QgsVectorLayer::readSymbology().

int QgsAttributeAction::size (  )  const [inline]

Definition at line 135 of file qgsattributeaction.h.

Referenced by doAction().

QgsAction& QgsAttributeAction::at ( int  idx  )  [inline]

Definition at line 136 of file qgsattributeaction.h.

Referenced by doAction().

QgsAction& QgsAttributeAction::operator[] ( int  idx  )  [inline]

Definition at line 137 of file qgsattributeaction.h.

void QgsAttributeAction::setPythonExecute ( void(*)(const QString &)  runPython  )  [static]

Definition at line 175 of file qgsattributeaction.cpp.

References smPythonExecute.


Member Data Documentation

Definition at line 142 of file qgsattributeaction.h.

Referenced by addAction(), readXML(), and writeXML().

Definition at line 143 of file qgsattributeaction.h.

Referenced by expandAction().

void(* QgsAttributeAction::smPythonExecute)(const QString &)=0 ( const QString &   )  [static, private]

Referenced by doAction(), and setPythonExecute().


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

Generated on Sat Feb 4 19:17:23 2012 for Quantum GIS API Documentation by  doxygen 1.5.6