4
#include "qgsattributeaction.h"
17
QgsAction( ActionType type, QString name, QString action, bool capture );
19
//! The name of the action
23
QString action() const;
26
ActionType type() const;
28
//! Whether to capture output for display when this action is run
34
class QgsAttributeAction
37
#include "qgsattributeaction.h"
43
virtual ~QgsAttributeAction();
45
//! Add an action with the given name and action details.
46
// Will happily have duplicate names and actions. If
47
// capture is true, when running the action using doAction(),
48
// any stdout from the process will be captured and displayed in a
50
void addAction( QgsAction::ActionType type, QString name, QString action, bool capture = false );
53
//! Does the action using the given values. defaultValueIndex is an
54
// index into values which indicates which value in the values vector
55
// is to be used if the action has a default placeholder.
56
void doAction( int index, const QList< QPair<QString, QString> > &values,
57
int defaultValueIndex = 0, void *executePython = 0 );
60
//! Removes all actions
63
//! Expands the given action, replacing all %'s with the value as
65
static QString expandAction( QString action, const QList< QPair<QString, QString> > &values,
66
uint defaultValueIndex );
68
//! Writes the actions out in XML format
69
bool writeXML( QDomNode& layer_node, QDomDocument& doc ) const;
71
//! Reads the actions in in XML format
72
bool readXML( const QDomNode& layer_node );
75
QgsAction &at( int idx );
76
QgsAction &operator[]( int idx );