QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
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
6  email : [email protected]
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 
23 #include "qgis.h"
24 #include "qgis_sip.h"
25 #include <QObject>
26 
33 class CORE_EXPORT QgsProcessingParameterType
34 {
35  public:
36 
42  {
43  ExposeToModeler = 1
44  };
45  Q_DECLARE_FLAGS( ParameterFlags, ParameterFlag )
46 
47 
48 
51  virtual QgsProcessingParameterDefinition *create( const QString &name ) const = 0 SIP_FACTORY;
52 
56  virtual ~QgsProcessingParameterType() = default;
57 
63  virtual QString description() const = 0;
64 
69  virtual QString name() const = 0;
70 
71  // TODO QGIS 4.0 -- make pure virtual
72 
80  virtual QString pythonImportString() const { return QString(); }
81 
82  // TODO QGIS 4.0 -- make pure virtual
83 
90  virtual QString className() const
91  {
92  return name(); // this is wrong, but it's better than nothing for subclasses which don't implement this method
93  }
94 
98  virtual QString id() const = 0;
99 
104  virtual ParameterFlags flags() const;
105 
110  virtual QVariantMap metadata() const;
111 
122  virtual QStringList acceptedPythonTypes() const;
123 
135  virtual QStringList acceptedStringValues() const;
136 };
137 
138 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsProcessingParameterType::ParameterFlags )
139 
140 #endif // QGSPROCESSINGPARAMETERTYPE_H
qgis.h
QgsProcessingParameterDefinition
Base class for the definition of processing parameters.
Definition: qgsprocessingparameters.h:331
QgsProcessingParameterType
Makes metadata of processing parameters available.
Definition: qgsprocessingparametertype.h:34
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsProcessingParameterType::ParameterFlag
ParameterFlag
Each parameter type can offer a number of additional flags to finetune its behavior and capabilities.
Definition: qgsprocessingparametertype.h:42
QgsProcessingParameterType::id
virtual QString id() const =0
A static id for this type which will be used for storing this parameter type.
qgis_sip.h
Q_DECLARE_OPERATORS_FOR_FLAGS
Q_DECLARE_OPERATORS_FOR_FLAGS(QgsField::ConfigurationFlags) CORE_EXPORT QDataStream &operator<<(QDataStream &out
Writes the field to stream out. QGIS version compatibility is not guaranteed.
qgsprocessingparameters.h
QgsProcessingParameterType::className
virtual QString className() const
Returns the corresponding class name for the parameter type.
Definition: qgsprocessingparametertype.h:90