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 ) {}
60 QString
name()
const {
return mName; }
63 const QString
iconPath()
const {
return mIcon; }
66 const QIcon
icon()
const {
return QIcon( mIcon ); }
69 QString
action()
const {
return mAction; }
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,
150 const QMap<QString, QVariant> *substitutionMap );
164 QString expandAction( QString action,
const QgsAttributeMap &attributes, uint defaultValueIndex );
174 QString expandAction( QString action,
176 const QMap<QString, QVariant> *substitutionMap = 0 );
180 bool writeXML( QDomNode& layer_node, QDomDocument& doc )
const;
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; }
197 QList<QgsAction> mActions;
199 static void ( *smPythonExecute )(
const QString & );
202 void ( *executePython )(
const QString & ) = 0 );