19 #include "qgis_core.h"
63 , mDescription( description )
65 , mCaptureOutput( capture )
66 , mId( QUuid::createUuid() )
67 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
83 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 )
85 , mDescription( description )
86 , mShortTitle( shortTitle )
89 , mCaptureOutput( capture )
90 , mActionScopes( actionScopes )
91 , mNotificationMessage( notificationMessage )
92 , mId( QUuid::createUuid() )
93 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
110 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 )
112 , mDescription( description )
113 , mShortTitle( shortTitle )
116 , mCaptureOutput( capture )
117 , mActionScopes( actionScopes )
118 , mNotificationMessage( notificationMessage )
120 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
125 QString
name()
const {
return mDescription; }
135 QUuid
id()
const {
return mId; }
142 bool isValid()
const {
return !mId.isNull(); }
148 QIcon
icon()
const {
return QIcon( mIcon ); }
170 bool capture()
const {
return mCaptureOutput; }
185 bool runable()
const;
209 QSet<QString> actionScopes()
const;
218 void setActionScopes(
const QSet<QString> &actionScopes );
226 void readXml(
const QDomNode &actionNode );
234 void writeXml( QDomNode &actionsNode )
const;
255 QString html( )
const;
258 ActionType mType = Generic;
259 QString mDescription;
263 bool mCaptureOutput =
false;
264 QSet<QString> mActionScopes;
265 QString mNotificationMessage;
268 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.
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)