24 #ifndef QGSATTRIBUTEACTION_H
25 #define QGSATTRIBUTEACTION_H
54 mType( type ), mName( name ), mAction( action ), mCaptureOutput( capture ) {}
57 QString
name()
const {
return mName; }
60 QString
action()
const {
return mAction; }
66 bool capture()
const {
return mCaptureOutput; }
71 return mType == Generic ||
72 mType == GenericPython ||
76 #elif defined(Q_OS_MAC)
113 void removeAction(
int index );
120 void doAction(
int index,
122 int defaultValueIndex = 0 );
131 void doAction(
int index,
133 const QMap<QString, QVariant> *substitutionMap = 0 );
144 QString expandAction( QString action,
const QgsAttributeMap &attributes, uint defaultValueIndex );
156 QString expandAction( QString action,
158 const QMap<QString, QVariant> *substitutionMap = 0 );
162 bool writeXML( QDomNode& layer_node, QDomDocument& doc )
const;
165 bool readXML(
const QDomNode& layer_node );
167 int size()
const {
return mActions.size(); }
172 static void setPythonExecute(
void ( * )(
const QString & ) );
175 int defaultAction()
const {
return mDefaultAction < 0 || mDefaultAction >=
size() ? 0 : mDefaultAction; }
181 static void ( *smPythonExecute )(
const QString & );
184 void ( *executePython )(
const QString & ) = 0 );
QMap< int, QVariant > QgsAttributeMap
QgsAction & operator[](int idx)
Storage and management of actions associated with Qgis layer attributes.
QgsAction(ActionType type, QString name, QString action, bool capture)
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
bool capture() const
Whether to capture output for display when this action is run.
QString name() const
The name of the action.
Utility class that encapsulates an action based on vector attributes.
QList< QgsAction > mActions
QString action() const
The action.
ActionType type() const
The action type.
virtual ~QgsAttributeAction()
Destructor.
QgsVectorLayer * layer()
Return the layer.
bool runable() const
Whether the action is runable on the current platform.
QgsAttributeAction(QgsVectorLayer *layer)
Constructor.
Represents a vector layer which manages a vector based data sets.
void setDefaultAction(int actionNumber)
void clearActions()
Removes all actions.
int defaultAction() const
Whether the action is the default action.