QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
qgsprocessingparameters.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsprocessingparameters.h
3  -------------------------
4  begin : April 2017
5  copyright : (C) 2017 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
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 QGSPROCESSINGPARAMETERS_H
19 #define QGSPROCESSINGPARAMETERS_H
20 
21 #include "qgis_core.h"
22 #include "qgis.h"
23 #include "qgsprocessing.h"
24 #include "qgsproperty.h"
26 #include "qgsfeaturesource.h"
27 #include "qgsprocessingutils.h"
28 #include <QMap>
29 #include <limits>
30 
33 class QgsRasterLayer;
34 class QgsMeshLayer;
35 class QgsVectorLayer;
36 class QgsFeatureSink;
41 class QgsPrintLayout;
42 class QgsLayoutItem;
43 
54 {
55  public:
56 
60  QgsProcessingFeatureSourceDefinition( const QString &source = QString(), bool selectedFeaturesOnly = false )
61  : source( QgsProperty::fromValue( source ) )
62  , selectedFeaturesOnly( selectedFeaturesOnly )
63  {}
64 
68  QgsProcessingFeatureSourceDefinition( const QgsProperty &source, bool selectedFeaturesOnly = false )
69  : source( source )
70  , selectedFeaturesOnly( selectedFeaturesOnly )
71  {}
72 
77 
82 
84  {
85  return source == other.source && selectedFeaturesOnly == other.selectedFeaturesOnly;
86  }
87 
89  {
90  return !( *this == other );
91  }
92 
94  operator QVariant() const
95  {
96  return QVariant::fromValue( *this );
97  }
98 
99 };
100 
102 
103 
113 {
114  public:
115 
121  QgsProcessingOutputLayerDefinition( const QString &sink = QString(), QgsProject *destinationProject = nullptr )
122  : sink( QgsProperty::fromValue( sink ) )
123  , destinationProject( destinationProject )
124  {}
125 
131  QgsProcessingOutputLayerDefinition( const QgsProperty &sink, QgsProject *destinationProject = nullptr )
132  : sink( sink )
133  , destinationProject( destinationProject )
134  {}
135 
140 
146  QgsProject *destinationProject = nullptr;
147 
152 
159  QVariantMap createOptions;
160 
167  QVariant toVariant() const;
168 
175  bool loadVariant( const QVariantMap &map );
176 
178  operator QVariant() const
179  {
180  return QVariant::fromValue( *this );
181  }
182 
183 };
184 
185 Q_DECLARE_METATYPE( QgsProcessingOutputLayerDefinition )
186 
187 
188 
189 
190 //
191 // Parameter definitions
192 //
193 
194 
207 {
208 
209 #ifdef SIP_RUN
211  if ( sipCpp->type() == QgsProcessingParameterBoolean::typeName() )
212  sipType = sipType_QgsProcessingParameterBoolean;
213  else if ( sipCpp->type() == QgsProcessingParameterCrs::typeName() )
214  sipType = sipType_QgsProcessingParameterCrs;
215  else if ( sipCpp->type() == QgsProcessingParameterMapLayer::typeName() )
216  sipType = sipType_QgsProcessingParameterMapLayer;
217  else if ( sipCpp->type() == QgsProcessingParameterExtent::typeName() )
218  sipType = sipType_QgsProcessingParameterExtent;
219  else if ( sipCpp->type() == QgsProcessingParameterPoint::typeName() )
220  sipType = sipType_QgsProcessingParameterPoint;
221  else if ( sipCpp->type() == QgsProcessingParameterFile::typeName() )
222  sipType = sipType_QgsProcessingParameterFile;
223  else if ( sipCpp->type() == QgsProcessingParameterMatrix::typeName() )
224  sipType = sipType_QgsProcessingParameterMatrix;
225  else if ( sipCpp->type() == QgsProcessingParameterMultipleLayers::typeName() )
226  sipType = sipType_QgsProcessingParameterMultipleLayers;
227  else if ( sipCpp->type() == QgsProcessingParameterNumber::typeName() )
228  sipType = sipType_QgsProcessingParameterNumber;
229  else if ( sipCpp->type() == QgsProcessingParameterDistance::typeName() )
230  sipType = sipType_QgsProcessingParameterDistance;
231  else if ( sipCpp->type() == QgsProcessingParameterScale::typeName() )
232  sipType = sipType_QgsProcessingParameterScale;
233  else if ( sipCpp->type() == QgsProcessingParameterRange::typeName() )
234  sipType = sipType_QgsProcessingParameterRange;
235  else if ( sipCpp->type() == QgsProcessingParameterRasterLayer::typeName() )
236  sipType = sipType_QgsProcessingParameterRasterLayer;
237  else if ( sipCpp->type() == QgsProcessingParameterMeshLayer::typeName() )
238  sipType = sipType_QgsProcessingParameterMeshLayer;
239  else if ( sipCpp->type() == QgsProcessingParameterEnum::typeName() )
240  sipType = sipType_QgsProcessingParameterEnum;
241  else if ( sipCpp->type() == QgsProcessingParameterString::typeName() )
242  sipType = sipType_QgsProcessingParameterString;
243  else if ( sipCpp->type() == QgsProcessingParameterExpression::typeName() )
244  sipType = sipType_QgsProcessingParameterExpression;
245  else if ( sipCpp->type() == QgsProcessingParameterAuthConfig::typeName() )
246  sipType = sipType_QgsProcessingParameterAuthConfig;
247  else if ( sipCpp->type() == QgsProcessingParameterVectorLayer::typeName() )
248  sipType = sipType_QgsProcessingParameterVectorLayer;
249  else if ( sipCpp->type() == QgsProcessingParameterField::typeName() )
250  sipType = sipType_QgsProcessingParameterField;
251  else if ( sipCpp->type() == QgsProcessingParameterFeatureSource::typeName() )
252  sipType = sipType_QgsProcessingParameterFeatureSource;
253  else if ( sipCpp->type() == QgsProcessingParameterFeatureSink::typeName() )
254  sipType = sipType_QgsProcessingParameterFeatureSink;
255  else if ( sipCpp->type() == QgsProcessingParameterVectorDestination::typeName() )
256  sipType = sipType_QgsProcessingParameterVectorDestination;
257  else if ( sipCpp->type() == QgsProcessingParameterRasterDestination::typeName() )
258  sipType = sipType_QgsProcessingParameterRasterDestination;
259  else if ( sipCpp->type() == QgsProcessingParameterFileDestination::typeName() )
260  sipType = sipType_QgsProcessingParameterFileDestination;
261  else if ( sipCpp->type() == QgsProcessingParameterFolderDestination::typeName() )
262  sipType = sipType_QgsProcessingParameterFolderDestination;
263  else if ( sipCpp->type() == QgsProcessingParameterBand::typeName() )
264  sipType = sipType_QgsProcessingParameterBand;
265  else if ( sipCpp->type() == QgsProcessingParameterLayout::typeName() )
266  sipType = sipType_QgsProcessingParameterLayout;
267  else if ( sipCpp->type() == QgsProcessingParameterLayoutItem::typeName() )
268  sipType = sipType_QgsProcessingParameterLayoutItem;
269  else if ( sipCpp->type() == QgsProcessingParameterColor::typeName() )
270  sipType = sipType_QgsProcessingParameterColor;
271  else
272  sipType = nullptr;
273  SIP_END
274 #endif
275 
276  public:
277 
279  enum Flag
280  {
281  FlagAdvanced = 1 << 1,
282  FlagHidden = 1 << 2,
283  FlagOptional = 1 << 3,
284  FlagIsModelOutput = 1 << 4,
285  };
286  Q_DECLARE_FLAGS( Flags, Flag )
287 
288 
291  QgsProcessingParameterDefinition( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
292  bool optional = false );
293 
294  virtual ~QgsProcessingParameterDefinition() = default;
295 
299  virtual QgsProcessingParameterDefinition *clone() const = 0 SIP_FACTORY;
300 
304  virtual QString type() const = 0;
305 
311  virtual bool isDestination() const { return false; }
312 
318  QString name() const { return mName; }
319 
325  void setName( const QString &name ) { mName = name; }
326 
332  QString description() const { return mDescription; }
333 
339  void setDescription( const QString &description ) { mDescription = description; }
340 
345  QVariant defaultValue() const { return mDefault; }
346 
352  void setDefaultValue( const QVariant &value ) { mDefault = value; }
353 
358  Flags flags() const { return mFlags; }
359 
364  void setFlags( Flags flags ) { mFlags = flags; }
365 
373  virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const;
374 
379  virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
380 
385  virtual QString asScriptCode() const;
386 
396  virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
397 
403  virtual QVariantMap toVariantMap() const;
404 
410  virtual bool fromVariantMap( const QVariantMap &map );
411 
418  SIP_SKIP QVariantMap metadata() const { return mMetadata; }
419 
425  QVariantMap &metadata() { return mMetadata; }
426 
432  void setMetadata( const QVariantMap &metadata ) { mMetadata = metadata; }
433 
438  virtual QStringList dependsOnOtherParameters() const { return QStringList(); }
439 
446 
452  QgsProcessingProvider *provider() const;
453 
458  virtual QString toolTip() const;
459 
467  bool isDynamic() const { return mIsDynamic; }
468 
476  void setIsDynamic( bool dynamic ) { mIsDynamic = dynamic; }
477 
484  QgsPropertyDefinition dynamicPropertyDefinition() const { return mPropertyDefinition; }
485 
492  void setDynamicPropertyDefinition( const QgsPropertyDefinition &definition ) { mPropertyDefinition = definition; }
493 
505  QString dynamicLayerParameterName() const { return mDynamicLayerParameterName; }
506 
518  void setDynamicLayerParameterName( const QString &name ) { mDynamicLayerParameterName = name; }
519 
533  QStringList additionalExpressionContextVariables() const { return mAdditionalExpressionVariables; }
534 
552  void setAdditionalExpressionContextVariables( const QStringList &variables ) { mAdditionalExpressionVariables = variables; }
553 
554  protected:
555 
557  QString mName;
558 
560  QString mDescription;
561 
563  QVariant mDefault;
564 
566  Flags mFlags;
567 
569  QVariantMap mMetadata;
570 
572  QgsProcessingAlgorithm *mAlgorithm = nullptr;
573 
575  bool mIsDynamic = false;
576 
579 
582 
585 
586  // To allow access to mAlgorithm. We don't want a public setter for this!
588 
589 };
590 
591 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsProcessingParameterDefinition::Flags )
592 
593 typedef QList< const QgsProcessingParameterDefinition * > QgsProcessingParameterDefinitions;
595 
614 class CORE_EXPORT QgsProcessingParameters
615 {
616 
617  public:
618 
623  static bool isDynamic( const QVariantMap &parameters, const QString &name );
624 
628  static QString parameterAsString( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
629 
634  static QString parameterAsString( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
635 
639  static QString parameterAsExpression( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
640 
645  static QString parameterAsExpression( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
646 
650  static double parameterAsDouble( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
651 
656  static double parameterAsDouble( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
657 
661  static int parameterAsInt( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
662 
667  static int parameterAsInt( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
668 
673  static QList<int> parameterAsInts( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
674 
679  static QList<int> parameterAsInts( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
680 
684  static int parameterAsEnum( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
685 
690  static int parameterAsEnum( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
691 
695  static QList<int> parameterAsEnums( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
696 
701  static QList<int> parameterAsEnums( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
702 
706  static bool parameterAsBool( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
707 
713  static bool parameterAsBoolean( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
714 
719  static bool parameterAsBool( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
720 
725  static bool parameterAsBoolean( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
726 
740  static QgsFeatureSink *parameterAsSink( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters,
741  const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs,
742  QgsProcessingContext &context, QString &destinationIdentifier SIP_OUT, QgsFeatureSink::SinkFlags sinkFlags = nullptr ) SIP_FACTORY;
743 
759  static QgsFeatureSink *parameterAsSink( const QgsProcessingParameterDefinition *definition, const QVariant &value,
760  const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs,
761  QgsProcessingContext &context, QString &destinationIdentifier SIP_OUT, QgsFeatureSink::SinkFlags sinkFlags = nullptr ) SIP_FACTORY;
762 
771  static QgsProcessingFeatureSource *parameterAsSource( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context ) SIP_FACTORY;
772 
783  static QgsProcessingFeatureSource *parameterAsSource( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context ) SIP_FACTORY;
784 
800  static QString parameterAsCompatibleSourceLayerPath( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters,
801  QgsProcessingContext &context, const QStringList &compatibleFormats, const QString &preferredFormat = QString( "shp" ), QgsProcessingFeedback *feedback = nullptr );
802 
832  static QString parameterAsCompatibleSourceLayerPathAndLayerName( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters,
833  QgsProcessingContext &context, const QStringList &compatibleFormats, const QString &preferredFormat = QString( "shp" ), QgsProcessingFeedback *feedback = nullptr, QString *layerName SIP_OUT = nullptr );
834 
842  static QgsMapLayer *parameterAsLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
843 
853  static QgsMapLayer *parameterAsLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
854 
862  static QgsRasterLayer *parameterAsRasterLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
863 
873  static QgsRasterLayer *parameterAsRasterLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
874 
878  static QString parameterAsOutputLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
879 
884  static QString parameterAsOutputLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
885 
889  static QString parameterAsFileOutput( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
890 
895  static QString parameterAsFileOutput( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
896 
904  static QgsVectorLayer *parameterAsVectorLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
905 
915  static QgsVectorLayer *parameterAsVectorLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
916 
926  static QgsMeshLayer *parameterAsMeshLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
927 
937  static QgsMeshLayer *parameterAsMeshLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
938 
939 
943  static QgsCoordinateReferenceSystem parameterAsCrs( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
944 
949  static QgsCoordinateReferenceSystem parameterAsCrs( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
950 
960  static QgsRectangle parameterAsExtent( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context,
962 
974  static QgsRectangle parameterAsExtent( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context,
976 
988  static QgsGeometry parameterAsExtentGeometry( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context,
990 
996  static QgsCoordinateReferenceSystem parameterAsExtentCrs( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
997 
1005  static QgsPointXY parameterAsPoint( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context,
1007 
1016  static QgsPointXY parameterAsPoint( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context,
1018 
1024  static QgsCoordinateReferenceSystem parameterAsPointCrs( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1025 
1032  static QgsCoordinateReferenceSystem parameterAsPointCrs( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1033 
1037  static QString parameterAsFile( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1038 
1043  static QString parameterAsFile( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1044 
1049  static QVariantList parameterAsMatrix( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1050 
1056  static QVariantList parameterAsMatrix( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1057 
1061  static QList< QgsMapLayer *> parameterAsLayerList( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1062 
1067  static QList< QgsMapLayer *> parameterAsLayerList( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1068 
1074  static QStringList parameterAsFileList( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1075 
1081  static QStringList parameterAsFileList( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1082 
1086  static QList<double> parameterAsRange( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1087 
1092  static QList<double> parameterAsRange( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1093 
1097  static QStringList parameterAsFields( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1098 
1103  static QStringList parameterAsFields( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1104 
1113  static QgsPrintLayout *parameterAsLayout( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1114 
1123  static QgsPrintLayout *parameterAsLayout( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1124 
1133  static QgsLayoutItem *parameterAsLayoutItem( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context, QgsPrintLayout *layout );
1134 
1143  static QgsLayoutItem *parameterAsLayoutItem( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context, QgsPrintLayout *layout );
1144 
1150  static QColor parameterAsColor( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1151 
1157  static QColor parameterAsColor( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1158 
1164  static QgsProcessingParameterDefinition *parameterFromVariantMap( const QVariantMap &map ) SIP_FACTORY;
1165 
1169  static QString descriptionFromName( const QString &name );
1170 
1176  static QgsProcessingParameterDefinition *parameterFromScriptCode( const QString &code ) SIP_FACTORY;
1177 
1178  private:
1179 
1180  static bool parseScriptCodeParameterOptions( const QString &code, bool &isOptional, QString &name, QString &type, QString &definition );
1181 };
1182 
1183 
1184 
1191 class CORE_EXPORT QgsProcessingParameterBoolean : public QgsProcessingParameterDefinition
1192 {
1193  public:
1194 
1198  QgsProcessingParameterBoolean( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
1199  bool optional = false );
1200 
1204  static QString typeName() { return QStringLiteral( "boolean" ); }
1205  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1206  QString type() const override { return typeName(); }
1207  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1208  QString asScriptCode() const override;
1209 
1213  static QgsProcessingParameterBoolean *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1214 };
1215 
1222 class CORE_EXPORT QgsProcessingParameterCrs : public QgsProcessingParameterDefinition
1223 {
1224  public:
1225 
1229  QgsProcessingParameterCrs( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
1230  bool optional = false );
1231 
1235  static QString typeName() { return QStringLiteral( "crs" ); }
1236  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1237  QString type() const override { return typeName(); }
1238  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1239  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1240 
1244  static QgsProcessingParameterCrs *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1245 
1246 };
1247 
1254 class CORE_EXPORT QgsProcessingParameterMapLayer : public QgsProcessingParameterDefinition
1255 {
1256  public:
1257 
1261  QgsProcessingParameterMapLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
1262  bool optional = false );
1263 
1267  static QString typeName() { return QStringLiteral( "layer" ); }
1268  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1269  QString type() const override { return typeName(); }
1270  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1271  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1272 
1276  static QgsProcessingParameterMapLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1277 
1278 };
1279 
1286 class CORE_EXPORT QgsProcessingParameterExtent : public QgsProcessingParameterDefinition
1287 {
1288  public:
1289 
1293  QgsProcessingParameterExtent( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
1294  bool optional = false );
1295 
1299  static QString typeName() { return QStringLiteral( "extent" ); }
1300  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1301  QString type() const override { return typeName(); }
1302  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1303  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1304 
1308  static QgsProcessingParameterExtent *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1309 
1310 };
1311 
1312 
1319 class CORE_EXPORT QgsProcessingParameterPoint : public QgsProcessingParameterDefinition
1320 {
1321  public:
1322 
1326  QgsProcessingParameterPoint( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
1327  bool optional = false );
1328 
1332  static QString typeName() { return QStringLiteral( "point" ); }
1333  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1334  QString type() const override { return typeName(); }
1335  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1336  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1337 
1341  static QgsProcessingParameterPoint *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1342 
1343 };
1344 
1351 class CORE_EXPORT QgsProcessingParameterFile : public QgsProcessingParameterDefinition
1352 {
1353  public:
1354 
1357  {
1358  File = 0,
1360  };
1361 
1369  QgsProcessingParameterFile( const QString &name, const QString &description = QString(), Behavior behavior = File, const QString &extension = QString(), const QVariant &defaultValue = QVariant(),
1370  bool optional = false, const QString &fileFilter = QString() );
1371 
1375  static QString typeName() { return QStringLiteral( "file" ); }
1376  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1377  QString type() const override { return typeName(); }
1378  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1379  QString asScriptCode() const override;
1381 
1386  Behavior behavior() const { return mBehavior; }
1387 
1392  void setBehavior( Behavior behavior ) { mBehavior = behavior; }
1393 
1401  QString extension() const { return mExtension; }
1402 
1412  void setExtension( const QString &extension );
1413 
1420  QString fileFilter() const;
1421 
1431  void setFileFilter( const QString &filter );
1432 
1433  QVariantMap toVariantMap() const override;
1434  bool fromVariantMap( const QVariantMap &map ) override;
1435 
1439  static QgsProcessingParameterFile *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition, Behavior behavior = File ) SIP_FACTORY;
1440 
1441  private:
1442 
1443  Behavior mBehavior = File;
1444  QString mExtension;
1445  QString mFileFilter;
1446 };
1447 
1454 class CORE_EXPORT QgsProcessingParameterMatrix : public QgsProcessingParameterDefinition
1455 {
1456  public:
1457 
1461  QgsProcessingParameterMatrix( const QString &name, const QString &description = QString(), int numberRows = 3,
1462  bool hasFixedNumberRows = false, const QStringList &headers = QStringList(),
1463  const QVariant &defaultValue = QVariant(),
1464  bool optional = false );
1465 
1469  static QString typeName() { return QStringLiteral( "matrix" ); }
1470  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1471  QString type() const override { return typeName(); }
1472  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1473  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1475 
1480  QStringList headers() const;
1481 
1486  void setHeaders( const QStringList &headers );
1487 
1494  int numberRows() const;
1495 
1502  void setNumberRows( int rows );
1503 
1509  bool hasFixedNumberRows() const;
1510 
1516  void setHasFixedNumberRows( bool hasFixedNumberRows );
1517 
1518  QVariantMap toVariantMap() const override;
1519  bool fromVariantMap( const QVariantMap &map ) override;
1520 
1524  static QgsProcessingParameterMatrix *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1525 
1526  private:
1527 
1528  QStringList mHeaders;
1529  int mNumberRows = 3;
1530  bool mFixedNumberRows = false;
1531 
1532 };
1533 
1540 class CORE_EXPORT QgsProcessingParameterMultipleLayers : public QgsProcessingParameterDefinition
1541 {
1542  public:
1543 
1547  QgsProcessingParameterMultipleLayers( const QString &name, const QString &description = QString(), QgsProcessing::SourceType layerType = QgsProcessing::TypeVectorAnyGeometry,
1548  const QVariant &defaultValue = QVariant(),
1549  bool optional = false );
1550 
1554  static QString typeName() { return QStringLiteral( "multilayer" ); }
1555  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1556  QString type() const override { return typeName(); }
1557  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1558  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1559  QString asScriptCode() const override;
1561 
1566  QgsProcessing::SourceType layerType() const;
1567 
1572  void setLayerType( QgsProcessing::SourceType type );
1573 
1579  int minimumNumberInputs() const;
1580 
1586  void setMinimumNumberInputs( int minimum );
1587 
1588  QVariantMap toVariantMap() const override;
1589  bool fromVariantMap( const QVariantMap &map ) override;
1590 
1594  static QgsProcessingParameterMultipleLayers *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1595 
1596  private:
1597 
1599  int mMinimumNumberInputs = 0;
1600 
1601 };
1602 
1621 class CORE_EXPORT QgsProcessingParameterNumber : public QgsProcessingParameterDefinition
1622 {
1623  public:
1624 
1626  enum Type
1627  {
1630  };
1631 
1635  explicit QgsProcessingParameterNumber( const QString &name, const QString &description = QString(),
1636  Type type = Integer,
1637  const QVariant &defaultValue = QVariant(),
1638  bool optional = false,
1639  double minValue = std::numeric_limits<double>::lowest() + 1,
1640  double maxValue = std::numeric_limits<double>::max()
1641  );
1642 
1646  static QString typeName() { return QStringLiteral( "number" ); }
1647  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1648  QString type() const override { return typeName(); }
1649  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1650  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1651  QString toolTip() const override;
1653 
1658  double minimum() const;
1659 
1664  void setMinimum( double minimum );
1665 
1670  double maximum() const;
1671 
1676  void setMaximum( double maximum );
1677 
1682  Type dataType() const;
1683 
1688  void setDataType( Type type );
1689 
1690  QVariantMap toVariantMap() const override;
1691  bool fromVariantMap( const QVariantMap &map ) override;
1692 
1696  static QgsProcessingParameterNumber *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1697 
1698  private:
1699 
1700  double mMin = std::numeric_limits<double>::lowest() + 1;
1701  double mMax = std::numeric_limits<double>::max();
1702  Type mDataType = Integer;
1703 };
1704 
1725 {
1726  public:
1727 
1731  explicit QgsProcessingParameterDistance( const QString &name, const QString &description = QString(),
1732  const QVariant &defaultValue = QVariant(),
1733  const QString &parentParameterName = QString(),
1734  bool optional = false,
1735  double minValue = std::numeric_limits<double>::lowest() + 1,
1736  double maxValue = std::numeric_limits<double>::max() );
1737 
1741  static QString typeName() { return QStringLiteral( "distance" ); }
1742 
1744 
1745  QString type() const override;
1746  QStringList dependsOnOtherParameters() const override;
1748 
1753  QString parentParameterName() const;
1754 
1759  void setParentParameterName( const QString &parentParameterName );
1760 
1767  QgsUnitTypes::DistanceUnit defaultUnit() const { return mDefaultUnit; }
1768 
1775  void setDefaultUnit( QgsUnitTypes::DistanceUnit unit ) { mDefaultUnit = unit; }
1776 
1777  QVariantMap toVariantMap() const override;
1778  bool fromVariantMap( const QVariantMap &map ) override;
1779 
1780  private:
1781 
1782  QString mParentParameterName;
1784 
1785 };
1786 
1798 {
1799  public:
1800 
1804  explicit QgsProcessingParameterScale( const QString &name, const QString &description = QString(),
1805  const QVariant &defaultValue = QVariant(),
1806  bool optional = false );
1807 
1811  static QString typeName() { return QStringLiteral( "scale" ); }
1812 
1813  QgsProcessingParameterScale *clone() const override SIP_FACTORY;
1814 
1815  QString type() const override;
1817 
1821  static QgsProcessingParameterScale *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1822 
1823 };
1824 
1831 class CORE_EXPORT QgsProcessingParameterRange : public QgsProcessingParameterDefinition
1832 {
1833  public:
1834 
1838  QgsProcessingParameterRange( const QString &name, const QString &description = QString(),
1840  const QVariant &defaultValue = QVariant(),
1841  bool optional = false );
1842 
1846  static QString typeName() { return QStringLiteral( "range" ); }
1847  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1848  QString type() const override { return typeName(); }
1849  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1850  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1852 
1857  QgsProcessingParameterNumber::Type dataType() const;
1858 
1863  void setDataType( QgsProcessingParameterNumber::Type dataType );
1864 
1865  QVariantMap toVariantMap() const override;
1866  bool fromVariantMap( const QVariantMap &map ) override;
1867 
1871  static QgsProcessingParameterRange *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1872 
1873  private:
1874 
1876 };
1877 
1884 class CORE_EXPORT QgsProcessingParameterRasterLayer : public QgsProcessingParameterDefinition
1885 {
1886  public:
1887 
1891  QgsProcessingParameterRasterLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
1892  bool optional = false );
1893 
1897  static QString typeName() { return QStringLiteral( "raster" ); }
1898  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1899  QString type() const override { return typeName(); }
1900  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1901  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1902 
1906  static QgsProcessingParameterRasterLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1907 
1908 };
1909 
1916 class CORE_EXPORT QgsProcessingParameterEnum : public QgsProcessingParameterDefinition
1917 {
1918  public:
1919 
1923  QgsProcessingParameterEnum( const QString &name, const QString &description = QString(), const QStringList &options = QStringList(),
1924  bool allowMultiple = false,
1925  const QVariant &defaultValue = QVariant(),
1926  bool optional = false );
1927 
1931  static QString typeName() { return QStringLiteral( "enum" ); }
1932  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1933  QString type() const override { return typeName(); }
1934  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1935  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1936  QString asScriptCode() const override;
1938 
1943  QStringList options() const;
1944 
1949  void setOptions( const QStringList &options );
1950 
1955  bool allowMultiple() const;
1956 
1961  void setAllowMultiple( bool allowMultiple );
1962 
1963  QVariantMap toVariantMap() const override;
1964  bool fromVariantMap( const QVariantMap &map ) override;
1965 
1969  static QgsProcessingParameterEnum *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1970 
1971  private:
1972 
1973  QStringList mOptions;
1974  bool mAllowMultiple = false;
1975 
1976 };
1977 
1984 class CORE_EXPORT QgsProcessingParameterString : public QgsProcessingParameterDefinition
1985 {
1986  public:
1987 
1991  QgsProcessingParameterString( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
1992  bool multiLine = false,
1993  bool optional = false );
1994 
1998  static QString typeName() { return QStringLiteral( "string" ); }
1999  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2000  QString type() const override { return typeName(); }
2001  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2002  QString asScriptCode() const override;
2004 
2009  bool multiLine() const;
2010 
2015  void setMultiLine( bool multiLine );
2016 
2017  QVariantMap toVariantMap() const override;
2018  bool fromVariantMap( const QVariantMap &map ) override;
2019 
2023  static QgsProcessingParameterString *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2024 
2025  private:
2026 
2027  bool mMultiLine = false;
2028 
2029 };
2030 
2031 
2044 class CORE_EXPORT QgsProcessingParameterAuthConfig : public QgsProcessingParameterDefinition
2045 {
2046  public:
2047 
2051  QgsProcessingParameterAuthConfig( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2052  bool optional = false );
2053 
2057  static QString typeName() { return QStringLiteral( "authcfg" ); }
2058  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2059  QString type() const override { return typeName(); }
2060  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2061  QString asScriptCode() const override;
2062 
2066  static QgsProcessingParameterAuthConfig *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2067 
2068 };
2069 
2076 class CORE_EXPORT QgsProcessingParameterExpression : public QgsProcessingParameterDefinition
2077 {
2078  public:
2079 
2083  QgsProcessingParameterExpression( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2084  const QString &parentLayerParameterName = QString(),
2085  bool optional = false );
2086 
2090  static QString typeName() { return QStringLiteral( "expression" ); }
2091  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2092  QString type() const override { return typeName(); }
2093  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2094  QStringList dependsOnOtherParameters() const override;
2096 
2101  QString parentLayerParameterName() const;
2102 
2107  void setParentLayerParameterName( const QString &parentLayerParameterName );
2108 
2109  QVariantMap toVariantMap() const override;
2110  bool fromVariantMap( const QVariantMap &map ) override;
2111 
2115  static QgsProcessingParameterExpression *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2116 
2117  private:
2118 
2119  QString mParentLayerParameterName;
2120 
2121 };
2122 
2123 
2131 {
2132  public:
2133 
2137  QgsProcessingParameterLimitedDataTypes( const QList< int > &types = QList< int >() );
2138 
2143  QList< int > dataTypes() const;
2144 
2149  void setDataTypes( const QList< int > &types );
2150 
2151  protected:
2152 
2154  QList< int > mDataTypes;
2155 };
2156 
2164 class CORE_EXPORT QgsProcessingParameterVectorLayer : public QgsProcessingParameterDefinition, public QgsProcessingParameterLimitedDataTypes
2165 {
2166  public:
2167 
2171  QgsProcessingParameterVectorLayer( const QString &name,
2172  const QString &description = QString(),
2173  const QList< int > &types = QList< int >(),
2174  const QVariant &defaultValue = QVariant(),
2175  bool optional = false );
2176 
2180  static QString typeName() { return QStringLiteral( "vector" ); }
2181  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2182  QString type() const override { return typeName(); }
2183  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2184  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2186 
2187  QVariantMap toVariantMap() const override;
2188  bool fromVariantMap( const QVariantMap &map ) override;
2189 
2193  static QgsProcessingParameterVectorLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2194 
2195 };
2196 
2203 class CORE_EXPORT QgsProcessingParameterMeshLayer : public QgsProcessingParameterDefinition
2204 {
2205  public:
2206 
2210  QgsProcessingParameterMeshLayer( const QString &name,
2211  const QString &description = QString(),
2212  const QVariant &defaultValue = QVariant(),
2213  bool optional = false );
2214 
2218  static QString typeName() { return QStringLiteral( "mesh" ); }
2219  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2220  QString type() const override { return typeName(); }
2221  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2222  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2223 
2227  static QgsProcessingParameterMeshLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2228 };
2229 
2236 class CORE_EXPORT QgsProcessingParameterField : public QgsProcessingParameterDefinition
2237 {
2238  public:
2239 
2242  {
2243  Any = -1,
2244  Numeric = 0,
2245  String = 1,
2246  DateTime = 2
2247  };
2248 
2252  QgsProcessingParameterField( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2253  const QString &parentLayerParameterName = QString(),
2254  DataType type = Any,
2255  bool allowMultiple = false,
2256  bool optional = false );
2257 
2261  static QString typeName() { return QStringLiteral( "field" ); }
2262  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2263  QString type() const override { return typeName(); }
2264  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2265  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2266  QString asScriptCode() const override;
2268  QStringList dependsOnOtherParameters() const override;
2269 
2274  QString parentLayerParameterName() const;
2275 
2280  void setParentLayerParameterName( const QString &parentLayerParameterName );
2281 
2286  DataType dataType() const;
2287 
2292  void setDataType( DataType type );
2293 
2298  bool allowMultiple() const;
2299 
2304  void setAllowMultiple( bool allowMultiple );
2305 
2306  QVariantMap toVariantMap() const override;
2307  bool fromVariantMap( const QVariantMap &map ) override;
2308 
2312  static QgsProcessingParameterField *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2313 
2314  private:
2315 
2316  QString mParentLayerParameterName;
2317  DataType mDataType = Any;
2318  bool mAllowMultiple = false;
2319 
2320 };
2321 
2322 
2329 class CORE_EXPORT QgsProcessingParameterFeatureSource : public QgsProcessingParameterDefinition, public QgsProcessingParameterLimitedDataTypes
2330 {
2331  public:
2332 
2336  QgsProcessingParameterFeatureSource( const QString &name, const QString &description = QString(),
2337  const QList< int > &types = QList< int >(),
2338  const QVariant &defaultValue = QVariant(), bool optional = false );
2339 
2343  static QString typeName() { return QStringLiteral( "source" ); }
2344  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2345  QString type() const override { return typeName(); }
2346  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2347  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2348  QString asScriptCode() const override;
2350 
2351  QVariantMap toVariantMap() const override;
2352  bool fromVariantMap( const QVariantMap &map ) override;
2353 
2357  static QgsProcessingParameterFeatureSource *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2358 
2359 };
2360 
2368 class CORE_EXPORT QgsProcessingDestinationParameter : public QgsProcessingParameterDefinition
2369 {
2370  public:
2371 
2378  QgsProcessingDestinationParameter( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2379  bool optional = false, bool createByDefault = true );
2380 
2381  bool isDestination() const override { return true; }
2382  QVariantMap toVariantMap() const override;
2383  bool fromVariantMap( const QVariantMap &map ) override;
2385 
2390  virtual QgsProcessingOutputDefinition *toOutputDefinition() const = 0 SIP_FACTORY;
2391 
2397  bool supportsNonFileBasedOutput() const { return mSupportsNonFileBasedOutputs; }
2398 
2404  void setSupportsNonFileBasedOutput( bool supportsNonFileBasedOutput ) { mSupportsNonFileBasedOutputs = supportsNonFileBasedOutput; }
2405 
2410  virtual QString defaultFileExtension() const = 0;
2411 
2417  virtual QString generateTemporaryDestination() const;
2418 
2424  bool createByDefault() const;
2425 
2431  void setCreateByDefault( bool createByDefault );
2432 
2433  protected:
2434 
2443  QgsProcessingProvider *originalProvider() const { return mOriginalProvider; }
2444 
2445  private:
2446 
2454  QgsProcessingProvider *mOriginalProvider = nullptr;
2455 
2456  bool mSupportsNonFileBasedOutputs = true;
2457  bool mCreateByDefault = true;
2458 
2459  friend class QgsProcessingModelAlgorithm;
2460  friend class TestQgsProcessing;
2461 };
2462 
2463 
2473 {
2474  public:
2475 
2482  QgsProcessingParameterFeatureSink( const QString &name, const QString &description = QString(), QgsProcessing::SourceType type = QgsProcessing::TypeVectorAnyGeometry, const QVariant &defaultValue = QVariant(),
2483  bool optional = false, bool createByDefault = true );
2484 
2488  static QString typeName() { return QStringLiteral( "sink" ); }
2489  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2490  QString type() const override { return typeName(); }
2491  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2492  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2493  QString asScriptCode() const override;
2495  QString defaultFileExtension() const override;
2497 
2503  virtual QStringList supportedOutputVectorLayerExtensions() const;
2504 
2509  QgsProcessing::SourceType dataType() const;
2510 
2515  bool hasGeometry() const;
2516 
2521  void setDataType( QgsProcessing::SourceType type );
2522 
2523  QVariantMap toVariantMap() const override;
2524  bool fromVariantMap( const QVariantMap &map ) override;
2525  QString generateTemporaryDestination() const override;
2526 
2530  static QgsProcessingParameterFeatureSink *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2531 
2532  private:
2533 
2535 };
2536 
2537 
2549 {
2550  public:
2551 
2558  QgsProcessingParameterVectorDestination( const QString &name, const QString &description = QString(), QgsProcessing::SourceType type = QgsProcessing::TypeVectorAnyGeometry, const QVariant &defaultValue = QVariant(),
2559  bool optional = false, bool createByDefault = true );
2560 
2564  static QString typeName() { return QStringLiteral( "vectorDestination" ); }
2565  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2566  QString type() const override { return typeName(); }
2567  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2568  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2569  QString asScriptCode() const override;
2571  QString defaultFileExtension() const override;
2573 
2579  virtual QStringList supportedOutputVectorLayerExtensions() const;
2580 
2585  QgsProcessing::SourceType dataType() const;
2586 
2591  bool hasGeometry() const;
2592 
2597  void setDataType( QgsProcessing::SourceType type );
2598 
2599  QVariantMap toVariantMap() const override;
2600  bool fromVariantMap( const QVariantMap &map ) override;
2601 
2605  static QgsProcessingParameterVectorDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2606 
2607 
2608  private:
2609 
2611 };
2612 
2621 {
2622  public:
2623 
2630  QgsProcessingParameterRasterDestination( const QString &name, const QString &description = QString(),
2631  const QVariant &defaultValue = QVariant(),
2632  bool optional = false,
2633  bool createByDefault = true );
2634 
2638  static QString typeName() { return QStringLiteral( "rasterDestination" ); }
2639  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2640  QString type() const override { return typeName(); }
2641  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2642  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2644  QString defaultFileExtension() const override;
2645 
2651  virtual QStringList supportedOutputRasterLayerExtensions() const;
2652 
2656  static QgsProcessingParameterRasterDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2657 };
2658 
2667 {
2668  public:
2669 
2676  QgsProcessingParameterFileDestination( const QString &name, const QString &description = QString(),
2677  const QString &fileFilter = QString(),
2678  const QVariant &defaultValue = QVariant(),
2679  bool optional = false,
2680  bool createByDefault = true );
2681 
2685  static QString typeName() { return QStringLiteral( "fileDestination" ); }
2686  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2687  QString type() const override { return typeName(); }
2688  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2689  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2691  QString defaultFileExtension() const override;
2693 
2698  QString fileFilter() const;
2699 
2704  void setFileFilter( const QString &filter );
2705 
2706  QVariantMap toVariantMap() const override;
2707  bool fromVariantMap( const QVariantMap &map ) override;
2708 
2712  static QgsProcessingParameterFileDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2713 
2714 
2715  private:
2716 
2717  QString mFileFilter;
2718 };
2719 
2729 {
2730  public:
2731 
2735  QgsProcessingParameterFolderDestination( const QString &name, const QString &description = QString(),
2736  const QVariant &defaultValue = QVariant(),
2737  bool optional = false,
2738  bool createByDefault = true );
2739 
2743  static QString typeName() { return QStringLiteral( "folderDestination" ); }
2744  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2745  QString type() const override { return typeName(); }
2746  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2748  QString defaultFileExtension() const override;
2749 
2753  static QgsProcessingParameterFolderDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2754 
2755 };
2756 
2763 class CORE_EXPORT QgsProcessingParameterBand : public QgsProcessingParameterDefinition
2764 {
2765  public:
2766 
2770  QgsProcessingParameterBand( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2771  const QString &parentLayerParameterName = QString(),
2772  bool optional = false,
2773  bool allowMultiple = false );
2774 
2778  static QString typeName() { return QStringLiteral( "band" ); }
2779  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2780  QString type() const override { return typeName(); }
2781  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2782  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2783  QString asScriptCode() const override;
2784  QStringList dependsOnOtherParameters() const override;
2786 
2791  QString parentLayerParameterName() const;
2792 
2797  void setParentLayerParameterName( const QString &parentLayerParameterName );
2798 
2799  QVariantMap toVariantMap() const override;
2800  bool fromVariantMap( const QVariantMap &map ) override;
2801 
2805  static QgsProcessingParameterBand *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2806 
2812  bool allowMultiple() const;
2813 
2819  void setAllowMultiple( bool allowMultiple );
2820 
2821  private:
2822 
2823  QString mParentLayerParameterName;
2824  bool mAllowMultiple = false;
2825 };
2826 
2838 class CORE_EXPORT QgsProcessingParameterLayout : public QgsProcessingParameterDefinition
2839 {
2840  public:
2841 
2845  QgsProcessingParameterLayout( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2846  bool optional = false );
2847 
2851  static QString typeName() { return QStringLiteral( "layout" ); }
2852  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2853  QString type() const override { return typeName(); }
2854  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2855  QString asScriptCode() const override;
2857 
2861  static QgsProcessingParameterLayout *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2862 
2863 };
2864 
2876 class CORE_EXPORT QgsProcessingParameterLayoutItem : public QgsProcessingParameterDefinition
2877 {
2878  public:
2879 
2883  QgsProcessingParameterLayoutItem( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2884  const QString &parentLayoutParameterName = QString(),
2885  int itemType = -1,
2886  bool optional = false );
2887 
2891  static QString typeName() { return QStringLiteral( "layoutitem" ); }
2892  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2893  QString type() const override { return typeName(); }
2894  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2895  QString asScriptCode() const override;
2897  QVariantMap toVariantMap() const override;
2898  bool fromVariantMap( const QVariantMap &map ) override;
2899  QStringList dependsOnOtherParameters() const override;
2900 
2904  static QgsProcessingParameterLayoutItem *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2905 
2910  QString parentLayoutParameterName() const;
2911 
2916  void setParentLayoutParameterName( const QString &name );
2917 
2925  int itemType() const;
2926 
2934  void setItemType( int type );
2935 
2936  private:
2937  QString mParentLayoutParameterName;
2938  int mItemType = -1;
2939 };
2940 
2950 class CORE_EXPORT QgsProcessingParameterColor : public QgsProcessingParameterDefinition
2951 {
2952  public:
2953 
2959  QgsProcessingParameterColor( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2960  bool opacityEnabled = true,
2961  bool optional = false );
2962 
2966  static QString typeName() { return QStringLiteral( "color" ); }
2967  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2968  QString type() const override { return typeName(); }
2969  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2970  QString asScriptCode() const override;
2972  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2973  QVariantMap toVariantMap() const override;
2974  bool fromVariantMap( const QVariantMap &map ) override;
2975 
2982  bool opacityEnabled() const;
2983 
2991  void setOpacityEnabled( bool enabled );
2992 
2996  static QgsProcessingParameterColor *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2997 
2998  private:
2999 
3000  bool mAllowOpacity = true;
3001 
3002 };
3003 
3004 // clazy:excludeall=qstring-allocations
3005 
3006 #endif // QGSPROCESSINGPARAMETERS_H
3007 
3008 
QString type() const override
Unique parameter type name.
QgsProperty sink
Sink/layer definition.
A boolean parameter for processing algorithms.
QList< const QgsProcessingParameterDefinition *> QgsProcessingParameterDefinitions
List of processing parameters.
static QString typeName()
Returns the type name for the parameter class.
QgsPropertyDefinition dynamicPropertyDefinition() const
Returns the property definition for dynamic properties.
An input file or folder parameter for processing algorithms.
A parameter for processing algorithms which accepts multiple map layers.
virtual QString asScriptCode() const
Returns the parameter definition encoded in a string which can be used within a Processing script...
void setAdditionalExpressionContextVariables(const QStringList &variables)
Sets a list of additional expression context variables which are available for use when evaluating th...
A rectangle specified with double values.
Definition: qgsrectangle.h:41
Base class for all map layer types.
Definition: qgsmaplayer.h:79
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.
QVariantMap & metadata()
Returns the parameter&#39;s freeform metadata.
Base class for providing feedback from a processing algorithm.
virtual bool fromVariantMap(const QVariantMap &map)
Restores this parameter to a QVariantMap.
Base class for graphical items within a QgsLayout.
Encapsulates settings relating to a feature sink or output raster layer for a processing algorithm...
QgsProcessingFeatureSourceDefinition(const QString &source=QString(), bool selectedFeaturesOnly=false)
Constructor for QgsProcessingFeatureSourceDefinition, accepting a static string source.
QString type() const override
Unique parameter type name.
QString type() const override
Unique parameter type name.
void setIsDynamic(bool dynamic)
Sets whether the parameter is dynamic, and can support data-defined values (i.e.
QString type() const override
Unique parameter type name.
A vector layer or feature source field parameter for processing algorithms.
QString type() const override
Unique parameter type name.
void setDynamicLayerParameterName(const QString &name)
Sets the name for the parameter for a layer linked to a dynamic parameter, or an empty string if this...
QString asPythonString(QgsProcessing::PythonOutputType outputType=QgsProcessing::PythonQgsProcessingAlgorithmSubclass) const override
Returns the parameter definition as a Python command which can be used within a Python Processing scr...
QString type() const override
Unique parameter type name.
QString mDynamicLayerParameterName
Linked vector layer parameter name for dynamic properties.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
QVariantMap metadata() const
Returns the parameter&#39;s freeform metadata.
static QString typeName()
Returns the type name for the parameter class.
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
static QString typeName()
Returns the type name for the parameter class.
QString type() const override
Unique parameter type name.
A print layout parameter, allowing users to select a print layout.
QString type() const override
Unique parameter type name.
A map layer parameter for processing algorithms.
A class to represent a 2D point.
Definition: qgspointxy.h:43
A color parameter for processing algorithms.
An expression parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
QString type() const override
Unique parameter type name.
virtual QString asPythonString(QgsProcessing::PythonOutputType outputType=QgsProcessing::PythonQgsProcessingAlgorithmSubclass) const
Returns the parameter definition as a Python command which can be used within a Python Processing scr...
bool isDestination() const override
Returns true if this parameter represents a file or layer destination, e.g.
An interface for objects which accept features via addFeature(s) methods.
PythonOutputType
Available Python output types.
Definition: qgsprocessing.h:58
QgsProcessingProvider * originalProvider() const
Original (source) provider which this parameter has been derived from.
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
QVariantMap mMetadata
Freeform metadata for parameter. Mostly used by widget wrappers to customize their appearance and beh...
QString type() const override
Unique parameter type name.
QgsFeatureSource subclass which proxies methods to an underlying QgsFeatureSource, modifying results according to the settings in a QgsProcessingContext.
Container of fields for a vector layer.
Definition: qgsfields.h:42
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:122
static QString typeName()
Returns the type name for the parameter class.
Abstract base class for processing providers.
virtual QVariantMap toVariantMap() const
Saves this parameter to a QVariantMap.
void setFlags(Flags flags)
Sets the flags associated with the parameter.
A raster band parameter for Processing algorithms.
QString type() const override
Unique parameter type name.
QVariantMap toVariantMap() const override
Saves this parameter to a QVariantMap.
QgsUnitTypes::DistanceUnit defaultUnit() const
Returns the default distance unit for the parameter.
virtual QString valueAsPythonString(const QVariant &value, QgsProcessingContext &context) const
Returns a string version of the parameter input value, which is suitable for use as an input paramete...
static QString typeName()
Returns the type name for the parameter class.
QStringList mAdditionalExpressionVariables
Additional expression context variables exposed for use by this parameter.
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.
void setDefaultUnit(QgsUnitTypes::DistanceUnit unit)
Sets the default distance unit for the parameter.
const QgsCoordinateReferenceSystem & crs
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.
Base class for all parameter definitions which represent file or layer destinations, e.g.
Abstract base class for processing algorithms.
A feature sink output for processing algorithms.
bool operator==(const QgsProcessingFeatureSourceDefinition &other)
bool selectedFeaturesOnly
true if only selected features in the source should be used by algorithms.
A raster layer destination parameter, for specifying the destination path for a raster layer created ...
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
A numeric range parameter for processing algorithms.
bool operator!=(const QgsProcessingFeatureSourceDefinition &other)
A double numeric parameter for map scale values.
void setDynamicPropertyDefinition(const QgsPropertyDefinition &definition)
Sets the property definition for dynamic properties.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
Can be inherited by parameters which require limits to their acceptable data types.
A raster layer parameter for processing algorithms.
Type
The WKB type describes the number of dimensions a geometry has.
Definition: qgswkbtypes.h:68
void setDescription(const QString &description)
Sets the description for the parameter.
virtual QString toolTip() const
Returns a formatted tooltip for use with the parameter, which gives helpful information like paramete...
static QgsProcessingParameterNumber * fromScriptCode(const QString &name, const QString &description, bool isOptional, const QString &definition)
Creates a new parameter using the definition from a script code.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
QgsProperty source
Source definition.
QString type() const override
Unique parameter type name.
An enum based parameter for processing algorithms, allowing for selection from predefined values...
Flags flags() const
Returns any flags associated with the parameter.
static QString typeName()
Returns the type name for the parameter class.
QVariant defaultValue() const
Returns the default value for the parameter.
#define SIP_SKIP
Definition: qgis_sip.h:126
const QString & typeName
QgsProcessingOutputLayerDefinition(const QgsProperty &sink, QgsProject *destinationProject=nullptr)
Constructor for QgsProcessingOutputLayerDefinition, accepting a QgsProperty sink/layer.
A collection of utilities for working with parameters when running a processing algorithm.
A double numeric parameter for distance values.
QString type() const override
Unique parameter type name.
#define SIP_END
Definition: qgis_sip.h:189
Q_DECLARE_METATYPE(QgsMeshTimeSettings)
Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc.
Definition: qgsproject.h:89
void setDefaultValue(const QVariant &value)
Sets the default value for the parameter.
QString type() const override
Unique parameter type name.
A vector layer (with or without geometry) parameter for processing algorithms.
virtual QString defaultFileExtension() const =0
Returns the default file extension for destination file paths associated with this parameter...
#define SIP_FACTORY
Definition: qgis_sip.h:76
A print layout item parameter, allowing users to select a particular item from a print layout...
A mesh layer parameter for processing algorithms.
A coordinate reference system parameter for processing algorithms.
A store for object properties.
Definition: qgsproperty.h:229
virtual QStringList dependsOnOtherParameters() const
Returns a list of other parameter names on which this parameter is dependent (e.g.
A rectangular map extent parameter for processing algorithms.
QString type() const override
Unique parameter type name.
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
A numeric parameter for processing algorithms.
A generic file based destination parameter, for specifying the destination path for a file (non-map l...
QString dynamicLayerParameterName() const
Returns the name of the parameter for a layer linked to a dynamic parameter, or an empty string if th...
Definition for a property.
Definition: qgsproperty.h:46
bool fromVariantMap(const QVariantMap &map) override
Restores this parameter to a QVariantMap.
QString name() const
Returns the name of the parameter.
QList< int > mDataTypes
List of acceptable data types for the parameter.
Encapsulates settings relating to a feature source input to a processing algorithm.
bool supportsNonFileBasedOutput() const
Returns true if the destination parameter supports non filed-based outputs, such as memory layers or ...
Behavior behavior() const
Returns the parameter behavior (e.g.
QString type() const override
Unique parameter type name.
virtual bool isDestination() const
Returns true if this parameter represents a file or layer destination, e.g.
DistanceUnit
Units of distance.
Definition: qgsunittypes.h:66
QString extension() const
Returns any specified file extension for the parameter.
QString type() const override
Unique parameter type name.
QString type() const override
Unique parameter type name.
Base class for the definition of processing outputs.
static QString typeName()
Returns the type name for the parameter class.
void setName(const QString &name)
Sets the name of the parameter.
Unknown distance unit.
Definition: qgsunittypes.h:77
A vector layer destination parameter, for specifying the destination path for a vector layer created ...
QString type() const override
Unique parameter type name.
bool isDynamic() const
Returns true if the parameter supports is dynamic, and can support data-defined values (i...
A point parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
An input feature source (such as vector layers) parameter for processing algorithms.
void setMetadata(const QVariantMap &metadata)
Sets the parameter&#39;s freeform metadata.
A folder destination parameter, for specifying the destination path for a folder created by the algor...
QString destinationName
Name to use for sink if it&#39;s to be loaded into a destination project.
#define SIP_OUT
Definition: qgis_sip.h:58
static QString typeName()
Returns the type name for the parameter class.
This class represents a coordinate reference system (CRS).
QgsProcessingOutputLayerDefinition(const QString &sink=QString(), QgsProject *destinationProject=nullptr)
Constructor for QgsProcessingOutputLayerDefinition, accepting a static sink/layer string...
Base class for the definition of processing parameters.
QStringList additionalExpressionContextVariables() const
Returns a list of additional expression context variables which are available for use when evaluating...
virtual bool checkValueIsAcceptable(const QVariant &input, QgsProcessingContext *context=nullptr) const
Checks whether the specified input value is acceptable for the parameter.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:172
QVariantMap toVariantMap() const override
Saves this parameter to a QVariantMap.
QVariant mDefault
Default value for parameter.
SourceType
Data source types enum.
Definition: qgsprocessing.h:44
QgsPropertyDefinition mPropertyDefinition
Data defined property definition.
QgsProcessingParameterDefinition * clone() const override
Creates a clone of the parameter definition.
static QString typeName()
Returns the type name for the parameter class.
QgsProcessingFeatureSourceDefinition(const QgsProperty &source, bool selectedFeaturesOnly=false)
Constructor for QgsProcessingFeatureSourceDefinition, accepting a QgsProperty source.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Definition: qgsmeshlayer.h:90
static QString typeName()
Returns the type name for the parameter class.
virtual QString generateTemporaryDestination() const
Generates a temporary destination value for this parameter.
void setSupportsNonFileBasedOutput(bool supportsNonFileBasedOutput)
Sets whether the destination parameter supports non filed-based outputs, such as memory layers or dir...
static QString typeName()
Returns the type name for the parameter class.
A table (matrix) parameter for processing algorithms.
Full Python QgsProcessingAlgorithm subclass.
Definition: qgsprocessing.h:60
Print layout, a QgsLayout subclass for static or atlas-based layouts.
QString type() const override
Unique parameter type name.
A string parameter for authentication configuration ID values.
QString mDescription
Parameter description.
QString asPythonString(QgsProcessing::PythonOutputType outputType=QgsProcessing::PythonQgsProcessingAlgorithmSubclass) const override
Returns the parameter definition as a Python command which can be used within a Python Processing scr...
bool fromVariantMap(const QVariantMap &map) override
Restores this parameter to a QVariantMap.
void setBehavior(Behavior behavior)
Sets the parameter behavior (e.g.
Represents a vector layer which manages a vector based data sets.
Contains information about the context in which a processing algorithm is executed.
A string parameter for processing algorithms.
QString type() const override
Unique parameter type name.
QString description() const
Returns the description for the parameter.
virtual QgsProcessingParameterDefinition * clone() const =0
Creates a clone of the parameter definition.
virtual QgsProcessingOutputDefinition * toOutputDefinition() const =0
Returns a new QgsProcessingOutputDefinition corresponding to the definition of the destination parame...
Any vector layer with geometry.
Definition: qgsprocessing.h:47
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.
QVariantMap createOptions
Map of optional sink/layer creation options, which are passed to the underlying provider when creatin...
QString type() const override
Unique parameter type name.
QString type() const override
Unique parameter type name.
static QString typeName()
Returns the type name for the parameter class.