19 #include "qgis_core.h"
65 , mDescription( description )
67 , mCaptureOutput( capture )
68 , mId( QUuid::createUuid() )
69 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
85 QgsAction(
ActionType 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 )
87 , mDescription( description )
88 , mShortTitle( shortTitle )
91 , mCaptureOutput( capture )
92 , mActionScopes( actionScopes )
93 , mNotificationMessage( notificationMessage )
94 , mId( QUuid::createUuid() )
95 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
112 QgsAction(
const QUuid &
id,
ActionType 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 )
114 , mDescription( description )
115 , mShortTitle( shortTitle )
118 , mCaptureOutput( capture )
119 , mActionScopes( actionScopes )
120 , mNotificationMessage( notificationMessage )
122 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
127 QString
name()
const {
return mDescription; }
137 QUuid
id()
const {
return mId; }
144 bool isValid()
const {
return !mId.isNull(); }
150 QIcon
icon()
const {
return QIcon( mIcon ); }
172 bool capture()
const {
return mCaptureOutput; }
187 bool runable()
const;
211 QSet<QString> actionScopes()
const;
220 void setActionScopes(
const QSet<QString> &actionScopes );
228 void readXml(
const QDomNode &actionNode );
236 void writeXml( QDomNode &actionsNode )
const;
257 QString html( )
const;
261 void handleFormSubmitAction(
const QString &expandedAction )
const;
262 ActionType mType = Generic;
263 QString mDescription;
267 bool mCaptureOutput =
false;
268 QSet<QString> mActionScopes;
269 QString mNotificationMessage;
272 bool mIsEnabledOnlyWhenEditable =
false;
Utility class that encapsulates an action based on vector attributes.
QgsAction(ActionType type, const QString &description, const QString &command, bool capture=false, bool enabledOnlyWhenEditable=false)
Create a new QgsAction.
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.
QgsAction()=default
Default constructor.
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.
ActionType type() const
The action type.
QString command() const
Returns the command that is executed by this action.
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.
QgsAction(const QUuid &id, ActionType 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.
QgsAction(ActionType 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.
@ SubmitUrlEncoded
POST data to an URL, using "application/x-www-form-urlencoded" or "application/json" if the body is v...
@ SubmitUrlMultipart
POST data to an URL using "multipart/form-data".
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(QgsMeshTimeSettings)