@@ -33,41 +33,7 @@ class QgsAction
33
33
OpenUrl,
34
34
};
35
35
36
- /**
37
- * Create a new QgsAction
38
- *
39
- * @param type The type of this action
40
- * @param description A human readable description string
41
- * @param action The action text. Its interpretation depends on the type
42
- * @param capture If this is set to true, the output will be captured when an action is run
43
- */
44
- QgsAction( ActionType type, const QString& description, const QString& action, bool capture );
45
-
46
-
47
- /**
48
- * Create a new QgsAction
49
- *
50
- * @param type The type of this action
51
- * @param description A human readable description string
52
- * @param action The action text. Its interpretation depends on the type
53
- * @param icon Path to an icon for this action
54
- * @param capture If this is set to true, the output will be captured when an action is run
55
- * @param shortTitle A short string used to label user interface elements like buttons
56
- */
57
- QgsAction( ActionType type, const QString& description, const QString& action, const QString& icon, bool capture, const QString& shortTitle = QString() );
58
-
59
- /**
60
- * Create a new QgsAction
61
- *
62
- * @param type The type of this action
63
- * @param description A human readable description string
64
- * @param action The action text. Its interpretation depends on the type
65
- * @param icon Path to an icon for this action
66
- * @param capture If this is set to true, the output will be captured when an action is run
67
- * @param showInAttributeTable If this is false, the action will be hidden on the attribute table action widget
68
- * @param shortTitle A short string used to label user interface elements like buttons
69
- */
70
- QgsAction( ActionType type, const QString& description, const QString& action, const QString& icon, bool capture, bool showInAttributeTable, const QString& shortTitle = QString() );
36
+ QgsAction( ActionType type, const QString& description, const QString& action, const QString& icon, bool capture, const QString& shortTitle = QString(), const QSet<QString>& actionScopes = QSet<QString>() );
71
37
72
38
//! The name of the action. This may be a longer description.
73
39
QString name() const;
@@ -81,18 +47,34 @@ class QgsAction
81
47
//! The icon
82
48
QIcon icon() const;
83
49
84
- //! The action
85
- QString action () const;
50
+ //! The command
51
+ QString command () const;
86
52
87
53
//! The action type
88
54
ActionType type() const;
89
55
90
56
//! Whether to capture output for display when this action is run
91
57
bool capture() const;
92
58
93
- //! Whether this action should be shown on the attribute table
94
- bool showInAttributeTable() const;
95
-
96
- //! Whether the action is runable on the current platform
59
+ //! Checks if the action is runable on the current platform
97
60
bool runable() const;
61
+
62
+ /**
63
+ * The action scopes define where an action will be available.
64
+ * Action scopes may offer additional variables like the clicked
65
+ * coordinate.
66
+ *
67
+ * @see QgsActionScope
68
+ * @note Added in QGIS 3.0
69
+ */
70
+ QSet<QString> actionScopes() const;
71
+
72
+ /**
73
+ * The action scopes define where an action will be available.
74
+ * Action scopes may offer additional variables like the clicked
75
+ * coordinate.
76
+ *
77
+ * @note Added in QGIS 3.0
78
+ */
79
+ void setActionScopes( const QSet<QString>& actionScopes );
98
80
};
0 commit comments