QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsprocessingparametertype.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprocessingparametertype.h
3 ------------------------
4 begin : March 2018
5 copyright : (C) 2018 by Matthias Kuhn
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
19#ifndef QGSPROCESSINGPARAMETERTYPE_H
20#define QGSPROCESSINGPARAMETERTYPE_H
21
22#include "qgis.h"
23#include "qgis_sip.h"
25
26#include <QObject>
27
35{
36 public:
37
43 static QColor defaultModelColor();
44
48 virtual QgsProcessingParameterDefinition *create( const QString &name ) const = 0 SIP_FACTORY;
49
50 virtual ~QgsProcessingParameterType() = default;
51
57 virtual QString description() const = 0;
58
63 virtual QString name() const = 0;
64
65 // TODO QGIS 4.0 -- make pure virtual
66
74 virtual QString pythonImportString() const { return QString(); }
75
76 // TODO QGIS 4.0 -- make pure virtual
77
84 virtual QString className() const
85 {
86 return name(); // this is wrong, but it's better than nothing for subclasses which don't implement this method
87 }
88
92 virtual QString id() const = 0;
93
99
104 virtual QVariantMap metadata() const;
105
116 virtual QStringList acceptedPythonTypes() const;
117
129 virtual QStringList acceptedStringValues() const;
130
146 virtual QStringList acceptedParameterTypes() const = 0;
147
163 virtual QStringList acceptedOutputTypes() const = 0;
164
180 virtual QList<int> acceptedDataTypes( const QgsProcessingParameterDefinition *parameter ) const;
181
189 virtual QColor modelColor() const;
190
191};
192
193#endif // QGSPROCESSINGPARAMETERTYPE_H
QFlags< ProcessingParameterTypeFlag > ProcessingParameterTypeFlags
Flags which dictate the behavior of Processing parameter types.
Definition qgis.h:3751
Base class for the definition of processing parameters.
Makes metadata of processing parameters available.
virtual QVariantMap metadata() const
Metadata for this parameter type.
virtual QString name() const =0
A human readable and translatable short name for this parameter type.
virtual QStringList acceptedPythonTypes() const
Returns a list of the Python data types accepted as values for the parameter.
virtual QgsProcessingParameterDefinition * create(const QString &name) const =0
Creates a new parameter of this type.
virtual QString description() const =0
A human readable and translatable description for this parameter type.
virtual QStringList acceptedOutputTypes() const =0
Returns a list of compatible Processing output types for inputs for this parameter type.
virtual QColor modelColor() const
Returns the color to use for the parameter in model designer windows.
virtual QString id() const =0
A static id for this type which will be used for storing this parameter type.
virtual QString className() const
Returns the corresponding class name for the parameter type.
virtual QList< int > acceptedDataTypes(const QgsProcessingParameterDefinition *parameter) const
Returns a list of compatible Processing data types for inputs for this parameter type for the specifi...
virtual QStringList acceptedParameterTypes() const =0
Returns a list of compatible Processing parameter types for inputs for this parameter type.
virtual ~QgsProcessingParameterType()=default
virtual Qgis::ProcessingParameterTypeFlags flags() const
Determines if this parameter is available in the modeler.
virtual QStringList acceptedStringValues() const
Returns a descriptive list of the possible string values acceptable for the parameter.
virtual QString pythonImportString() const
Returns a valid Python import string for importing the corresponding parameter type,...
static QColor defaultModelColor()
Returns the default color for a processing parameter.
#define SIP_FACTORY
Definition qgis_sip.h:84