19 #include "qgis_core.h"
62 QgsAction(
ActionType type,
const QString &description,
const QString &command,
bool capture =
false,
bool enabledOnlyWhenEditable =
false )
64 , mDescription( description )
66 , mCaptureOutput( capture )
67 , mId( QUuid::createUuid() )
68 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
71 QgsAction( ActionType type,
const QString &description,
const QString &command,
bool capture =
false )
73 , mDescription( description )
75 , mCaptureOutput( capture )
76 , mId( QUuid::createUuid() )
77 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
95 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 )
97 , mDescription( description )
98 , mShortTitle( shortTitle )
101 , mCaptureOutput( capture )
102 , mActionScopes( actionScopes )
103 , mNotificationMessage( notificationMessage )
104 , mId( QUuid::createUuid() )
105 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
108 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() )
110 , mDescription( description )
111 , mShortTitle( shortTitle )
114 , mCaptureOutput( capture )
115 , mActionScopes( actionScopes )
116 , mNotificationMessage( notificationMessage )
117 , mId( QUuid::createUuid() )
118 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
123 QString
name()
const {
return mDescription; }
133 QUuid
id()
const {
return mId; }
140 bool isValid()
const {
return !mId.isNull(); }
146 QIcon
icon()
const {
return QIcon( mIcon ); }
168 bool capture()
const {
return mCaptureOutput; }
183 bool runable()
const;
207 QSet<QString> actionScopes()
const;
216 void setActionScopes(
const QSet<QString> &actionScopes );
224 void readXml(
const QDomNode &actionNode );
232 void writeXml( QDomNode &actionsNode )
const;
249 ActionType mType = Generic;
250 QString mDescription;
254 bool mCaptureOutput =
false;
255 QSet<QString> mActionScopes;
256 QString mNotificationMessage;
259 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(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.
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)