Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
QgsAttributeAction Class Reference

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

#include <qgsattributeaction.h>

Collaboration diagram for QgsAttributeAction:
Collaboration graph
[legend]

Public Member Functions

 QgsAttributeAction (QgsVectorLayer *layer)
 Constructor. More...
 
virtual ~QgsAttributeAction ()
 Destructor. More...
 
void addAction (QgsAction::ActionType type, QString name, QString action, bool capture=false)
 Add an action with the given name and action details. More...
 
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. More...
 
void clearActions ()
 Removes all actions. More...
 
QString expandAction (QString action, const QgsAttributeMap &attributes, uint defaultValueIndex)
 Expands the given action, replacing all 's with the value as. More...
 
bool writeXML (QDomNode &layer_node, QDomDocument &doc) const
 Writes the actions out in XML format. More...
 
bool readXML (const QDomNode &layer_node)
 Reads the actions in in XML format. More...
 
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 ( )
inlinevirtual

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

void QgsAttributeAction::clearActions ( )
inline

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

QList<QgsAction> QgsAttributeAction::mActions
private

Definition at line 142 of file qgsattributeaction.h.

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

QgsVectorLayer* QgsAttributeAction::mLayer
private

Definition at line 143 of file qgsattributeaction.h.

Referenced by expandAction().

void(* QgsAttributeAction::smPythonExecute)(const QString &)=0
staticprivate

Definition at line 144 of file qgsattributeaction.h.

Referenced by doAction(), and setPythonExecute().


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