QGIS API Documentation  3.21.0-Master (909859188c)
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 "qgsfilefiltergenerator.h"
30 #include <QMap>
31 #include <limits>
32 
35 class QgsRasterLayer;
36 class QgsMeshLayer;
37 class QgsVectorLayer;
38 class QgsFeatureSink;
43 class QgsPrintLayout;
44 class QgsLayoutItem;
45 class QgsPointCloudLayer;
46 class QgsAnnotationLayer;
47 
58 {
59  public:
60 
65  enum Flag
66  {
67  FlagOverrideDefaultGeometryCheck = 1 << 0,
68  FlagCreateIndividualOutputPerInputFeature = 1 << 1,
69  };
70  Q_DECLARE_FLAGS( Flags, Flag )
71 
72 
85  QgsProcessingFeatureSourceDefinition( const QString &source = QString(), bool selectedFeaturesOnly = false, long long featureLimit = -1,
86  QgsProcessingFeatureSourceDefinition::Flags flags = QgsProcessingFeatureSourceDefinition::Flags(), QgsFeatureRequest::InvalidGeometryCheck geometryCheck = QgsFeatureRequest::GeometryAbortOnInvalid )
87  : source( QgsProperty::fromValue( source ) )
88  , selectedFeaturesOnly( selectedFeaturesOnly )
89  , featureLimit( featureLimit )
90  , flags( flags )
91  , geometryCheck( geometryCheck )
92  {}
93 
107  QgsProcessingFeatureSourceDefinition( const QgsProperty &source, bool selectedFeaturesOnly = false, long long featureLimit = -1,
108  QgsProcessingFeatureSourceDefinition::Flags flags = QgsProcessingFeatureSourceDefinition::Flags(), QgsFeatureRequest::InvalidGeometryCheck geometryCheck = QgsFeatureRequest::GeometryAbortOnInvalid )
109  : source( source )
110  , selectedFeaturesOnly( selectedFeaturesOnly )
111  , featureLimit( featureLimit )
112  , flags( flags )
113  , geometryCheck( geometryCheck )
114  {}
115 
120 
125 
132  long long featureLimit = -1;
133 
139  Flags flags = Flags();
140 
150 
157  QVariant toVariant() const;
158 
165  bool loadVariant( const QVariantMap &map );
166 
167  // TODO c++20 - replace with = default
169  {
170  return source == other.source
171  && selectedFeaturesOnly == other.selectedFeaturesOnly
172  && featureLimit == other.featureLimit
173  && flags == other.flags
174  && geometryCheck == other.geometryCheck;
175  }
176 
178  {
179  return !( *this == other );
180  }
181 
183  operator QVariant() const
184  {
185  return QVariant::fromValue( *this );
186  }
187 
188 };
189 
191 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsProcessingFeatureSourceDefinition::Flags )
192 
193 
203 {
204  public:
205 
211  QgsProcessingOutputLayerDefinition( const QString &sink = QString(), QgsProject *destinationProject = nullptr )
212  : sink( QgsProperty::fromValue( sink ) )
213  , destinationProject( destinationProject )
214  {}
215 
221  QgsProcessingOutputLayerDefinition( const QgsProperty &sink, QgsProject *destinationProject = nullptr )
222  : sink( sink )
223  , destinationProject( destinationProject )
224  {}
225 
230 
236  QgsProject *destinationProject = nullptr;
237 
242 
249  QVariantMap createOptions;
250 
257  bool useRemapping() const { return mUseRemapping; }
258 
266  QgsRemappingSinkDefinition remappingDefinition() const { return mRemappingDefinition; }
267 
278  void setRemappingDefinition( const QgsRemappingSinkDefinition &definition );
279 
286  QVariant toVariant() const;
287 
294  bool loadVariant( const QVariantMap &map );
295 
297  operator QVariant() const
298  {
299  return QVariant::fromValue( *this );
300  }
301 
302  // TODO c++20 - replace with = default
303  bool operator==( const QgsProcessingOutputLayerDefinition &other ) const;
304  bool operator!=( const QgsProcessingOutputLayerDefinition &other ) const;
305 
306  private:
307 
308  bool mUseRemapping = false;
309  QgsRemappingSinkDefinition mRemappingDefinition;
310 
311 };
312 
314 
315 
316 
317 
318 //
319 // Parameter definitions
320 //
321 
322 
335 {
336 
337 #ifdef SIP_RUN
338  % TypeHeaderCode
345  % End
347  if ( sipCpp->type() == QgsProcessingParameterBoolean::typeName() )
348  sipType = sipType_QgsProcessingParameterBoolean;
349  else if ( sipCpp->type() == QgsProcessingParameterCrs::typeName() )
350  sipType = sipType_QgsProcessingParameterCrs;
351  else if ( sipCpp->type() == QgsProcessingParameterMapLayer::typeName() )
352  sipType = sipType_QgsProcessingParameterMapLayer;
353  else if ( sipCpp->type() == QgsProcessingParameterExtent::typeName() )
354  sipType = sipType_QgsProcessingParameterExtent;
355  else if ( sipCpp->type() == QgsProcessingParameterPoint::typeName() )
356  sipType = sipType_QgsProcessingParameterPoint;
357  else if ( sipCpp->type() == QgsProcessingParameterGeometry::typeName() )
358  sipType = sipType_QgsProcessingParameterGeometry;
359  else if ( sipCpp->type() == QgsProcessingParameterFile::typeName() )
360  sipType = sipType_QgsProcessingParameterFile;
361  else if ( sipCpp->type() == QgsProcessingParameterMatrix::typeName() )
362  sipType = sipType_QgsProcessingParameterMatrix;
363  else if ( sipCpp->type() == QgsProcessingParameterMultipleLayers::typeName() )
364  sipType = sipType_QgsProcessingParameterMultipleLayers;
365  else if ( sipCpp->type() == QgsProcessingParameterNumber::typeName() )
366  sipType = sipType_QgsProcessingParameterNumber;
367  else if ( sipCpp->type() == QgsProcessingParameterDistance::typeName() )
368  sipType = sipType_QgsProcessingParameterDistance;
369  else if ( sipCpp->type() == QgsProcessingParameterDuration::typeName() )
370  sipType = sipType_QgsProcessingParameterDuration;
371  else if ( sipCpp->type() == QgsProcessingParameterScale::typeName() )
372  sipType = sipType_QgsProcessingParameterScale;
373  else if ( sipCpp->type() == QgsProcessingParameterRange::typeName() )
374  sipType = sipType_QgsProcessingParameterRange;
375  else if ( sipCpp->type() == QgsProcessingParameterRasterLayer::typeName() )
376  sipType = sipType_QgsProcessingParameterRasterLayer;
377  else if ( sipCpp->type() == QgsProcessingParameterMeshLayer::typeName() )
378  sipType = sipType_QgsProcessingParameterMeshLayer;
379  else if ( sipCpp->type() == QgsProcessingParameterEnum::typeName() )
380  sipType = sipType_QgsProcessingParameterEnum;
381  else if ( sipCpp->type() == QgsProcessingParameterString::typeName() )
382  sipType = sipType_QgsProcessingParameterString;
383  else if ( sipCpp->type() == QgsProcessingParameterExpression::typeName() )
384  sipType = sipType_QgsProcessingParameterExpression;
385  else if ( sipCpp->type() == QgsProcessingParameterAuthConfig::typeName() )
386  sipType = sipType_QgsProcessingParameterAuthConfig;
387  else if ( sipCpp->type() == QgsProcessingParameterVectorLayer::typeName() )
388  sipType = sipType_QgsProcessingParameterVectorLayer;
389  else if ( sipCpp->type() == QgsProcessingParameterField::typeName() )
390  sipType = sipType_QgsProcessingParameterField;
391  else if ( sipCpp->type() == QgsProcessingParameterFeatureSource::typeName() )
392  sipType = sipType_QgsProcessingParameterFeatureSource;
393  else if ( sipCpp->type() == QgsProcessingParameterFeatureSink::typeName() )
394  sipType = sipType_QgsProcessingParameterFeatureSink;
395  else if ( sipCpp->type() == QgsProcessingParameterVectorDestination::typeName() )
396  sipType = sipType_QgsProcessingParameterVectorDestination;
397  else if ( sipCpp->type() == QgsProcessingParameterRasterDestination::typeName() )
398  sipType = sipType_QgsProcessingParameterRasterDestination;
399  else if ( sipCpp->type() == QgsProcessingParameterFileDestination::typeName() )
400  sipType = sipType_QgsProcessingParameterFileDestination;
401  else if ( sipCpp->type() == QgsProcessingParameterFolderDestination::typeName() )
402  sipType = sipType_QgsProcessingParameterFolderDestination;
403  else if ( sipCpp->type() == QgsProcessingParameterBand::typeName() )
404  sipType = sipType_QgsProcessingParameterBand;
405  else if ( sipCpp->type() == QgsProcessingParameterLayout::typeName() )
406  sipType = sipType_QgsProcessingParameterLayout;
407  else if ( sipCpp->type() == QgsProcessingParameterLayoutItem::typeName() )
408  sipType = sipType_QgsProcessingParameterLayoutItem;
409  else if ( sipCpp->type() == QgsProcessingParameterColor::typeName() )
410  sipType = sipType_QgsProcessingParameterColor;
411  else if ( sipCpp->type() == QgsProcessingParameterCoordinateOperation::typeName() )
412  sipType = sipType_QgsProcessingParameterCoordinateOperation;
413  else if ( sipCpp->type() == QgsProcessingParameterMapTheme::typeName() )
414  sipType = sipType_QgsProcessingParameterMapTheme;
415  else if ( sipCpp->type() == QgsProcessingParameterDateTime::typeName() )
416  sipType = sipType_QgsProcessingParameterDateTime;
417  else if ( sipCpp->type() == QgsProcessingParameterProviderConnection::typeName() )
418  sipType = sipType_QgsProcessingParameterProviderConnection;
419  else if ( sipCpp->type() == QgsProcessingParameterDatabaseSchema::typeName() )
420  sipType = sipType_QgsProcessingParameterDatabaseSchema;
421  else if ( sipCpp->type() == QgsProcessingParameterDatabaseTable::typeName() )
422  sipType = sipType_QgsProcessingParameterDatabaseTable;
423  else if ( sipCpp->type() == QgsProcessingParameterFieldMapping::typeName() )
424  sipType = sipType_QgsProcessingParameterFieldMapping;
425  else if ( sipCpp->type() == QgsProcessingParameterTinInputLayers::typeName() )
426  sipType = sipType_QgsProcessingParameterTinInputLayers;
427  else if ( sipCpp->type() == QgsProcessingParameterVectorTileWriterLayers::typeName() )
428  sipType = sipType_QgsProcessingParameterVectorTileWriterLayers;
429  else if ( sipCpp->type() == QgsProcessingParameterDxfLayers::typeName() )
430  sipType = sipType_QgsProcessingParameterDxfLayers;
431  else if ( sipCpp->type() == QgsProcessingParameterMeshDatasetGroups::typeName() )
432  sipType = sipType_QgsProcessingParameterMeshDatasetGroups;
433  else if ( sipCpp->type() == QgsProcessingParameterMeshDatasetTime::typeName() )
434  sipType = sipType_QgsProcessingParameterMeshDatasetTime;
435  else if ( sipCpp->type() == QgsProcessingParameterPointCloudLayer::typeName() )
436  sipType = sipType_QgsProcessingParameterPointCloudLayer;
437  else if ( sipCpp->type() == QgsProcessingParameterAnnotationLayer::typeName() )
438  sipType = sipType_QgsProcessingParameterAnnotationLayer;
439  else
440  sipType = nullptr;
441  SIP_END
442 #endif
443 
444  public:
445 
447  enum Flag
448  {
449  FlagAdvanced = 1 << 1,
450  FlagHidden = 1 << 2,
451  FlagOptional = 1 << 3,
452  FlagIsModelOutput = 1 << 4,
453  };
454  Q_DECLARE_FLAGS( Flags, Flag )
455 
456 
459  QgsProcessingParameterDefinition( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
460  bool optional = false, const QString &help = QString() );
461 
463 
468 
472  virtual QString type() const = 0;
473 
479  virtual bool isDestination() const { return false; }
480 
486  QString name() const { return mName; }
487 
493  void setName( const QString &name ) { mName = name; }
494 
500  QString description() const { return mDescription; }
501 
507  void setDescription( const QString &description ) { mDescription = description; }
508 
518  QString help() const { return mHelp; }
519 
529  void setHelp( const QString &help ) { mHelp = help; }
530 
537  QVariant defaultValue() const { return mDefault; }
538 
545  void setDefaultValue( const QVariant &value ) { mDefault = value; }
546 
559  QVariant guiDefaultValueOverride() const { return mGuiDefault; }
560 
576  void setGuiDefaultValueOverride( const QVariant &value ) { mGuiDefault = value; }
577 
586  QVariant defaultValueForGui() const { return mGuiDefault.isValid() ? mGuiDefault : mDefault; }
587 
592  Flags flags() const { return mFlags; }
593 
598  void setFlags( Flags flags ) { mFlags = flags; }
599 
607  virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const;
608 
613  virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;
614 
620  virtual QString valueAsPythonComment( const QVariant &value, QgsProcessingContext &context ) const;
621 
626  virtual QString asScriptCode() const;
627 
637  virtual QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const;
638 
644  virtual QVariantMap toVariantMap() const;
645 
651  virtual bool fromVariantMap( const QVariantMap &map );
652 
659  SIP_SKIP QVariantMap metadata() const { return mMetadata; }
660 
666  QVariantMap &metadata() { return mMetadata; }
667 
673  void setMetadata( const QVariantMap &metadata ) { mMetadata = metadata; }
674 
679  virtual QStringList dependsOnOtherParameters() const { return QStringList(); }
680 
687 
693  QgsProcessingProvider *provider() const;
694 
699  virtual QString toolTip() const;
700 
708  bool isDynamic() const { return mIsDynamic; }
709 
717  void setIsDynamic( bool dynamic ) { mIsDynamic = dynamic; }
718 
725  QgsPropertyDefinition dynamicPropertyDefinition() const { return mPropertyDefinition; }
726 
733  void setDynamicPropertyDefinition( const QgsPropertyDefinition &definition ) { mPropertyDefinition = definition; }
734 
746  QString dynamicLayerParameterName() const { return mDynamicLayerParameterName; }
747 
759  void setDynamicLayerParameterName( const QString &name ) { mDynamicLayerParameterName = name; }
760 
774  QStringList additionalExpressionContextVariables() const { return mAdditionalExpressionVariables; }
775 
793  void setAdditionalExpressionContextVariables( const QStringList &variables ) { mAdditionalExpressionVariables = variables; }
794 
795  protected:
796 
798  QString mName;
799 
801  QString mDescription;
802 
804  QString mHelp;
805 
807  QVariant mDefault;
808 
810  QVariant mGuiDefault;
811 
813  Flags mFlags;
814 
816  QVariantMap mMetadata;
817 
819  QgsProcessingAlgorithm *mAlgorithm = nullptr;
820 
822  bool mIsDynamic = false;
823 
826 
829 
832 
833  // To allow access to mAlgorithm. We don't want a public setter for this!
835 
836 };
837 
838 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsProcessingParameterDefinition::Flags )
839 
840 typedef QList< const QgsProcessingParameterDefinition * > QgsProcessingParameterDefinitions;
842 
861 class CORE_EXPORT QgsProcessingParameters
862 {
863 
864  public:
865 
870  static bool isDynamic( const QVariantMap &parameters, const QString &name );
871 
875  static QString parameterAsString( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
876 
881  static QString parameterAsString( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
882 
886  static QString parameterAsExpression( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
887 
892  static QString parameterAsExpression( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
893 
897  static double parameterAsDouble( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
898 
903  static double parameterAsDouble( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
904 
908  static int parameterAsInt( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
909 
914  static int parameterAsInt( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
915 
920  static QList<int> parameterAsInts( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
921 
926  static QList<int> parameterAsInts( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
927 
936  static QDateTime parameterAsDateTime( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
937 
946  static QDateTime parameterAsDateTime( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
947 
956  static QDate parameterAsDate( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
957 
966  static QDate parameterAsDate( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
967 
976  static QTime parameterAsTime( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
977 
986  static QTime parameterAsTime( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
987 
991  static int parameterAsEnum( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
992 
997  static int parameterAsEnum( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
998 
1002  static QList<int> parameterAsEnums( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1003 
1008  static QList<int> parameterAsEnums( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1009 
1014  static QString parameterAsEnumString( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1015 
1020  static QString parameterAsEnumString( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1021 
1026  static QStringList parameterAsEnumStrings( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1027 
1032  static QStringList parameterAsEnumStrings( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1033 
1037  static bool parameterAsBool( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1038 
1044  static bool parameterAsBoolean( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1045 
1050  static bool parameterAsBool( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1051 
1056  static bool parameterAsBoolean( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1057 
1075  static QgsFeatureSink *parameterAsSink( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters,
1076  const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs,
1077  QgsProcessingContext &context, QString &destinationIdentifier SIP_OUT, QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(), const QVariantMap &createOptions = QVariantMap(), const QStringList &datasourceOptions = QStringList(), const QStringList &layerOptions = QStringList() ) SIP_FACTORY;
1078 
1098  static QgsFeatureSink *parameterAsSink( const QgsProcessingParameterDefinition *definition, const QVariant &value,
1099  const QgsFields &fields, QgsWkbTypes::Type geometryType, const QgsCoordinateReferenceSystem &crs,
1100  QgsProcessingContext &context, QString &destinationIdentifier SIP_OUT, QgsFeatureSink::SinkFlags sinkFlags = QgsFeatureSink::SinkFlags(), const QVariantMap &createOptions = QVariantMap(), const QStringList &datasourceOptions = QStringList(), const QStringList &layerOptions = QStringList() ) SIP_THROW( QgsProcessingException ) SIP_FACTORY;
1101 
1110  static QgsProcessingFeatureSource *parameterAsSource( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context ) SIP_FACTORY;
1111 
1122  static QgsProcessingFeatureSource *parameterAsSource( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context ) SIP_FACTORY;
1123 
1139  static QString parameterAsCompatibleSourceLayerPath( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters,
1140  QgsProcessingContext &context, const QStringList &compatibleFormats, const QString &preferredFormat = QString( "shp" ), QgsProcessingFeedback *feedback = nullptr );
1141 
1171  static QString parameterAsCompatibleSourceLayerPathAndLayerName( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters,
1172  QgsProcessingContext &context, const QStringList &compatibleFormats, const QString &preferredFormat = QString( "shp" ), QgsProcessingFeedback *feedback = nullptr, QString *layerName SIP_OUT = nullptr );
1173 
1181  static QgsMapLayer *parameterAsLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingUtils::LayerHint layerHint = QgsProcessingUtils::LayerHint::UnknownType );
1182 
1192  static QgsMapLayer *parameterAsLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context, QgsProcessingUtils::LayerHint layerHint = QgsProcessingUtils::LayerHint::UnknownType );
1193 
1201  static QgsRasterLayer *parameterAsRasterLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1202 
1212  static QgsRasterLayer *parameterAsRasterLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1213 
1217  static QString parameterAsOutputLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1218 
1223  static QString parameterAsOutputLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1224 
1228  static QString parameterAsFileOutput( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1229 
1234  static QString parameterAsFileOutput( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1235 
1243  static QgsVectorLayer *parameterAsVectorLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1244 
1254  static QgsVectorLayer *parameterAsVectorLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1255 
1265  static QgsMeshLayer *parameterAsMeshLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1266 
1276  static QgsMeshLayer *parameterAsMeshLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1277 
1281  static QgsCoordinateReferenceSystem parameterAsCrs( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1282 
1287  static QgsCoordinateReferenceSystem parameterAsCrs( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1288 
1298  static QgsRectangle parameterAsExtent( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context,
1300 
1312  static QgsRectangle parameterAsExtent( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context,
1314 
1326  static QgsGeometry parameterAsExtentGeometry( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context,
1328 
1334  static QgsCoordinateReferenceSystem parameterAsExtentCrs( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1335 
1341  static QgsCoordinateReferenceSystem parameterAsExtentCrs( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1342 
1343 
1351  static QgsPointXY parameterAsPoint( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context,
1353 
1362  static QgsPointXY parameterAsPoint( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context,
1364 
1370  static QgsCoordinateReferenceSystem parameterAsPointCrs( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1371 
1378  static QgsCoordinateReferenceSystem parameterAsPointCrs( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1379 
1385  static QgsGeometry parameterAsGeometry( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
1386 
1392  static QgsGeometry parameterAsGeometry( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
1393 
1400  static QgsCoordinateReferenceSystem parameterAsGeometryCrs( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1401 
1408  static QgsCoordinateReferenceSystem parameterAsGeometryCrs( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1409 
1413  static QString parameterAsFile( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1414 
1419  static QString parameterAsFile( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1420 
1425  static QVariantList parameterAsMatrix( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1426 
1432  static QVariantList parameterAsMatrix( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1433 
1437  static QList< QgsMapLayer *> parameterAsLayerList( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1438 
1443  static QList< QgsMapLayer *> parameterAsLayerList( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1444 
1450  static QStringList parameterAsFileList( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1451 
1457  static QStringList parameterAsFileList( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1458 
1462  static QList<double> parameterAsRange( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1463 
1468  static QList<double> parameterAsRange( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1469 
1473  static QStringList parameterAsFields( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1474 
1479  static QStringList parameterAsFields( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1480 
1489  static QgsPrintLayout *parameterAsLayout( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1490 
1499  static QgsPrintLayout *parameterAsLayout( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1500 
1509  static QgsLayoutItem *parameterAsLayoutItem( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context, QgsPrintLayout *layout );
1510 
1519  static QgsLayoutItem *parameterAsLayoutItem( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context, QgsPrintLayout *layout );
1520 
1526  static QColor parameterAsColor( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1527 
1533  static QColor parameterAsColor( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1534 
1540  static QString parameterAsConnectionName( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1541 
1547  static QString parameterAsConnectionName( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1548 
1554  static QString parameterAsSchema( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1555 
1561  static QString parameterAsSchema( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1562 
1568  static QString parameterAsDatabaseTableName( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, const QgsProcessingContext &context );
1569 
1575  static QString parameterAsDatabaseTableName( const QgsProcessingParameterDefinition *definition, const QVariant &value, const QgsProcessingContext &context );
1576 
1586  static QgsPointCloudLayer *parameterAsPointCloudLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1587 
1597  static QgsPointCloudLayer *parameterAsPointCloudLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1598 
1612  static QgsAnnotationLayer *parameterAsAnnotationLayer( const QgsProcessingParameterDefinition *definition, const QVariantMap &parameters, QgsProcessingContext &context );
1613 
1627  static QgsAnnotationLayer *parameterAsAnnotationLayer( const QgsProcessingParameterDefinition *definition, const QVariant &value, QgsProcessingContext &context );
1628 
1634  static QgsProcessingParameterDefinition *parameterFromVariantMap( const QVariantMap &map ) SIP_FACTORY;
1635 
1639  static QString descriptionFromName( const QString &name );
1640 
1646  static QgsProcessingParameterDefinition *parameterFromScriptCode( const QString &code ) SIP_FACTORY;
1647 
1648  private:
1649 
1650  static bool parseScriptCodeParameterOptions( const QString &code, bool &isOptional, QString &name, QString &type, QString &definition );
1651 };
1652 
1653 
1654 
1662 {
1663  public:
1664 
1668  QgsProcessingParameterBoolean( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
1669  bool optional = false );
1670 
1674  static QString typeName() { return QStringLiteral( "boolean" ); }
1675  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1676  QString type() const override { return typeName(); }
1677  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1678  QString asScriptCode() const override;
1679 
1683  static QgsProcessingParameterBoolean *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1684 };
1685 
1693 {
1694  public:
1695 
1699  QgsProcessingParameterCrs( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
1700  bool optional = false );
1701 
1705  static QString typeName() { return QStringLiteral( "crs" ); }
1706  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1707  QString type() const override { return typeName(); }
1708  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1709  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1710 
1714  static QgsProcessingParameterCrs *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1715 
1716 };
1717 
1725 {
1726  public:
1727 
1731  QgsProcessingParameterExtent( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
1732  bool optional = false );
1733 
1737  static QString typeName() { return QStringLiteral( "extent" ); }
1738  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1739  QString type() const override { return typeName(); }
1740  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1741  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1742 
1746  static QgsProcessingParameterExtent *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1747 
1748 };
1749 
1750 
1758 {
1759  public:
1760 
1764  QgsProcessingParameterPoint( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
1765  bool optional = false );
1766 
1770  static QString typeName() { return QStringLiteral( "point" ); }
1771  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1772  QString type() const override { return typeName(); }
1773  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1774  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1775 
1779  static QgsProcessingParameterPoint *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1780 
1781 };
1782 
1790 {
1791  public:
1792 
1800  QgsProcessingParameterGeometry( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false, const QList< int > &geometryTypes = QList< int >(), bool allowMultipart = true );
1801 
1805  static QString typeName() { return QStringLiteral( "geometry" ); }
1806  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1807  QString type() const override { return typeName(); }
1808  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1809  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1810  QString asScriptCode() const override;
1811  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
1812  QVariantMap toVariantMap() const override;
1813  bool fromVariantMap( const QVariantMap &map ) override;
1814 
1819  QList<int> geometryTypes() const { return mGeomTypes; }
1820 
1825  void setGeometryTypes( const QList<int> &geometryTypes ) { mGeomTypes = geometryTypes; }
1826 
1831  bool allowMultipart() const { return mAllowMultipart; }
1832 
1837  void setAllowMultipart( bool allowMultipart ) { mAllowMultipart = allowMultipart; }
1838 
1839 
1840 
1844  static QgsProcessingParameterGeometry *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
1845 
1846  private:
1847 
1848  QList<int> mGeomTypes;
1849  bool mAllowMultipart;
1850 
1851 };
1852 
1860 {
1861  public:
1862 
1865  {
1866  File = 0,
1868  };
1869 
1877  QgsProcessingParameterFile( const QString &name, const QString &description = QString(), Behavior behavior = File, const QString &extension = QString(), const QVariant &defaultValue = QVariant(),
1878  bool optional = false, const QString &fileFilter = QString() );
1879 
1883  static QString typeName() { return QStringLiteral( "file" ); }
1884  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1885  QString type() const override { return typeName(); }
1886  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1887  QString asScriptCode() const override;
1888  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
1889  QString createFileFilter() const override;
1890 
1895  Behavior behavior() const { return mBehavior; }
1896 
1901  void setBehavior( Behavior behavior ) { mBehavior = behavior; }
1902 
1910  QString extension() const { return mExtension; }
1911 
1921  void setExtension( const QString &extension );
1922 
1929  QString fileFilter() const;
1930 
1940  void setFileFilter( const QString &filter );
1941 
1942  QVariantMap toVariantMap() const override;
1943  bool fromVariantMap( const QVariantMap &map ) override;
1944 
1948  static QgsProcessingParameterFile *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition, Behavior behavior = File ) SIP_FACTORY;
1949 
1950  private:
1951 
1952  Behavior mBehavior = File;
1953  QString mExtension;
1954  QString mFileFilter;
1955 };
1956 
1964 {
1965  public:
1966 
1970  QgsProcessingParameterMatrix( const QString &name, const QString &description = QString(), int numberRows = 3,
1971  bool hasFixedNumberRows = false, const QStringList &headers = QStringList(),
1972  const QVariant &defaultValue = QVariant(),
1973  bool optional = false );
1974 
1978  static QString typeName() { return QStringLiteral( "matrix" ); }
1979  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
1980  QString type() const override { return typeName(); }
1981  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
1982  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
1983  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
1984 
1989  QStringList headers() const;
1990 
1995  void setHeaders( const QStringList &headers );
1996 
2003  int numberRows() const;
2004 
2011  void setNumberRows( int rows );
2012 
2018  bool hasFixedNumberRows() const;
2019 
2025  void setHasFixedNumberRows( bool hasFixedNumberRows );
2026 
2027  QVariantMap toVariantMap() const override;
2028  bool fromVariantMap( const QVariantMap &map ) override;
2029 
2033  static QgsProcessingParameterMatrix *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2034 
2035  private:
2036 
2037  QStringList mHeaders;
2038  int mNumberRows = 3;
2039  bool mFixedNumberRows = false;
2040 
2041 };
2042 
2050 {
2051  public:
2052 
2056  QgsProcessingParameterMultipleLayers( const QString &name, const QString &description = QString(), QgsProcessing::SourceType layerType = QgsProcessing::TypeVectorAnyGeometry,
2057  const QVariant &defaultValue = QVariant(),
2058  bool optional = false );
2059 
2063  static QString typeName() { return QStringLiteral( "multilayer" ); }
2064  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2065  QString type() const override { return typeName(); }
2066  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2067  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2068  QString asScriptCode() const override;
2069  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2070  QString createFileFilter() const override;
2071 
2076  QgsProcessing::SourceType layerType() const;
2077 
2082  void setLayerType( QgsProcessing::SourceType type );
2083 
2089  int minimumNumberInputs() const;
2090 
2096  void setMinimumNumberInputs( int minimum );
2097 
2098  QVariantMap toVariantMap() const override;
2099  bool fromVariantMap( const QVariantMap &map ) override;
2100 
2104  static QgsProcessingParameterMultipleLayers *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2105 
2106  private:
2107 
2109  int mMinimumNumberInputs = 0;
2110 
2111 };
2112 
2132 {
2133  public:
2134 
2136  enum Type
2137  {
2140  };
2141 
2145  explicit QgsProcessingParameterNumber( const QString &name, const QString &description = QString(),
2146  Type type = Integer,
2147  const QVariant &defaultValue = QVariant(),
2148  bool optional = false,
2149  double minValue = std::numeric_limits<double>::lowest() + 1,
2150  double maxValue = std::numeric_limits<double>::max()
2151  );
2152 
2156  static QString typeName() { return QStringLiteral( "number" ); }
2157  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2158  QString type() const override { return typeName(); }
2159  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2160  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2161  QString toolTip() const override;
2162  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2163 
2168  double minimum() const;
2169 
2174  void setMinimum( double minimum );
2175 
2180  double maximum() const;
2181 
2186  void setMaximum( double maximum );
2187 
2192  Type dataType() const;
2193 
2198  void setDataType( Type type );
2199 
2200  QVariantMap toVariantMap() const override;
2201  bool fromVariantMap( const QVariantMap &map ) override;
2202 
2206  static QgsProcessingParameterNumber *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2207 
2208  private:
2209 
2210  double mMin = std::numeric_limits<double>::lowest() + 1;
2211  double mMax = std::numeric_limits<double>::max();
2212  Type mDataType = Integer;
2213 };
2214 
2235 {
2236  public:
2237 
2241  explicit QgsProcessingParameterDistance( const QString &name, const QString &description = QString(),
2242  const QVariant &defaultValue = QVariant(),
2243  const QString &parentParameterName = QString(),
2244  bool optional = false,
2245  double minValue = std::numeric_limits<double>::lowest() + 1,
2246  double maxValue = std::numeric_limits<double>::max() );
2247 
2251  static QString typeName() { return QStringLiteral( "distance" ); }
2252 
2253  QgsProcessingParameterDistance *clone() const override SIP_FACTORY;
2254 
2255  QString type() const override;
2256  QStringList dependsOnOtherParameters() const override;
2257  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2258 
2263  QString parentParameterName() const;
2264 
2269  void setParentParameterName( const QString &parentParameterName );
2270 
2277  QgsUnitTypes::DistanceUnit defaultUnit() const { return mDefaultUnit; }
2278 
2285  void setDefaultUnit( QgsUnitTypes::DistanceUnit unit ) { mDefaultUnit = unit; }
2286 
2287  QVariantMap toVariantMap() const override;
2288  bool fromVariantMap( const QVariantMap &map ) override;
2289 
2290  private:
2291 
2292  QString mParentParameterName;
2294 
2295 };
2296 
2305 {
2306  public:
2307 
2311  explicit QgsProcessingParameterDuration( const QString &name, const QString &description = QString(),
2312  const QVariant &defaultValue = QVariant(),
2313  bool optional = false,
2314  double minValue = std::numeric_limits<double>::lowest() + 1,
2315  double maxValue = std::numeric_limits<double>::max() );
2316 
2320  static QString typeName() { return QStringLiteral( "duration" ); }
2321 
2322  QgsProcessingParameterDuration *clone() const override SIP_FACTORY;
2323 
2324  QString type() const override;
2325  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2326 
2332  QgsUnitTypes::TemporalUnit defaultUnit() const { return mDefaultUnit; }
2333 
2339  void setDefaultUnit( QgsUnitTypes::TemporalUnit unit ) { mDefaultUnit = unit; }
2340 
2341  QVariantMap toVariantMap() const override;
2342  bool fromVariantMap( const QVariantMap &map ) override;
2343 
2344  private:
2345 
2347 
2348 };
2349 
2361 {
2362  public:
2363 
2367  explicit QgsProcessingParameterScale( const QString &name, const QString &description = QString(),
2368  const QVariant &defaultValue = QVariant(),
2369  bool optional = false );
2370 
2374  static QString typeName() { return QStringLiteral( "scale" ); }
2375 
2376  QgsProcessingParameterScale *clone() const override SIP_FACTORY;
2377 
2378  QString type() const override;
2379  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2380 
2384  static QgsProcessingParameterScale *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2385 
2386 };
2387 
2395 {
2396  public:
2397 
2401  QgsProcessingParameterRange( const QString &name, const QString &description = QString(),
2403  const QVariant &defaultValue = QVariant(),
2404  bool optional = false );
2405 
2409  static QString typeName() { return QStringLiteral( "range" ); }
2410  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2411  QString type() const override { return typeName(); }
2412  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2413  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2414  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2415 
2420  QgsProcessingParameterNumber::Type dataType() const;
2421 
2426  void setDataType( QgsProcessingParameterNumber::Type dataType );
2427 
2428  QVariantMap toVariantMap() const override;
2429  bool fromVariantMap( const QVariantMap &map ) override;
2430 
2434  static QgsProcessingParameterRange *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2435 
2436  private:
2437 
2439 };
2440 
2448 {
2449  public:
2450 
2454  QgsProcessingParameterRasterLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2455  bool optional = false );
2456 
2460  static QString typeName() { return QStringLiteral( "raster" ); }
2461  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2462  QString type() const override { return typeName(); }
2463  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2464  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2465  QString createFileFilter() const override;
2466 
2470  static QgsProcessingParameterRasterLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2471 
2472 };
2473 
2481 {
2482  public:
2483 
2487  QgsProcessingParameterEnum( const QString &name, const QString &description = QString(), const QStringList &options = QStringList(),
2488  bool allowMultiple = false,
2489  const QVariant &defaultValue = QVariant(),
2490  bool optional = false,
2491  bool usesStaticStrings = false );
2492 
2496  static QString typeName() { return QStringLiteral( "enum" ); }
2497  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2498  QString type() const override { return typeName(); }
2499  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2500  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2501  QString valueAsPythonComment( const QVariant &value, QgsProcessingContext &context ) const override;
2502  QString asScriptCode() const override;
2503  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2504 
2509  QStringList options() const;
2510 
2515  void setOptions( const QStringList &options );
2516 
2521  bool allowMultiple() const;
2522 
2527  void setAllowMultiple( bool allowMultiple );
2528 
2535  bool usesStaticStrings() const;
2536 
2543  void setUsesStaticStrings( bool usesStaticStrings );
2544 
2545  QVariantMap toVariantMap() const override;
2546  bool fromVariantMap( const QVariantMap &map ) override;
2547 
2551  static QgsProcessingParameterEnum *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2552 
2553  private:
2554 
2555  QStringList mOptions;
2556  bool mAllowMultiple = false;
2557  bool mUsesStaticStrings = false;
2558 };
2559 
2588 {
2589  public:
2590 
2594  QgsProcessingParameterString( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2595  bool multiLine = false,
2596  bool optional = false );
2597 
2601  static QString typeName() { return QStringLiteral( "string" ); }
2602  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2603  QString type() const override { return typeName(); }
2604  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2605  QString asScriptCode() const override;
2606  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2607 
2612  bool multiLine() const;
2613 
2618  void setMultiLine( bool multiLine );
2619 
2620  QVariantMap toVariantMap() const override;
2621  bool fromVariantMap( const QVariantMap &map ) override;
2622 
2626  static QgsProcessingParameterString *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2627 
2628  private:
2629 
2630  bool mMultiLine = false;
2631 
2632 };
2633 
2634 
2648 {
2649  public:
2650 
2654  QgsProcessingParameterAuthConfig( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2655  bool optional = false );
2656 
2660  static QString typeName() { return QStringLiteral( "authcfg" ); }
2661  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2662  QString type() const override { return typeName(); }
2663  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2664  QString asScriptCode() const override;
2665 
2669  static QgsProcessingParameterAuthConfig *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2670 
2671 };
2672 
2680 {
2681  public:
2682 
2686  QgsProcessingParameterExpression( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2687  const QString &parentLayerParameterName = QString(),
2688  bool optional = false );
2689 
2693  static QString typeName() { return QStringLiteral( "expression" ); }
2694  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2695  QString type() const override { return typeName(); }
2696  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2697  QStringList dependsOnOtherParameters() const override;
2698  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2699 
2704  QString parentLayerParameterName() const;
2705 
2710  void setParentLayerParameterName( const QString &parentLayerParameterName );
2711 
2712  QVariantMap toVariantMap() const override;
2713  bool fromVariantMap( const QVariantMap &map ) override;
2714 
2718  static QgsProcessingParameterExpression *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2719 
2720  private:
2721 
2722  QString mParentLayerParameterName;
2723 
2724 };
2725 
2726 
2734 {
2735  public:
2736 
2740  QgsProcessingParameterLimitedDataTypes( const QList< int > &types = QList< int >() );
2741 
2746  QList< int > dataTypes() const;
2747 
2752  void setDataTypes( const QList< int > &types );
2753 
2754  protected:
2755 
2757  QList< int > mDataTypes;
2758 };
2759 
2768 {
2769  public:
2770 
2774  QgsProcessingParameterVectorLayer( const QString &name,
2775  const QString &description = QString(),
2776  const QList< int > &types = QList< int >(),
2777  const QVariant &defaultValue = QVariant(),
2778  bool optional = false );
2779 
2783  static QString typeName() { return QStringLiteral( "vector" ); }
2784  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2785  QString type() const override { return typeName(); }
2786  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2787  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2788  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2789  QString createFileFilter() const override;
2790 
2791  QVariantMap toVariantMap() const override;
2792  bool fromVariantMap( const QVariantMap &map ) override;
2793 
2797  static QgsProcessingParameterVectorLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2798 
2799 };
2800 
2808 {
2809  public:
2810 
2814  QgsProcessingParameterMeshLayer( const QString &name,
2815  const QString &description = QString(),
2816  const QVariant &defaultValue = QVariant(),
2817  bool optional = false );
2818 
2822  static QString typeName() { return QStringLiteral( "mesh" ); }
2823  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2824  QString type() const override { return typeName(); }
2825  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2826  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2827  QString createFileFilter() const override;
2828 
2832  static QgsProcessingParameterMeshLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2833 };
2834 
2842 {
2843  public:
2844 
2848  QgsProcessingParameterMapLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2849  bool optional = false,
2850  const QList< int > &types = QList< int >() );
2851 
2855  static QString typeName() { return QStringLiteral( "layer" ); }
2856  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2857  QString type() const override { return typeName(); }
2858  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2859  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2860  QString asScriptCode() const override;
2861  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2862  QString createFileFilter() const override;
2863 
2864  QVariantMap toVariantMap() const override;
2865  bool fromVariantMap( const QVariantMap &map ) override;
2866 
2870  static QgsProcessingParameterMapLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2871 
2872 };
2873 
2881 {
2882  public:
2883 
2886  {
2887  Any = -1,
2888  Numeric = 0,
2889  String = 1,
2890  DateTime = 2
2891  };
2892 
2896  QgsProcessingParameterField( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
2897  const QString &parentLayerParameterName = QString(),
2898  DataType type = Any,
2899  bool allowMultiple = false,
2900  bool optional = false,
2901  bool defaultToAllFields = false );
2902 
2906  static QString typeName() { return QStringLiteral( "field" ); }
2907  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
2908  QString type() const override { return typeName(); }
2909  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
2910  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
2911  QString asScriptCode() const override;
2912  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
2913  QStringList dependsOnOtherParameters() const override;
2914 
2919  QString parentLayerParameterName() const;
2920 
2925  void setParentLayerParameterName( const QString &parentLayerParameterName );
2926 
2931  DataType dataType() const;
2932 
2937  void setDataType( DataType type );
2938 
2943  bool allowMultiple() const;
2944 
2949  void setAllowMultiple( bool allowMultiple );
2950 
2960  bool defaultToAllFields() const;
2961 
2971  void setDefaultToAllFields( bool enabled );
2972 
2973  QVariantMap toVariantMap() const override;
2974  bool fromVariantMap( const QVariantMap &map ) override;
2975 
2979  static QgsProcessingParameterField *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
2980 
2981  private:
2982 
2983  QString mParentLayerParameterName;
2984  DataType mDataType = Any;
2985  bool mAllowMultiple = false;
2986  bool mDefaultToAllFields = false;
2987 
2988 };
2989 
2990 
2998 {
2999  public:
3000 
3004  QgsProcessingParameterFeatureSource( const QString &name, const QString &description = QString(),
3005  const QList< int > &types = QList< int >(),
3006  const QVariant &defaultValue = QVariant(), bool optional = false );
3007 
3011  static QString typeName() { return QStringLiteral( "source" ); }
3012  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3013  QString type() const override { return typeName(); }
3014  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3015  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3016  QString asScriptCode() const override;
3017  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3018  QString createFileFilter() const override;
3019 
3020  QVariantMap toVariantMap() const override;
3021  bool fromVariantMap( const QVariantMap &map ) override;
3022 
3026  static QgsProcessingParameterFeatureSource *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3027 
3028 };
3029 
3038 {
3039  public:
3040 
3047  QgsProcessingDestinationParameter( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
3048  bool optional = false, bool createByDefault = true );
3049 
3050  bool isDestination() const override { return true; }
3051  QVariantMap toVariantMap() const override;
3052  bool fromVariantMap( const QVariantMap &map ) override;
3053  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3054  QString createFileFilter() const override;
3055 
3061 
3067  bool supportsNonFileBasedOutput() const { return mSupportsNonFileBasedOutputs; }
3068 
3074  void setSupportsNonFileBasedOutput( bool supportsNonFileBasedOutput ) { mSupportsNonFileBasedOutputs = supportsNonFileBasedOutput; }
3075 
3080  virtual QString defaultFileExtension() const = 0;
3081 
3087  virtual QString generateTemporaryDestination() const;
3088 
3103  virtual bool isSupportedOutputValue( const QVariant &value, QgsProcessingContext &context, QString &error SIP_OUT ) const;
3104 
3110  bool createByDefault() const;
3111 
3117  void setCreateByDefault( bool createByDefault );
3118 
3119  protected:
3120 
3129  QgsProcessingProvider *originalProvider() const { return mOriginalProvider; }
3130 
3131  private:
3132 
3140  QgsProcessingProvider *mOriginalProvider = nullptr;
3141 
3142  bool mSupportsNonFileBasedOutputs = true;
3143  bool mCreateByDefault = true;
3144 
3145  friend class QgsProcessingModelAlgorithm;
3146  friend class TestQgsProcessing;
3147 };
3148 
3149 
3159 {
3160  public:
3161 
3168  QgsProcessingParameterFeatureSink( const QString &name, const QString &description = QString(), QgsProcessing::SourceType type = QgsProcessing::TypeVectorAnyGeometry, const QVariant &defaultValue = QVariant(),
3169  bool optional = false, bool createByDefault = true, bool supportsAppend = false );
3170 
3174  static QString typeName() { return QStringLiteral( "sink" ); }
3175  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3176  QString type() const override { return typeName(); }
3177  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3178  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3179  QString asScriptCode() const override;
3180  QgsProcessingOutputDefinition *toOutputDefinition() const override SIP_FACTORY;
3181  QString defaultFileExtension() const override;
3182  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3183  QString createFileFilter() const override;
3184 
3190  virtual QStringList supportedOutputVectorLayerExtensions() const;
3191 
3196  QgsProcessing::SourceType dataType() const;
3197 
3202  bool hasGeometry() const;
3203 
3208  void setDataType( QgsProcessing::SourceType type );
3209 
3218  bool supportsAppend() const;
3219 
3228  void setSupportsAppend( bool supportsAppend );
3229 
3230  QVariantMap toVariantMap() const override;
3231  bool fromVariantMap( const QVariantMap &map ) override;
3232  QString generateTemporaryDestination() const override;
3233 
3237  static QgsProcessingParameterFeatureSink *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3238 
3239  private:
3240 
3241  QgsProcessing::SourceType mDataType = QgsProcessing::TypeVectorAnyGeometry;
3242  bool mSupportsAppend = false;
3243 };
3244 
3245 
3257 {
3258  public:
3259 
3266  QgsProcessingParameterVectorDestination( const QString &name, const QString &description = QString(), QgsProcessing::SourceType type = QgsProcessing::TypeVectorAnyGeometry, const QVariant &defaultValue = QVariant(),
3267  bool optional = false, bool createByDefault = true );
3268 
3272  static QString typeName() { return QStringLiteral( "vectorDestination" ); }
3273  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3274  QString type() const override { return typeName(); }
3275  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3276  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3277  QString asScriptCode() const override;
3278  QgsProcessingOutputDefinition *toOutputDefinition() const override SIP_FACTORY;
3279  QString defaultFileExtension() const override;
3280  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3281  QString createFileFilter() const override;
3282 
3288  virtual QStringList supportedOutputVectorLayerExtensions() const;
3289 
3294  QgsProcessing::SourceType dataType() const;
3295 
3300  bool hasGeometry() const;
3301 
3306  void setDataType( QgsProcessing::SourceType type );
3307 
3308  QVariantMap toVariantMap() const override;
3309  bool fromVariantMap( const QVariantMap &map ) override;
3310 
3314  static QgsProcessingParameterVectorDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3315 
3316 
3317  private:
3318 
3319  QgsProcessing::SourceType mDataType = QgsProcessing::TypeVectorAnyGeometry;
3320 };
3321 
3330 {
3331  public:
3332 
3339  QgsProcessingParameterRasterDestination( const QString &name, const QString &description = QString(),
3340  const QVariant &defaultValue = QVariant(),
3341  bool optional = false,
3342  bool createByDefault = true );
3343 
3347  static QString typeName() { return QStringLiteral( "rasterDestination" ); }
3348  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3349  QString type() const override { return typeName(); }
3350  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3351  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3352  QgsProcessingOutputDefinition *toOutputDefinition() const override SIP_FACTORY;
3353  QString defaultFileExtension() const override;
3354  QString createFileFilter() const override;
3355 
3361  virtual QStringList supportedOutputRasterLayerExtensions() const;
3362 
3366  static QgsProcessingParameterRasterDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3367 };
3368 
3391 {
3392  public:
3393 
3400  QgsProcessingParameterFileDestination( const QString &name, const QString &description = QString(),
3401  const QString &fileFilter = QString(),
3402  const QVariant &defaultValue = QVariant(),
3403  bool optional = false,
3404  bool createByDefault = true );
3405 
3409  static QString typeName() { return QStringLiteral( "fileDestination" ); }
3410  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3411  QString type() const override { return typeName(); }
3412  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3413  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3414  QgsProcessingOutputDefinition *toOutputDefinition() const override SIP_FACTORY;
3415  QString defaultFileExtension() const override;
3416  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3417  QString createFileFilter() const override;
3418 
3423  QString fileFilter() const;
3424 
3429  void setFileFilter( const QString &filter );
3430 
3431  QVariantMap toVariantMap() const override;
3432  bool fromVariantMap( const QVariantMap &map ) override;
3433 
3437  static QgsProcessingParameterFileDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3438 
3439 
3440  private:
3441 
3442  QString mFileFilter;
3443 };
3444 
3453 {
3454  public:
3455 
3459  QgsProcessingParameterFolderDestination( const QString &name, const QString &description = QString(),
3460  const QVariant &defaultValue = QVariant(),
3461  bool optional = false,
3462  bool createByDefault = true );
3463 
3467  static QString typeName() { return QStringLiteral( "folderDestination" ); }
3468  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3469  QString type() const override { return typeName(); }
3470  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3471  QgsProcessingOutputDefinition *toOutputDefinition() const override SIP_FACTORY;
3472  QString defaultFileExtension() const override;
3473 
3477  static QgsProcessingParameterFolderDestination *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3478 
3479 };
3480 
3488 {
3489  public:
3490 
3494  QgsProcessingParameterBand( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
3495  const QString &parentLayerParameterName = QString(),
3496  bool optional = false,
3497  bool allowMultiple = false );
3498 
3502  static QString typeName() { return QStringLiteral( "band" ); }
3503  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3504  QString type() const override { return typeName(); }
3505  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3506  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3507  QString asScriptCode() const override;
3508  QStringList dependsOnOtherParameters() const override;
3509  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3510 
3515  QString parentLayerParameterName() const;
3516 
3521  void setParentLayerParameterName( const QString &parentLayerParameterName );
3522 
3523  QVariantMap toVariantMap() const override;
3524  bool fromVariantMap( const QVariantMap &map ) override;
3525 
3529  static QgsProcessingParameterBand *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3530 
3536  bool allowMultiple() const;
3537 
3543  void setAllowMultiple( bool allowMultiple );
3544 
3545  private:
3546 
3547  QString mParentLayerParameterName;
3548  bool mAllowMultiple = false;
3549 };
3550 
3563 {
3564  public:
3565 
3569  QgsProcessingParameterLayout( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
3570  bool optional = false );
3571 
3575  static QString typeName() { return QStringLiteral( "layout" ); }
3576  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3577  QString type() const override { return typeName(); }
3578  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3579  QString asScriptCode() const override;
3580  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3581 
3585  static QgsProcessingParameterLayout *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3586 
3587 };
3588 
3601 {
3602  public:
3603 
3607  QgsProcessingParameterLayoutItem( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
3608  const QString &parentLayoutParameterName = QString(),
3609  int itemType = -1,
3610  bool optional = false );
3611 
3615  static QString typeName() { return QStringLiteral( "layoutitem" ); }
3616  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3617  QString type() const override { return typeName(); }
3618  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3619  QString asScriptCode() const override;
3620  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3621  QVariantMap toVariantMap() const override;
3622  bool fromVariantMap( const QVariantMap &map ) override;
3623  QStringList dependsOnOtherParameters() const override;
3624 
3628  static QgsProcessingParameterLayoutItem *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3629 
3634  QString parentLayoutParameterName() const;
3635 
3640  void setParentLayoutParameterName( const QString &name );
3641 
3649  int itemType() const;
3650 
3658  void setItemType( int type );
3659 
3660  private:
3661  QString mParentLayoutParameterName;
3662  int mItemType = -1;
3663 };
3664 
3675 {
3676  public:
3677 
3683  QgsProcessingParameterColor( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
3684  bool opacityEnabled = true,
3685  bool optional = false );
3686 
3690  static QString typeName() { return QStringLiteral( "color" ); }
3691  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3692  QString type() const override { return typeName(); }
3693  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3694  QString asScriptCode() const override;
3695  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3696  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3697  QVariantMap toVariantMap() const override;
3698  bool fromVariantMap( const QVariantMap &map ) override;
3699 
3706  bool opacityEnabled() const;
3707 
3715  void setOpacityEnabled( bool enabled );
3716 
3720  static QgsProcessingParameterColor *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3721 
3722  private:
3723 
3724  bool mAllowOpacity = true;
3725 
3726 };
3727 
3728 
3739 {
3740  public:
3741 
3745  QgsProcessingParameterCoordinateOperation( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
3746  const QString &sourceCrsParameterName = QString(), const QString &destinationCrsParameterName = QString(),
3747  const QVariant &staticSourceCrs = QVariant(), const QVariant &staticDestinationCrs = QVariant(),
3748  bool optional = false );
3749 
3753  static QString typeName() { return QStringLiteral( "coordinateoperation" ); }
3754  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3755  QString type() const override { return typeName(); }
3756  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3757  QString asScriptCode() const override;
3758  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3759  QStringList dependsOnOtherParameters() const override;
3760 
3761  QVariantMap toVariantMap() const override;
3762  bool fromVariantMap( const QVariantMap &map ) override;
3763 
3767  static QgsProcessingParameterCoordinateOperation *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3768 
3774  QString sourceCrsParameterName() const { return mSourceParameterName; }
3775 
3781  void setSourceCrsParameterName( const QString &name ) { mSourceParameterName = name; }
3782 
3788  QString destinationCrsParameterName() const { return mDestParameterName; }
3789 
3795  void setDestinationCrsParameterName( const QString &name ) { mDestParameterName = name; }
3796 
3802  QVariant sourceCrs() const { return mSourceCrs; }
3803 
3809  void setSourceCrs( const QVariant &crs ) { mSourceCrs = crs; }
3810 
3816  QVariant destinationCrs() const { return mDestCrs; }
3817 
3823  void setDestinationCrs( const QVariant &crs ) { mDestCrs = crs; }
3824 
3825  private:
3826 
3827  QString mSourceParameterName;
3828  QString mDestParameterName;
3829  QVariant mSourceCrs;
3830  QVariant mDestCrs;
3831 
3832 };
3833 
3834 
3845 {
3846  public:
3847 
3851  QgsProcessingParameterMapTheme( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
3852  bool optional = false );
3853 
3857  static QString typeName() { return QStringLiteral( "maptheme" ); }
3858  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3859  QString type() const override { return typeName(); }
3860  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3861  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3862  QString asScriptCode() const override;
3863  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3864  QVariantMap toVariantMap() const override;
3865  bool fromVariantMap( const QVariantMap &map ) override;
3866 
3870  static QgsProcessingParameterMapTheme *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3871 
3872  private:
3873 
3874 };
3875 
3876 
3888 {
3889  public:
3890 
3892  enum Type
3893  {
3897  };
3898 
3902  explicit QgsProcessingParameterDateTime( const QString &name, const QString &description = QString(),
3903  Type type = DateTime,
3904  const QVariant &defaultValue = QVariant(),
3905  bool optional = false,
3906  const QDateTime &minValue = QDateTime(),
3907  const QDateTime &maxValue = QDateTime()
3908  );
3909 
3913  static QString typeName() { return QStringLiteral( "datetime" ); }
3914  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
3915  QString type() const override { return typeName(); }
3916  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
3917  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
3918  QString toolTip() const override;
3919  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
3920 
3928  QDateTime minimum() const;
3929 
3941  void setMinimum( const QDateTime &minimum );
3942 
3950  QDateTime maximum() const;
3951 
3963  void setMaximum( const QDateTime &maximum );
3964 
3969  Type dataType() const;
3970 
3975  void setDataType( Type type );
3976 
3977  QVariantMap toVariantMap() const override;
3978  bool fromVariantMap( const QVariantMap &map ) override;
3979 
3983  static QgsProcessingParameterDateTime *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
3984 
3985  private:
3986 
3987  QDateTime mMin;
3988  QDateTime mMax;
3989  Type mDataType = DateTime;
3990 };
3991 
3992 
4004 {
4005  public:
4006 
4013  QgsProcessingParameterProviderConnection( const QString &name, const QString &description, const QString &provider, const QVariant &defaultValue = QVariant(),
4014  bool optional = false );
4015 
4019  static QString typeName() { return QStringLiteral( "providerconnection" ); }
4020  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
4021  QString type() const override { return typeName(); }
4022  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
4023  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
4024  QString asScriptCode() const override;
4025  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
4026  QVariantMap toVariantMap() const override;
4027  bool fromVariantMap( const QVariantMap &map ) override;
4028 
4033  QString providerId() const { return mProviderId; }
4034 
4039  void setProviderId( const QString &provider ) { mProviderId = provider; }
4040 
4044  static QgsProcessingParameterProviderConnection *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
4045 
4046  private:
4047 
4048  QString mProviderId;
4049 };
4050 
4051 
4063 {
4064  public:
4065 
4074  QgsProcessingParameterDatabaseSchema( const QString &name, const QString &description, const QString &connectionParameterName = QString(), const QVariant &defaultValue = QVariant(),
4075  bool optional = false );
4076 
4080  static QString typeName() { return QStringLiteral( "databaseschema" ); }
4081  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
4082  QString type() const override { return typeName(); }
4083  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
4084  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
4085  QString asScriptCode() const override;
4086  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
4087  QVariantMap toVariantMap() const override;
4088  bool fromVariantMap( const QVariantMap &map ) override;
4089  QStringList dependsOnOtherParameters() const override;
4090 
4095  QString parentConnectionParameterName() const;
4096 
4101  void setParentConnectionParameterName( const QString &name );
4102 
4106  static QgsProcessingParameterDatabaseSchema *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
4107 
4108  private:
4109 
4110  QString mParentConnectionParameterName;
4111 };
4112 
4113 
4125 {
4126  public:
4127 
4137  QgsProcessingParameterDatabaseTable( const QString &name, const QString &description,
4138  const QString &connectionParameterName = QString(),
4139  const QString &schemaParameterName = QString(),
4140  const QVariant &defaultValue = QVariant(),
4141  bool optional = false,
4142  bool allowNewTableNames = false );
4143 
4147  static QString typeName() { return QStringLiteral( "databasetable" ); }
4148  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
4149  QString type() const override { return typeName(); }
4150  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
4151  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
4152  QString asScriptCode() const override;
4153  QString asPythonString( QgsProcessing::PythonOutputType outputType = QgsProcessing::PythonQgsProcessingAlgorithmSubclass ) const override;
4154  QVariantMap toVariantMap() const override;
4155  bool fromVariantMap( const QVariantMap &map ) override;
4156  QStringList dependsOnOtherParameters() const override;
4157 
4162  QString parentConnectionParameterName() const;
4163 
4168  void setParentConnectionParameterName( const QString &name );
4169 
4174  QString parentSchemaParameterName() const;
4175 
4180  void setParentSchemaParameterName( const QString &name );
4181 
4185  static QgsProcessingParameterDatabaseTable *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
4186 
4193  bool allowNewTableNames() const;
4194 
4201  void setAllowNewTableNames( bool allowed );
4202 
4203  private:
4204 
4205  QString mParentConnectionParameterName;
4206  QString mParentSchemaParameterName;
4207  bool mAllowNewTableNames = false;
4208 };
4209 
4210 
4218 {
4219  public:
4220 
4224  QgsProcessingParameterPointCloudLayer( const QString &name, const QString &description = QString(),
4225  const QVariant &defaultValue = QVariant(), bool optional = false );
4226 
4230  static QString typeName() { return QStringLiteral( "pointcloud" ); }
4231  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
4232  QString type() const override { return typeName(); }
4233  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
4234  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
4235  QString createFileFilter() const override;
4236 
4240  static QgsProcessingParameterPointCloudLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
4241 };
4242 
4243 
4251 {
4252  public:
4253 
4257  QgsProcessingParameterAnnotationLayer( const QString &name, const QString &description = QString(),
4258  const QVariant &defaultValue = QVariant(), bool optional = false );
4259 
4263  static QString typeName() { return QStringLiteral( "annotation" ); }
4264  QgsProcessingParameterDefinition *clone() const override SIP_FACTORY;
4265  QString type() const override { return typeName(); }
4266  bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override;
4267  QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override;
4268 
4272  static QgsProcessingParameterAnnotationLayer *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) SIP_FACTORY;
4273 };
4274 
4275 // clazy:excludeall=qstring-allocations
4276 
4277 #endif // QGSPROCESSINGPARAMETERS_H
4278 
4279 
Represents a map layer containing a set of georeferenced annotations, e.g.
This class represents a coordinate reference system (CRS).
This class wraps a request for features to a vector layer (or directly its vector data provider).
InvalidGeometryCheck
Handling of features with invalid geometries.
@ GeometryAbortOnInvalid
Close iterator on encountering any features with invalid geometry. This requires a slow geometry vali...
An interface for objects which accept features via addFeature(s) methods.
Container of fields for a vector layer.
Definition: qgsfields.h:45
Abstract interface for classes which generate a file filter string.
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:124
Base class for graphical items within a QgsLayout.
Base class for all map layer types.
Definition: qgsmaplayer.h:72
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Definition: qgsmeshlayer.h:96
Represents a map layer supporting display of point clouds.
A class to represent a 2D point.
Definition: qgspointxy.h:59
Print layout, a QgsLayout subclass for static or atlas-based layouts.
Abstract base class for processing algorithms.
Contains information about the context in which a processing algorithm is executed.
Base class for all parameter definitions which represent file or layer destinations,...
virtual QString defaultFileExtension() const =0
Returns the default file extension for destination file paths associated with this parameter.
bool supportsNonFileBasedOutput() const
Returns true if the destination parameter supports non filed-based outputs, such as memory layers or ...
virtual QgsProcessingOutputDefinition * toOutputDefinition() const =0
Returns a new QgsProcessingOutputDefinition corresponding to the definition of the destination parame...
bool isDestination() const override
Returns true if this parameter represents a file or layer destination, e.g.
QgsProcessingProvider * originalProvider() const
Original (source) provider which this parameter has been derived from.
void setSupportsNonFileBasedOutput(bool supportsNonFileBasedOutput)
Sets whether the destination parameter supports non filed-based outputs, such as memory layers or dir...
Custom exception class for processing related exceptions.
Definition: qgsexception.h:83
Encapsulates settings relating to a feature source input to a processing algorithm.
Flags flags
Flags which dictate source behavior.
bool operator!=(const QgsProcessingFeatureSourceDefinition &other) const
bool selectedFeaturesOnly
true if only selected features in the source should be used by algorithms.
QgsFeatureRequest::InvalidGeometryCheck geometryCheck
Geometry check method to apply to this source.
bool operator==(const QgsProcessingFeatureSourceDefinition &other) const
long long featureLimit
If set to a value > 0, places a limit on the maximum number of features which will be read from the s...
Flag
Flags which control source behavior.
QgsProcessingFeatureSourceDefinition(const QgsProperty &source, bool selectedFeaturesOnly=false, long long featureLimit=-1, QgsProcessingFeatureSourceDefinition::Flags flags=QgsProcessingFeatureSourceDefinition::Flags(), QgsFeatureRequest::InvalidGeometryCheck geometryCheck=QgsFeatureRequest::GeometryAbortOnInvalid)
Constructor for QgsProcessingFeatureSourceDefinition, accepting a QgsProperty source.
QgsFeatureSource subclass which proxies methods to an underlying QgsFeatureSource,...
Base class for providing feedback from a processing algorithm.
Base class for the definition of processing outputs.
Encapsulates settings relating to a feature sink or output raster layer for a processing algorithm.
QgsProcessingOutputLayerDefinition(const QgsProperty &sink, QgsProject *destinationProject=nullptr)
Constructor for QgsProcessingOutputLayerDefinition, accepting a QgsProperty sink/layer.
QgsProperty sink
Sink/layer definition.
bool useRemapping() const
Returns true if the output uses a remapping definition.
QgsProcessingOutputLayerDefinition(const QString &sink=QString(), QgsProject *destinationProject=nullptr)
Constructor for QgsProcessingOutputLayerDefinition, accepting a static sink/layer string.
QgsRemappingSinkDefinition remappingDefinition() const
Returns the output remapping definition, if useRemapping() is true.
QString destinationName
Name to use for sink if it's to be loaded into a destination project.
QVariantMap createOptions
Map of optional sink/layer creation options, which are passed to the underlying provider when creatin...
An annotation layer parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A string parameter for authentication configuration ID values.
static QString typeName()
Returns the type name for the parameter class.
A raster band parameter for Processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A boolean parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A color parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A coordinate operation parameter for processing algorithms, for selection between available coordinat...
static QString typeName()
Returns the type name for the parameter class.
QVariant sourceCrs() const
Returns the static source CRS, or an invalid value if this is not set.
QString destinationCrsParameterName() const
Returns the name of the destination CRS parameter, or an empty string if this is not set.
void setDestinationCrsParameterName(const QString &name)
Sets the name of the destination CRS parameter.
void setSourceCrs(const QVariant &crs)
Sets the static source crs.
QVariant destinationCrs() const
Returns the static destination CRS, or an invalid value if this is not set.
void setDestinationCrs(const QVariant &crs)
Sets the static destination crs.
void setSourceCrsParameterName(const QString &name)
Sets the name of the source CRS parameter.
QString sourceCrsParameterName() const
Returns the name of the source CRS parameter, or an empty string if this is not set.
A coordinate reference system parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A database schema parameter for processing algorithms, allowing users to select from existing schemas...
static QString typeName()
Returns the type name for the parameter class.
A database table name parameter for processing algorithms, allowing users to select from existing dat...
static QString typeName()
Returns the type name for the parameter class.
A datetime (or pure date or time) parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
Base class for the definition of processing parameters.
QVariant defaultValue() const
Returns the default value for the parameter.
void setDefaultValue(const QVariant &value)
Sets the default value for the parameter.
QVariant guiDefaultValueOverride() const
Returns the default value to use in the GUI for the parameter.
QStringList additionalExpressionContextVariables() const
Returns a list of additional expression context variables which are available for use when evaluating...
QStringList mAdditionalExpressionVariables
Additional expression context variables exposed for use by this parameter.
QString help() const
Returns the help for the parameter.
void setMetadata(const QVariantMap &metadata)
Sets the parameter's freeform metadata.
virtual QgsProcessingParameterDefinition * clone() const =0
Creates a clone of the parameter definition.
void setGuiDefaultValueOverride(const QVariant &value)
Sets the default value to use for the parameter in GUI widgets.
QVariantMap metadata() const
Returns the parameter's freeform metadata.
QString description() const
Returns the description for the parameter.
QString mDynamicLayerParameterName
Linked vector layer parameter name for dynamic properties.
QVariant defaultValueForGui() const
Returns the default value to use for the parameter in a GUI.
virtual bool isDestination() const
Returns true if this parameter represents a file or layer destination, e.g.
void setDescription(const QString &description)
Sets the description for the parameter.
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 dynamicLayerParameterName() const
Returns the name of the parameter for a layer linked to a dynamic parameter, or an empty string if th...
void setAdditionalExpressionContextVariables(const QStringList &variables)
Sets a list of additional expression context variables which are available for use when evaluating th...
QVariantMap mMetadata
Freeform metadata for parameter. Mostly used by widget wrappers to customize their appearance and beh...
void setName(const QString &name)
Sets the name of the parameter.
QString mDescription
Parameter description.
virtual QString type() const =0
Unique parameter type name.
void setDynamicPropertyDefinition(const QgsPropertyDefinition &definition)
Sets the property definition for dynamic properties.
Flags flags() const
Returns any flags associated with the parameter.
void setHelp(const QString &help)
Sets the help for the parameter.
QString name() const
Returns the name of the parameter.
QVariant mDefault
Default value for parameter.
virtual QStringList dependsOnOtherParameters() const
Returns a list of other parameter names on which this parameter is dependent (e.g.
void setIsDynamic(bool dynamic)
Sets whether the parameter is dynamic, and can support data-defined values (i.e.
QVariantMap & metadata()
Returns the parameter's freeform metadata.
QVariant mGuiDefault
Default value for parameter in GUI.
QgsPropertyDefinition mPropertyDefinition
Data defined property definition.
bool isDynamic() const
Returns true if the parameter supports is dynamic, and can support data-defined values (i....
void setFlags(Flags flags)
Sets the flags associated with the parameter.
virtual ~QgsProcessingParameterDefinition()=default
QgsPropertyDefinition dynamicPropertyDefinition() const
Returns the property definition for dynamic properties.
A double numeric parameter for distance values.
void setDefaultUnit(QgsUnitTypes::DistanceUnit unit)
Sets the default distance unit for the parameter.
static QString typeName()
Returns the type name for the parameter class.
A double numeric parameter for duration values.
void setDefaultUnit(QgsUnitTypes::TemporalUnit unit)
Sets the default duration unit for the parameter.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
An enum based parameter for processing algorithms, allowing for selection from predefined values.
static QString typeName()
Returns the type name for the parameter class.
An expression parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A rectangular map extent parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A feature sink output 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.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
A vector layer or feature source field parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A generic file based destination parameter, for specifying the destination path for a file (non-map l...
static QString typeName()
Returns the type name for the parameter class.
An input file or folder parameter for processing algorithms.
QString extension() const
Returns any specified file extension for the parameter.
static QString typeName()
Returns the type name for the parameter class.
void setBehavior(Behavior behavior)
Sets the parameter behavior (e.g.
Behavior behavior() const
Returns the parameter behavior (e.g.
A folder destination parameter, for specifying the destination path for a folder created by the algor...
static QString typeName()
Returns the type name for the parameter class.
A geometry parameter for processing algorithms.
void setGeometryTypes(const QList< int > &geometryTypes)
Sets the allowed geometryTypes, as a list of QgsWkbTypes::GeometryType values.
bool allowMultipart() const
Returns the parameter allow multipart geometries.
QList< int > geometryTypes() const
Returns the parameter allowed geometries, as a list of QgsWkbTypes::GeometryType values.
void setAllowMultipart(bool allowMultipart)
Sets the allow multipart geometries.
static QString typeName()
Returns the type name for the parameter class.
A print layout item parameter, allowing users to select a particular item from a print layout.
static QString typeName()
Returns the type name for the parameter class.
A print layout parameter, allowing users to select a print layout.
static QString typeName()
Returns the type name for the parameter class.
Can be inherited by parameters which require limits to their acceptable data types.
QList< int > mDataTypes
List of acceptable data types for the parameter.
A map layer parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A map theme parameter for processing algorithms, allowing users to select an existing map theme from ...
static QString typeName()
Returns the type name for the parameter class.
A table (matrix) parameter for processing algorithms.
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.
A mesh layer parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A parameter for processing algorithms which accepts multiple map layers.
static QString typeName()
Returns the type name for the parameter class.
A numeric parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A point cloud layer parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A point parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A data provider connection parameter for processing algorithms, allowing users to select from availab...
static QString typeName()
Returns the type name for the parameter class.
void setProviderId(const QString &provider)
Sets the ID of the provider associated with the connections.
QString providerId() const
Returns the ID of the provider associated with the connections.
A numeric range parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
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.
A raster layer parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
A double numeric parameter for map scale values.
static QString typeName()
Returns the type name for the parameter class.
A string parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
A vector layer destination parameter, for specifying the destination path for a vector layer created ...
static QString typeName()
Returns the type name for the parameter class.
A vector layer (with or without geometry) parameter for processing algorithms.
static QString typeName()
Returns the type name for the parameter class.
static QString typeName()
Returns the type name for the parameter class.
A collection of utilities for working with parameters when running a processing algorithm.
Abstract base class for processing providers.
LayerHint
Layer type hints.
@ UnknownType
Unknown layer type.
Contains enumerations and other constants for use in processing algorithms and parameters.
Definition: qgsprocessing.h:40
PythonOutputType
Available Python output types.
Definition: qgsprocessing.h:63
@ PythonQgsProcessingAlgorithmSubclass
Full Python QgsProcessingAlgorithm subclass.
Definition: qgsprocessing.h:64
SourceType
Data source types enum.
Definition: qgsprocessing.h:46
@ TypeVectorAnyGeometry
Any vector layer with geometry.
Definition: qgsprocessing.h:48
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition: qgsproject.h:101
Definition for a property.
Definition: qgsproperty.h:48
A store for object properties.
Definition: qgsproperty.h:232
Represents a raster layer.
A rectangle specified with double values.
Definition: qgsrectangle.h:42
Defines the parameters used to remap features when creating a QgsRemappingProxyFeatureSink.
Helper functions for various unit types.
Definition: qgsunittypes.h:39
DistanceUnit
Units of distance.
Definition: qgsunittypes.h:68
@ DistanceUnknownUnit
Unknown distance unit.
Definition: qgsunittypes.h:78
TemporalUnit
Temporal units.
Definition: qgsunittypes.h:150
@ TemporalMilliseconds
Milliseconds.
Definition: qgsunittypes.h:151
Represents a vector layer which manages a vector based data sets.
Type
The WKB type describes the number of dimensions a geometry has.
Definition: qgswkbtypes.h:70
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_THROW(name)
Definition: qgis_sip.h:189
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
#define SIP_SKIP
Definition: qgis_sip.h:126
#define SIP_OUT
Definition: qgis_sip.h:58
#define SIP_FACTORY
Definition: qgis_sip.h:76
#define SIP_END
Definition: qgis_sip.h:194
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
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.
Q_DECLARE_METATYPE(QgsMeshTimeSettings)
QList< const QgsProcessingParameterDefinition * > QgsProcessingParameterDefinitions
List of processing parameters.
const QgsCoordinateReferenceSystem & crs
const QString & typeName