QGIS API Documentation 4.3.0-Master (6313fb5bce0)
Loading...
Searching...
No Matches
qgsprocessingprovideractions.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingprovideractions.h
3 ----------------------------------
4 Date : September 2026
5 Copyright : (C) 2026 Nyall Dawson
6 Email : nyall dot dawson at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSPROCESSINGPROVIDERACTIONS_H
17#define QGSPROCESSINGPROVIDERACTIONS_H
18
19#include "qgis.h"
20#include "qgis_gui.h"
21#include "qgis_sip.h"
22
23#include <QPointer>
24
25class QgsDockWidget;
27
35{
36 public:
42 QWidget *parentWidget() const;
43
49 void setParentWidget( QWidget *widget );
50
56 QString algorithmName() const;
57
63 void setAlgorithmName( const QString &name );
64
70 QString providerId() const;
71
77 void setProviderId( const QString &id );
78
79 private:
80 QWidget *mParentWidget = nullptr;
81
82 QString mAlgorithmName;
83 QString mProviderId;
84};
85
93{
94 public:
95 //TODO QGIS 5.0 -- name and group should be mandatory
99 QgsProcessingToolboxAction( const QString &name = QString(), const QString &group = QString() );
100
102
106 QString actionName() const { return mName; }
107
113 Q_DECL_DEPRECATED void setActionName( const QString &name ) SIP_DEPRECATED { mName = name; }
114
118 QString groupName() const { return mGroup; }
119
125 Q_DECL_DEPRECATED void setGroupName( const QString &group ) SIP_DEPRECATED { mGroup = group; }
126
127#ifdef SIP_RUN
128 SIP_PROPERTY( name = group, get = groupName, set = setGroupName )
129#endif
130
134 virtual QIcon icon() const;
135
141 Q_DECL_DEPRECATED virtual QIcon getIcon() const SIP_DEPRECATED;
142
148 Q_DECL_DEPRECATED void setData( QgsDockWidget *widget ) SIP_DEPRECATED;
149
155 Q_DECL_DEPRECATED QgsDockWidget *data() const SIP_DEPRECATED;
156
157#ifdef SIP_RUN
158 SIP_PROPERTY( name = toolbox, get = data, set = setData )
159#endif
160
166 Q_DECL_DEPRECATED virtual void execute() SIP_DEPRECATED;
167
171 virtual void trigger( const QgsProcessingActionContext &context );
172
173 private:
174 QString mName;
175 QString mGroup;
176
177 mutable bool mUseDeprecatedLoopBreak = false;
178
179 QPointer< QgsDockWidget > mToolboxDockWidget;
180};
181
182
190{
191 public:
192 //TODO QGIS 5.0 -- name should be mandatory
196 QgsProcessingToolboxContextAction( const QString &name = QString() );
197
199
203 QString actionName() const { return mName; }
204
209 Q_DECL_DEPRECATED void setActionName( const QString &name ) SIP_DEPRECATED { mName = name; }
210
214 virtual QIcon icon() const;
215
221 Q_DECL_DEPRECATED virtual bool isEnabled() const SIP_DEPRECATED;
222
226 virtual bool isCompatibleWithAlgorithm( const QString &providerId, const QString &algorithmName );
227
233 Q_DECL_DEPRECATED QgsDockWidget *getToolbox() SIP_DEPRECATED;
234
240 Q_DECL_DEPRECATED void setToolbox( QgsDockWidget *toolbox ) SIP_DEPRECATED;
241
242#ifdef SIP_RUN
243 SIP_PROPERTY( name = toolbox, get = getToolbox, set = setToolbox )
244#endif
245
251 Q_DECL_DEPRECATED QgsProcessingAlgorithm *getItemData() SIP_DEPRECATED;
252
258 Q_DECL_DEPRECATED void setItemData( QgsProcessingAlgorithm *data ) SIP_DEPRECATED;
259
260#ifdef SIP_RUN
261 SIP_PROPERTY( name = itemData, get = getItemData, set = setItemData )
262#endif
263
269 Q_DECL_DEPRECATED void setData( QgsProcessingAlgorithm *data, QgsDockWidget *toolbox ) SIP_DEPRECATED;
270
276 Q_DECL_DEPRECATED virtual void execute() SIP_DEPRECATED;
277
281 virtual void trigger( const QgsProcessingActionContext &context );
282
288 bool isSeparator() const;
289
295 void setIsSeparator( bool isSeparator );
296
297#ifdef SIP_RUN
298 SIP_PROPERTY( name = is_separator, get = isSeparator, set = setIsSeparator )
299#endif
300
301 private:
302 QString mName;
303
304 mutable bool mUseDeprecatedLoopBreak = false;
305
306 QPointer< QgsDockWidget > mToolboxDockWidget;
307 QgsProcessingAlgorithm *mAlgorithm = nullptr;
308
309 bool mIsSeparator = false;
310};
311
312
313#endif // QGSPROCESSINGPROVIDERACTIONS_H
A QDockWidget subclass with more fine-grained control over how the widget is closed or opened.
Encapsulates the context in which a Processing action is executed.
void setAlgorithmName(const QString &name)
Sets the name of the algorithm associated with the action.
void setParentWidget(QWidget *widget)
Sets the parent widget to use for dialogs constructed when triggering the action.
QWidget * parentWidget() const
Returns the parent widget to use for dialogs constructed when triggering the action.
QString providerId() const
Returns the ID of the provider associated with the action.
void setProviderId(const QString &id)
Sets the ID of the provider associated with the action.
QString algorithmName() const
Returns the name of the algorithm associated with the action.
Abstract base class for processing algorithms.
virtual ~QgsProcessingToolboxAction()
QString groupName() const
Returns the action's (translated, user visible) group name.
QgsProcessingToolboxAction(const QString &name=QString(), const QString &group=QString())
Constructor for QgsProcessingToolboxAction.
QString actionName() const
Returns the action's (translated, user visible) name.
Q_DECL_DEPRECATED void setActionName(const QString &name)
Sets the action's (translated, user visible) name.
Q_DECL_DEPRECATED void setGroupName(const QString &group)
Sets the action's (translated, user visible) group name.
Q_DECL_DEPRECATED void setActionName(const QString &name)
Sets the action's (translated, user visible) name.
QgsProcessingToolboxContextAction(const QString &name=QString())
Constructor for QgsProcessingToolboxContextAction.
QString actionName() const
Returns the action's (translated, user visible) name.
#define SIP_DEPRECATED
Definition qgis_sip.h:113
#define SIP_PROPERTY(name, getter, setter)
Definition qgis_sip.h:282