53 , mDescription( description )
55 , mCaptureOutput( capture )
56 , mId( QUuid::createUuid() )
57 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
73 QgsAction(
Qgis::AttributeActionType type,
const QString &description,
const QString &action,
const QString &icon,
bool capture,
const QString &shortTitle = QString(),
const QSet<QString> &actionScopes = QSet<QString>(),
const QString ¬ificationMessage = QString(),
bool enabledOnlyWhenEditable
SIP_PYARGREMOVE =
false )
75 , mDescription( description )
76 , mShortTitle( shortTitle )
79 , mCaptureOutput( capture )
80 , mActionScopes( actionScopes )
81 , mNotificationMessage( notificationMessage )
82 , mId( QUuid::createUuid() )
83 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
100 QgsAction(
const QUuid &
id,
Qgis::AttributeActionType type,
const QString &description,
const QString &action,
const QString &icon,
bool capture,
const QString &shortTitle = QString(),
const QSet<QString> &actionScopes = QSet<QString>(),
const QString ¬ificationMessage = QString(),
bool enabledOnlyWhenEditable
SIP_PYARGREMOVE =
false )
102 , mDescription( description )
103 , mShortTitle( shortTitle )
106 , mCaptureOutput( capture )
107 , mActionScopes( actionScopes )
108 , mNotificationMessage( notificationMessage )
110 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
115 QString
name()
const {
return mDescription; }
124 QUuid
id()
const {
return mId; }
130 bool isValid()
const {
return !mId.isNull(); }
136 QIcon
icon()
const {
return QIcon( mIcon ); }
156 bool capture()
const {
return mCaptureOutput; }
171 bool runable()
const;
192 QSet<QString> actionScopes()
const;
200 void setActionScopes(
const QSet<QString> &actionScopes );
207 void readXml(
const QDomNode &actionNode );
214 void writeXml( QDomNode &actionsNode )
const;
233 QString html( )
const;
239 void setCommand(
const QString &newCommand );
243 void handleFormSubmitAction(
const QString &expandedAction )
const;
245 QString mDescription;
249 bool mCaptureOutput =
false;
250 QSet<QString> mActionScopes;
251 QString mNotificationMessage;
254 bool mIsEnabledOnlyWhenEditable =
false;
AttributeActionType
Attribute action types.
Utility class that encapsulates an action based on vector attributes.
void setEnabledOnlyWhenEditable(bool enable)
Set whether the action is only enabled in editable mode.
QString notificationMessage() const
Returns the notification message that triggers the action.
QString name() const
The name of the action. This may be a longer description.
Qgis::AttributeActionType type() const
The action type.
QgsAction(const QUuid &id, Qgis::AttributeActionType type, const QString &description, const QString &action, const QString &icon, bool capture, const QString &shortTitle=QString(), const QSet< QString > &actionScopes=QSet< QString >(), const QString ¬ificationMessage=QString(), bool enabledOnlyWhenEditable=false)
Create a new QgsAction.
QIcon icon() const
The icon.
QString iconPath() const
The path to the icon.
bool isValid() const
Returns true if this action was a default constructed one.
QgsAction(Qgis::AttributeActionType type, const QString &description, const QString &command, bool capture=false, bool enabledOnlyWhenEditable=false)
Create a new QgsAction.
QString command() const
Returns the command that is executed by this action.
QgsAction(Qgis::AttributeActionType type, const QString &description, const QString &action, const QString &icon, bool capture, const QString &shortTitle=QString(), const QSet< QString > &actionScopes=QSet< QString >(), const QString ¬ificationMessage=QString(), bool enabledOnlyWhenEditable=false)
Create a new QgsAction.
QString shortTitle() const
The short title is used to label user interface elements like buttons.
bool isEnabledOnlyWhenEditable() const
Returns whether only enabled in editable mode.
bool capture() const
Whether to capture output for display when this action is run.
QUuid id() const
Returns a unique id for this action.
Single scope for storing variables and functions for use within a QgsExpressionContext.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Represents a vector layer which manages a vector based data sets.
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)