QGIS API Documentation 4.3.0-Master (6313fb5bce0)
Loading...
Searching...
No Matches
qgsprocessingguiregistry.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingguiregistry.h
3 ---------------------
4 begin : April 2018
5 copyright : (C) 2018 by Matthias Kuhn
6 email : matthias@opengis.ch
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSPROCESSINGGUIREGISTRY_H
19#define QGSPROCESSINGGUIREGISTRY_H
20
21#include "qgis_gui.h"
22#include "qgis_sip.h"
26
27#include <QList>
28#include <QMap>
29
37class QgsProcessingModelComponent;
38class QgsProcessingGuiInternalModelConfigWidgetFactory;
41
52{
53 public:
60
68
76
85
103
112
125
135
149
168 QgsProcessingModelAlgorithm *model, const QString &childId, const QgsProcessingParameterDefinition *parameter, QgsProcessingContext &context
169 ) SIP_FACTORY;
170
193 const QString &type,
194 QgsProcessingContext &context,
195 const QgsProcessingParameterWidgetContext &widgetContext,
196 const QgsProcessingParameterDefinition *definition = nullptr,
197 const QgsProcessingAlgorithm *algorithm = nullptr
198 ) SIP_FACTORY;
199
209 QgsProcessingModelConfigWidget *createModelConfigWidgetForComponent( QgsProcessingModelComponent *component, QgsProcessingContext &context, const QgsProcessingParameterWidgetContext &widgetContext ) const
211
226
239
249 void registerProviderToolboxAction( const QString &providerId, QgsProcessingToolboxAction *action SIP_TRANSFER );
250
259 void deregisterProviderToolboxActions( const QString &providerId );
260
267 QList< QgsProcessingToolboxAction * > toolboxActionsForProvider( const QString &providerId ) const;
268
279
288 void deregisterProviderToolboxContextActions( const QString &providerId );
289
298
306 QList< QgsProcessingToolboxContextAction * > toolboxContextActionsForProvider( const QString &providerId ) const;
307
314 QList< QgsProcessingToolboxContextAction * > toolboxContextActions() const;
315
316 private:
317#ifdef SIP_RUN
319#endif
320 QList<QgsProcessingAlgorithmConfigurationWidgetFactory *> mAlgorithmConfigurationWidgetFactories;
321 QMap<QString, QgsProcessingParameterWidgetFactoryInterface *> mParameterWidgetFactories;
322
323 QList<QPointer<QgsProcessingModelConfigWidgetFactory>> mModelConfigWidgetFactories;
324 std::unique_ptr< QgsProcessingGuiInternalModelConfigWidgetFactory > mModelConfigWidgetFactory;
325
326 QgsProcessingWidgetContextGenerator *mWidgetContextGenerator = nullptr;
327
328 QMap< QString, QList< QgsProcessingToolboxAction * > > mProviderToolboxActions;
329 QMap< QString, QList< QgsProcessingToolboxContextAction * > > mProviderToolboxContextActions;
330};
331
332
333#ifndef SIP_RUN
335class GUI_EXPORT QgsProcessingGuiInternalModelConfigWidgetFactory : public QgsProcessingModelConfigWidgetFactory
336{
337 Q_OBJECT
338 public:
339 bool supportsComponent( QgsProcessingModelComponent *component ) const final;
340 QgsProcessingModelConfigWidget *createWidget( QgsProcessingModelComponent *component, QgsProcessingContext &context, const QgsProcessingParameterWidgetContext &widgetContext ) const final;
341};
343#endif
344#endif // QGSPROCESSINGGUIREGISTRY_H
ProcessingMode
Types of modes which Processing widgets can be created for.
Definition qgis.h:3890
A widget wrapper for Processing parameter value widgets.
Abstract base class for widgets which allow users to specify the properties of a Processing parameter...
Interface base class for factories for algorithm configuration widgets.
A configuration widget for processing algorithms allows providing additional configuration options di...
Abstract base class for processing algorithms.
Contains information about the context in which a processing algorithm is executed.
void addAlgorithmConfigurationWidgetFactory(QgsProcessingAlgorithmConfigurationWidgetFactory *factory)
Add a new configuration widget factory for customized algorithm configuration widgets.
bool addParameterWidgetFactory(QgsProcessingParameterWidgetFactoryInterface *factory)
Adds a parameter widget factory to the registry, allowing widget creation for parameters of the match...
void deregisterProviderToolboxContextActions(const QString &providerId)
Deregisters all toolbox context menu actions for a provider.
QList< QgsProcessingToolboxContextAction * > toolboxContextActions() const
Returns a list of all toolbox context menu actions registered.
void removeAlgorithmConfigurationWidgetFactory(QgsProcessingAlgorithmConfigurationWidgetFactory *factory)
Remove a configuration widget factory for customized algorithm configuration widgets.
void registerProviderToolboxAction(const QString &providerId, QgsProcessingToolboxAction *action)
Registers a toolbox action for a provider.
void registerModelConfigWidgetFactory(QgsProcessingModelConfigWidgetFactory *factory)
Register a new factory class for creating panel widgets that can be shown in the Processing model des...
void unregisterModelConfigWidgetFactory(QgsProcessingModelConfigWidgetFactory *factory)
Unregister a previously registered factory for creating panel widgets that can be shown in the Proces...
QgsProcessingAlgorithmConfigurationWidget * algorithmConfigurationWidget(const QgsProcessingAlgorithm *algorithm) const
Gets the configuration widget for an algorithm.
QList< QgsProcessingToolboxContextAction * > toolboxContextActionsForProvider(const QString &providerId) const
Returns a list of all toolbox context menu actions registered for a provider.
void deregisterProviderToolboxActions(const QString &providerId)
Deregisters all toolbox actions for a provider.
QgsAbstractProcessingParameterWidgetWrapper * createParameterWidgetWrapper(const QgsProcessingParameterDefinition *parameter, Qgis::ProcessingMode type)
Creates a new parameter widget wrapper for the given parameter.
Q_DECL_DEPRECATED void deregisterProviderToolboxContextAction(QgsProcessingToolboxContextAction *action)
Deregisters a context menu action.
void registerWidgetContextGenerator(QgsProcessingWidgetContextGenerator *generator)
Register a Processing widget context generator class that will be used to retrieve a widget context w...
QgsProcessingAbstractParameterDefinitionWidget * createParameterDefinitionWidget(const QString &type, QgsProcessingContext &context, const QgsProcessingParameterWidgetContext &widgetContext, const QgsProcessingParameterDefinition *definition=nullptr, const QgsProcessingAlgorithm *algorithm=nullptr)
Creates a new parameter definition widget allowing for configuration of an instance of a specific par...
QgsProcessingModelerParameterWidget * createModelerParameterWidget(QgsProcessingModelAlgorithm *model, const QString &childId, const QgsProcessingParameterDefinition *parameter, QgsProcessingContext &context)
Creates a new modeler parameter widget for the given parameter.
void removeParameterWidgetFactory(QgsProcessingParameterWidgetFactoryInterface *factory)
Removes a parameter widget factory from the registry.
void registerProviderToolboxContextAction(const QString &providerId, QgsProcessingToolboxContextAction *action)
Registers a toolbox context menu action for a provider.
QgsProcessingModelConfigWidget * createModelConfigWidgetForComponent(QgsProcessingModelComponent *component, QgsProcessingContext &context, const QgsProcessingParameterWidgetContext &widgetContext) const
Creates a new widget for configuring a Processing model component.
QList< QgsProcessingToolboxAction * > toolboxActionsForProvider(const QString &providerId) const
Returns a list of all toolbox actions registered for a provider.
Factory class for creating panel widgets that can be shown in the Processing model designer dialog.
A panel widget that can be shown in the Processing model designer dialog for configuring part of the ...
A widget for customising the value of Processing algorithm parameters inside a Processing model.
Base class for the definition of processing parameters.
Contains settings which reflect the context in which a Processing parameter widget is shown.
An interface for Processing widget wrapper factories.
A custom action to show in the Processing toolbox.
A custom action to show in the context menu for the Processing toolbox.
An interface for objects which can create Processing widget contexts.
virtual QgsProcessingParameterWidgetContext createWidgetContext()=0
This method needs to be reimplemented in all classes which implement this interface and return a Proc...
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into allowing algorithms to be written in pure substantial changes are required in order to port existing x Processing algorithms for QGIS x The most significant changes are outlined not GeoAlgorithm For algorithms which operate on features one by consider subclassing the QgsProcessingFeatureBasedAlgorithm class This class allows much of the boilerplate code for looping over features from a vector layer to be bypassed and instead requires implementation of a processFeature method Ensure that your algorithm(or algorithm 's parent class) implements the new pure virtual createInstance(self) call
#define SIP_DEPRECATED
Definition qgis_sip.h:113
#define SIP_TRANSFER
Definition qgis_sip.h:35
#define SIP_TRANSFERBACK
Definition qgis_sip.h:47
#define SIP_FACTORY
Definition qgis_sip.h:83