Quantum GIS API Documentation  1.7.4
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes
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

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().

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

Definition at line 136 of file qgsattributeaction.h.

Referenced by doAction().

Removes all actions.

Definition at line 121 of file qgsattributeaction.h.

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().

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().

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

Definition at line 137 of file qgsattributeaction.h.

bool QgsAttributeAction::readXML ( const QDomNode &  layer_node)

Reads the actions in in XML format.

Definition at line 151 of file qgsattributeaction.cpp.

References addAction(), and mActions.

Referenced by QgsVectorLayer::readSymbology().

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

Definition at line 174 of file qgsattributeaction.cpp.

References smPythonExecute.

int QgsAttributeAction::size ( ) const [inline]

Definition at line 135 of file qgsattributeaction.h.

Referenced by doAction().

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

Writes the actions out in XML format.

Definition at line 133 of file qgsattributeaction.cpp.

References mActions.

Referenced by QgsVectorLayer::writeSymbology().


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 [static, private]

Definition at line 144 of file qgsattributeaction.h.

Referenced by doAction(), and setPythonExecute().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines