24 #ifndef QGSATTRIBUTEACTION_H
25 #define QGSATTRIBUTEACTION_H
54 mType( type ), mName( name ), mAction( action ), mCaptureOutput( capture ) {}
57 mType( type ), mName( name ), mIcon( icon ), mAction( action ), mCaptureOutput( capture ) {}
75 bool capture()
const {
return mCaptureOutput; }
80 return mType == Generic ||
81 mType == GenericPython ||
85 #elif defined(Q_OS_MAC)
132 void removeAction(
int index );
138 void doAction(
int index,
140 int defaultValueIndex = 0 );
148 void doAction(
int index,
183 bool readXML(
const QDomNode& layer_node );
185 int size()
const {
return mActions.size(); }
190 static void setPythonExecute(
void ( * )(
const QString & ) );
193 int defaultAction()
const {
return mDefaultAction < 0 || mDefaultAction >= size() ? -1 : mDefaultAction; }
199 static void ( *smPythonExecute )(
const QString & );
202 void ( *executePython )(
const QString & ) = 0 );
const QString iconPath() const
The path to the icon.
QgsAction(ActionType type, QString name, QString action, const QString &icon, bool capture)
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.
const QIcon icon() const
The icon.
Utility class that encapsulates an action based on vector attributes.
QString action() const
The action.
ActionType type() const
The action type.
virtual ~QgsAttributeAction()
Destructor.
const QList< QgsAction > & listActions()
List all actions.
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.