QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
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
23#include "qgis.h"
24#include "qgis_sip.h"
25#include <QObject>
26
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
138Q_DECLARE_OPERATORS_FOR_FLAGS( QgsProcessingParameterType::ParameterFlags )
139
140#endif // QGSPROCESSINGPARAMETERTYPE_H
Base class for the definition of processing parameters.
Makes metadata of processing parameters available.
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.
ParameterFlag
Each parameter type can offer a number of additional flags to finetune its behavior and capabilities.
#define SIP_FACTORY
Definition: qgis_sip.h:76
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.