19 #include "qgis_core.h"
63 QgsAction(
ActionType type,
const QString &description,
const QString &command,
bool capture =
false,
bool enabledOnlyWhenEditable =
false )
65 , mDescription( description )
67 , mCaptureOutput( capture )
68 , mId( QUuid::createUuid() )
69 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
72 QgsAction( ActionType type,
const QString &description,
const QString &command,
bool capture =
false )
74 , mDescription( description )
76 , mCaptureOutput( capture )
77 , mId( QUuid::createUuid() )
78 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
96 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 )
98 , mDescription( description )
99 , mShortTitle( shortTitle )
102 , mCaptureOutput( capture )
103 , mActionScopes( actionScopes )
104 , mNotificationMessage( notificationMessage )
105 , mId( QUuid::createUuid() )
106 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
109 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() )
111 , mDescription( description )
112 , mShortTitle( shortTitle )
115 , mCaptureOutput( capture )
116 , mActionScopes( actionScopes )
117 , mNotificationMessage( notificationMessage )
118 , mId( QUuid::createUuid() )
119 , mIsEnabledOnlyWhenEditable( enabledOnlyWhenEditable )
124 QString
name()
const {
return mDescription; }
134 QUuid
id()
const {
return mId; }
141 bool isValid()
const {
return !mId.isNull(); }
147 QIcon
icon()
const {
return QIcon( mIcon ); }
169 bool capture()
const {
return mCaptureOutput; }
184 bool runable()
const;
208 QSet<QString> actionScopes()
const;
217 void setActionScopes(
const QSet<QString> &actionScopes );
225 void readXml(
const QDomNode &actionNode );
233 void writeXml( QDomNode &actionsNode )
const;
250 ActionType mType = Generic;
251 QString mDescription;
255 bool mCaptureOutput =
false;
256 QSet<QString> mActionScopes;
257 QString mNotificationMessage;
258 mutable std::shared_ptr<QAction> mAction;
261 bool mIsEnabledOnlyWhenEditable =
false;
266 #endif // QGSACTION_H