QGIS API Documentation  3.8.0-Zanzibar (11aff65)
qgsprocessingparametertypeimpl.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsprocessingparametertypeimpl.h
3  ------------------------
4  begin : March 2018
5  copyright : (C) 2018 by Matthias Kuhn
6  email : [email protected]
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSPROCESSINGPARAMETERTYPEIMPL_H
19 #define QGSPROCESSINGPARAMETERTYPEIMPL_H
20 
21 #include "qgis.h"
22 #include "qgis_sip.h"
24 #include <QCoreApplication>
25 
26 #define SIP_NO_FILE
27 
36 {
37  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
38  {
39  return new QgsProcessingParameterRasterLayer( name );
40  }
41 
42  QString description() const override
43  {
44  return QCoreApplication::translate( "Processing", "A raster layer parameter." );
45  }
46 
47  QString name() const override
48  {
49  return QCoreApplication::translate( "Processing", "Raster Layer" );
50  }
51 
52  QString pythonImportString() const override
53  {
54  return QStringLiteral( "from qgis.core import QgsProcessingParameterRasterLayer" );
55  }
56 
57  QString className() const override
58  {
59  return QStringLiteral( "QgsProcessingParameterRasterLayer" );
60  }
61 
62  QString id() const override
63  {
64  return QStringLiteral( "raster" );
65  }
66 
67  QStringList acceptedPythonTypes() const override
68  {
69  return QStringList() << QObject::tr( "str: layer ID" )
70  << QObject::tr( "str: layer name" )
71  << QObject::tr( "str: layer source" )
72  << QStringLiteral( "QgsProperty" )
73  << QStringLiteral( "QgsRasterLayer" );
74  }
75 
76  QStringList acceptedStringValues() const override
77  {
78  return QStringList() << QObject::tr( "Path to a raster layer" );
79  }
80 };
81 
90 {
91  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
92  {
93  return new QgsProcessingParameterMeshLayer( name );
94  }
95 
96  QString description() const override
97  {
98  return QCoreApplication::translate( "Processing", "A mesh layer parameter." );
99  }
100 
101  QString name() const override
102  {
103  return QCoreApplication::translate( "Processing", "Mesh Layer" );
104  }
105 
106  QString pythonImportString() const override
107  {
108  return QStringLiteral( "from qgis.core import QgsProcessingParameterMeshLayer" );
109  }
110 
111  QString className() const override
112  {
113  return QStringLiteral( "QgsProcessingParameterMeshLayer" );
114  }
115 
116  QString id() const override
117  {
118  return QStringLiteral( "mesh" );
119  }
120 
121  QStringList acceptedPythonTypes() const override
122  {
123  return QStringList() << QObject::tr( "str: layer ID" )
124  << QObject::tr( "str: layer name" )
125  << QObject::tr( "str: layer source" )
126  << QStringLiteral( "QgsMeshLayer" );
127  }
128 
129  QStringList acceptedStringValues() const override
130  {
131  return QStringList() << QObject::tr( "Path to a mesh layer" );
132  }
133 };
134 
143 {
144  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
145  {
146  return new QgsProcessingParameterVectorLayer( name );
147  }
148 
149  QString description() const override
150  {
151  return QCoreApplication::translate( "Processing", "A vector layer parameter, e.g. for algorithms which change layer styles, edit layers in place, or other operations which affect an entire layer." );
152  }
153 
154  QString name() const override
155  {
156  return QCoreApplication::translate( "Processing", "Vector Layer" );
157  }
158 
159  QString pythonImportString() const override
160  {
161  return QStringLiteral( "from qgis.core import QgsProcessingParameterVectorLayer" );
162  }
163 
164  QString className() const override
165  {
166  return QStringLiteral( "QgsProcessingParameterVectorLayer" );
167  }
168 
169  QString id() const override
170  {
171  return QStringLiteral( "vector" );
172  }
173 
174  QStringList acceptedPythonTypes() const override
175  {
176  return QStringList() << QObject::tr( "str: layer ID" )
177  << QObject::tr( "str: layer name" )
178  << QObject::tr( "str: layer source" )
179  << QStringLiteral( "QgsProperty" )
180  << QStringLiteral( "QgsVectorLayer" );
181  }
182 
183  QStringList acceptedStringValues() const override
184  {
185  return QStringList() << QObject::tr( "Path to a vector layer" );
186  }
187 };
188 
197 {
198  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
199  {
200  return new QgsProcessingParameterMapLayer( name );
201  }
202 
203  QString description() const override
204  {
205  return QCoreApplication::translate( "Processing", "A generic map layer parameter, which accepts either vector or raster layers." );
206  }
207 
208  QString name() const override
209  {
210  return QCoreApplication::translate( "Processing", "Map Layer" );
211  }
212 
213  QString id() const override
214  {
215  return QStringLiteral( "layer" );
216  }
217 
218  QString pythonImportString() const override
219  {
220  return QStringLiteral( "from qgis.core import QgsProcessingParameterMapLayer" );
221  }
222 
223  QString className() const override
224  {
225  return QStringLiteral( "QgsProcessingParameterMapLayer" );
226  }
227 
228  QStringList acceptedPythonTypes() const override
229  {
230  return QStringList() << QObject::tr( "str: layer ID" )
231  << QObject::tr( "str: layer name" )
232  << QObject::tr( "str: layer source" )
233  << QStringLiteral( "QgsMapLayer" )
234  << QStringLiteral( "QgsProperty" )
235  << QStringLiteral( "QgsRasterLayer" )
236  << QStringLiteral( "QgsVectorLayer" );
237  }
238 
239  QStringList acceptedStringValues() const override
240  {
241  return QStringList() << QObject::tr( "Path to a vector, raster or mesh layer" );
242  }
243 };
244 
253 {
254  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
255  {
256  return new QgsProcessingParameterBoolean( name );
257  }
258 
259  QString description() const override
260  {
261  return QCoreApplication::translate( "Processing", "A boolean parameter, for true/false values." );
262  }
263 
264  QString name() const override
265  {
266  return QCoreApplication::translate( "Processing", "Boolean" );
267  }
268 
269  QString id() const override
270  {
271  return QStringLiteral( "boolean" );
272  }
273 
274  QString pythonImportString() const override
275  {
276  return QStringLiteral( "from qgis.core import QgsProcessingParameterBoolean" );
277  }
278 
279  QString className() const override
280  {
281  return QStringLiteral( "QgsProcessingParameterBoolean" );
282  }
283 
284  QStringList acceptedPythonTypes() const override
285  {
286  return QStringList() << QStringLiteral( "bool" )
287  << QStringLiteral( "int" )
288  << QStringLiteral( "str" )
289  << QStringLiteral( "QgsProperty" );
290  }
291 
292  QStringList acceptedStringValues() const override
293  {
294  return QStringList() << QObject::tr( "1 for true/yes" )
295  << QObject::tr( "0 for false/no" );
296  }
297 };
298 
307 {
308  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
309  {
310  return new QgsProcessingParameterExpression( name );
311  }
312 
313  QString description() const override
314  {
315  return QCoreApplication::translate( "Processing", "An expression parameter, to add custom expressions based on layer fields." );
316  }
317 
318  QString name() const override
319  {
320  return QCoreApplication::translate( "Processing", "Expression" );
321  }
322 
323  QString id() const override
324  {
325  return QStringLiteral( "expression" );
326  }
327 
328  QString pythonImportString() const override
329  {
330  return QStringLiteral( "from qgis.core import QgsProcessingParameterExpression" );
331  }
332 
333  QString className() const override
334  {
335  return QStringLiteral( "QgsProcessingParameterExpression" );
336  }
337 
338  QStringList acceptedPythonTypes() const override
339  {
340  return QStringList() << QStringLiteral( "str" )
341  << QStringLiteral( "QgsProperty" );
342  }
343 
344  QStringList acceptedStringValues() const override
345  {
346  return QStringList() << QObject::tr( "A valid QGIS expression string, e.g \"road_name\" = 'MAIN RD'" );
347  }
348 };
349 
358 {
359  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
360  {
361  return new QgsProcessingParameterCrs( name );
362  }
363 
364  QString description() const override
365  {
366  return QCoreApplication::translate( "Processing", "A coordinate reference system (CRS) input parameter." );
367  }
368 
369  QString name() const override
370  {
371  return QCoreApplication::translate( "Processing", "CRS" );
372  }
373 
374  QString id() const override
375  {
376  return QStringLiteral( "crs" );
377  }
378 
379  QString pythonImportString() const override
380  {
381  return QStringLiteral( "from qgis.core import QgsProcessingParameterCrs" );
382  }
383 
384  QString className() const override
385  {
386  return QStringLiteral( "QgsProcessingParameterCrs" );
387  }
388 
389  QStringList acceptedPythonTypes() const override
390  {
391  return QStringList()
392  << QStringLiteral( "str: 'ProjectCrs'" )
393  << QObject::tr( "str: CRS auth ID (e.g. 'EPSG:3111')" )
394  << QObject::tr( "str: CRS PROJ4 (e.g. 'PROJ4:…')" )
395  << QObject::tr( "str: CRS WKT (e.g. 'WKT:…')" )
396  << QObject::tr( "str: layer ID. CRS of layer is used." )
397  << QObject::tr( "str: layer name. CRS of layer is used." )
398  << QObject::tr( "str: layer source. CRS of layer is used." )
399  << QObject::tr( "QgsCoordinateReferenceSystem" )
400  << QObject::tr( "QgsMapLayer: CRS of layer is used" )
401  << QObject::tr( "QgsProcessingFeatureSourceDefinition: CRS of source is used" )
402  << QStringLiteral( "QgsProperty" );
403  }
404 
405  QStringList acceptedStringValues() const override
406  {
407  return QStringList() << QObject::tr( "CRS as an auth ID (e.g. 'EPSG:3111')" )
408  << QObject::tr( "CRS as a PROJ4 string (e.g. 'PROJ4:…')" )
409  << QObject::tr( "CRS as a WKT string (e.g. 'WKT:…')" )
410  << QObject::tr( "Path to a layer. The CRS of the layer is used." ) ;
411  }
412 };
413 
422 {
423  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
424  {
425  return new QgsProcessingParameterRange( name );
426  }
427 
428  QString description() const override
429  {
430  return QCoreApplication::translate( "Processing", "A numeric range parameter for processing algorithms." );
431  }
432 
433  QString name() const override
434  {
435  return QCoreApplication::translate( "Processing", "Range" );
436  }
437 
438  QString id() const override
439  {
440  return QStringLiteral( "range" );
441  }
442 
443  QString pythonImportString() const override
444  {
445  return QStringLiteral( "from qgis.core import QgsProcessingParameterRange" );
446  }
447 
448  QString className() const override
449  {
450  return QStringLiteral( "QgsProcessingParameterRange" );
451  }
452 
453  QStringList acceptedPythonTypes() const override
454  {
455  return QStringList() << QObject::tr( "list[float]: list of 2 float values" )
456  << QObject::tr( "list[str]: list of strings representing floats" )
457  << QObject::tr( "str: as two comma delimited floats, e.g. '1,10'" )
458  << QStringLiteral( "QgsProperty" );
459  }
460 
461  QStringList acceptedStringValues() const override
462  {
463  return QStringList() << QObject::tr( "Two comma separated numeric values, e.g. '1,10'" );
464  }
465 };
466 
475 {
476  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
477  {
478  return new QgsProcessingParameterPoint( name );
479  }
480 
481  QString description() const override
482  {
483  return QCoreApplication::translate( "Processing", "A geographic point parameter." );
484  }
485 
486  QString name() const override
487  {
488  return QCoreApplication::translate( "Processing", "Point" );
489  }
490 
491  QString id() const override
492  {
493  return QStringLiteral( "point" );
494  }
495 
496  QString pythonImportString() const override
497  {
498  return QStringLiteral( "from qgis.core import QgsProcessingParameterPoint" );
499  }
500 
501  QString className() const override
502  {
503  return QStringLiteral( "QgsProcessingParameterPoint" );
504  }
505 
506  QStringList acceptedPythonTypes() const override
507  {
508  return QStringList() << QObject::tr( "str: as an 'x,y' string, e.g. '1.5,10.1'" )
509  << QStringLiteral( "QgsPointXY" )
510  << QStringLiteral( "QgsProperty" )
511  << QStringLiteral( "QgsReferencedPointXY" )
512  << QStringLiteral( "QgsGeometry: centroid of geometry is used" );
513  }
514 
515  QStringList acceptedStringValues() const override
516  {
517  return QStringList() << QObject::tr( "Point coordinate as an 'x,y' string, e.g. '1.5,10.1'" );
518  }
519 };
520 
529 {
530  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
531  {
532  return new QgsProcessingParameterEnum( name );
533  }
534 
535  QString description() const override
536  {
537  return QCoreApplication::translate( "Processing", "An enumerated type parameter." );
538  }
539 
540  QString name() const override
541  {
542  return QCoreApplication::translate( "Processing", "Enum" );
543  }
544 
545  QString id() const override
546  {
547  return QStringLiteral( "enum" );
548  }
549 
550  QString pythonImportString() const override
551  {
552  return QStringLiteral( "from qgis.core import QgsProcessingParameterEnum" );
553  }
554 
555  QString className() const override
556  {
557  return QStringLiteral( "QgsProcessingParameterEnum" );
558  }
559 
560  QStringList acceptedPythonTypes() const override
561  {
562  return QStringList() << QStringLiteral( "int" )
563  << QObject::tr( "str: as string representation of int, e.g. '1'" )
564  << QStringLiteral( "QgsProperty" );
565  }
566 
567  QStringList acceptedStringValues() const override
568  {
569  return QStringList() << QObject::tr( "Number of selected option, e.g. '1'" )
570  << QObject::tr( "Comma separated list of options, e.g. '1,3'" );
571  }
572 };
573 
582 {
583  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
584  {
585  return new QgsProcessingParameterExtent( name );
586  }
587 
588  QString description() const override
589  {
590  return QCoreApplication::translate( "Processing", "A map extent parameter." );
591  }
592 
593  QString name() const override
594  {
595  return QCoreApplication::translate( "Processing", "Extent" );
596  }
597 
598  QString id() const override
599  {
600  return QStringLiteral( "extent" );
601  }
602 
603  QString pythonImportString() const override
604  {
605  return QStringLiteral( "from qgis.core import QgsProcessingParameterExtent" );
606  }
607 
608  QString className() const override
609  {
610  return QStringLiteral( "QgsProcessingParameterExtent" );
611  }
612 
613  QStringList acceptedPythonTypes() const override
614  {
615  return QStringList() << QObject::tr( "str: as comma delimited list of x min, x max, y min, y max. E.g. '4,10,101,105'" )
616  << QObject::tr( "str: layer ID. Extent of layer is used." )
617  << QObject::tr( "str: layer name. Extent of layer is used." )
618  << QObject::tr( "str: layer source. Extent of layer is used." )
619  << QObject::tr( "QgsMapLayer: Extent of layer is used" )
620  << QObject::tr( "QgsProcessingFeatureSourceDefinition: Extent of source is used" )
621  << QStringLiteral( "QgsProperty" )
622  << QStringLiteral( "QgsRectangle" )
623  << QStringLiteral( "QgsReferencedRectangle" );
624  }
625 
626  QStringList acceptedStringValues() const override
627  {
628  return QStringList() << QObject::tr( "A comma delimited string of x min, x max, y min, y max. E.g. '4,10,101,105'" )
629  << QObject::tr( "Path to a layer. The extent of the layer is used." ) ;
630  }
631 };
632 
641 {
642  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
643  {
644  return new QgsProcessingParameterMatrix( name );
645  }
646 
647  QString description() const override
648  {
649  return QCoreApplication::translate( "Processing", "A table (matrix) parameter for processing algorithms." );
650  }
651 
652  QString name() const override
653  {
654  return QCoreApplication::translate( "Processing", "Matrix" );
655  }
656 
657  QString id() const override
658  {
659  return QStringLiteral( "matrix" );
660  }
661 
662  QString pythonImportString() const override
663  {
664  return QStringLiteral( "from qgis.core import QgsProcessingParameterMatrix" );
665  }
666 
667  QString className() const override
668  {
669  return QStringLiteral( "QgsProcessingParameterMatrix" );
670  }
671 
672  QStringList acceptedPythonTypes() const override
673  {
674  return QStringList() << QObject::tr( "str: as comma delimited list of values" )
675  << QStringLiteral( "list" )
676  << QStringLiteral( "QgsProperty" );
677  }
678 
679  QStringList acceptedStringValues() const override
680  {
681  return QStringList() << QObject::tr( "A comma delimited list of values" );
682  }
683 };
684 
693 {
694  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
695  {
696  return new QgsProcessingParameterFile( name );
697  }
698 
699  QString description() const override
700  {
701  return QCoreApplication::translate( "Processing", "A file or folder parameter, for use with non-map layer file sources or folders." );
702  }
703 
704  QString name() const override
705  {
706  return QCoreApplication::translate( "Processing", "File/Folder" );
707  }
708 
709  QString id() const override
710  {
711  return QStringLiteral( "file" );
712  }
713 
714  QString pythonImportString() const override
715  {
716  return QStringLiteral( "from qgis.core import QgsProcessingParameterFile" );
717  }
718 
719  QString className() const override
720  {
721  return QStringLiteral( "QgsProcessingParameterFile" );
722  }
723 
724  QStringList acceptedPythonTypes() const override
725  {
726  return QStringList() << QStringLiteral( "str" )
727  << QStringLiteral( "QgsProperty" );
728  }
729 
730  QStringList acceptedStringValues() const override
731  {
732  return QStringList() << QObject::tr( "Path to a file" );
733  }
734 };
735 
744 {
745  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
746  {
747  return new QgsProcessingParameterField( name );
748  }
749 
750  QString description() const override
751  {
752  return QCoreApplication::translate( "Processing", "A vector field parameter, for selecting an existing field from a vector source." );
753  }
754 
755  QString name() const override
756  {
757  return QCoreApplication::translate( "Processing", "Vector Field" );
758  }
759 
760  QString id() const override
761  {
762  return QStringLiteral( "field" );
763  }
764 
765  QString pythonImportString() const override
766  {
767  return QStringLiteral( "from qgis.core import QgsProcessingParameterField" );
768  }
769 
770  QString className() const override
771  {
772  return QStringLiteral( "QgsProcessingParameterField" );
773  }
774 
775  QStringList acceptedPythonTypes() const override
776  {
777  return QStringList() << QStringLiteral( "str" )
778  << QStringLiteral( "QgsProperty" );
779  }
780 
781  QStringList acceptedStringValues() const override
782  {
783  return QStringList() << QObject::tr( "The name of an existing field" )
784  << QObject::tr( "; delimited list of existing field names" );
785  }
786 };
787 
797 {
798  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
799  {
800  return new QgsProcessingParameterVectorDestination( name );
801  }
802 
803  QString description() const override
804  {
805  return QCoreApplication::translate( "Processing", "A vector layer destination parameter." );
806  }
807 
808  QString name() const override
809  {
810  return QCoreApplication::translate( "Processing", "Vector Destination" );
811  }
812 
813  QString id() const override
814  {
815  return QStringLiteral( "vectorDestination" );
816  }
817 
818  QString pythonImportString() const override
819  {
820  return QStringLiteral( "from qgis.core import QgsProcessingParameterVectorDestination" );
821  }
822 
823  QString className() const override
824  {
825  return QStringLiteral( "QgsProcessingParameterVectorDestination" );
826  }
827 
828  ParameterFlags flags() const override
829  {
830  ParameterFlags flags = QgsProcessingParameterType::flags();
831  flags.setFlag( ParameterFlag::ExposeToModeler, false );
832  return flags;
833  }
834 
835  QStringList acceptedPythonTypes() const override
836  {
837  return QStringList() << QStringLiteral( "str" )
838  << QStringLiteral( "QgsProperty" )
839  << QStringLiteral( "QgsProcessingOutputLayerDefinition" );
840  }
841 
842  QStringList acceptedStringValues() const override
843  {
844  return QStringList() << QObject::tr( "Path for new vector layer" );
845  }
846 
847 };
848 
858 {
859  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
860  {
861  return new QgsProcessingParameterFileDestination( name );
862  }
863 
864  QString description() const override
865  {
866  return QCoreApplication::translate( "Processing", "A generic file based destination parameter." );
867  }
868 
869  QString name() const override
870  {
871  return QCoreApplication::translate( "Processing", "File Destination" );
872  }
873 
874  QString id() const override
875  {
876  return QStringLiteral( "fileDestination" );
877  }
878 
879  QString pythonImportString() const override
880  {
881  return QStringLiteral( "from qgis.core import QgsProcessingParameterFileDestination" );
882  }
883 
884  QString className() const override
885  {
886  return QStringLiteral( "QgsProcessingParameterFileDestination" );
887  }
888 
889  ParameterFlags flags() const override
890  {
891  ParameterFlags flags = QgsProcessingParameterType::flags();
892  flags.setFlag( ParameterFlag::ExposeToModeler, false );
893  return flags;
894  }
895 
896  QStringList acceptedPythonTypes() const override
897  {
898  return QStringList() << QStringLiteral( "str" )
899  << QStringLiteral( "QgsProperty" );
900  }
901 
902  QStringList acceptedStringValues() const override
903  {
904  return QStringList() << QObject::tr( "Path for new file" );
905  }
906 
907 };
908 
919 {
920  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
921  {
922  return new QgsProcessingParameterFolderDestination( name );
923  }
924 
925  QString description() const override
926  {
927  return QCoreApplication::translate( "Processing", "A folder destination parameter." );
928  }
929 
930  QString name() const override
931  {
932  return QCoreApplication::translate( "Processing", "Folder Destination" );
933  }
934 
935  QString id() const override
936  {
937  return QStringLiteral( "folderDestination" );
938  }
939 
940  QString pythonImportString() const override
941  {
942  return QStringLiteral( "from qgis.core import QgsProcessingParameterFolderDestination" );
943  }
944 
945  QString className() const override
946  {
947  return QStringLiteral( "QgsProcessingParameterFolderDestination" );
948  }
949 
950  ParameterFlags flags() const override
951  {
952  ParameterFlags flags = QgsProcessingParameterType::flags();
953  flags.setFlag( ParameterFlag::ExposeToModeler, false );
954  return flags;
955  }
956 
957  QStringList acceptedPythonTypes() const override
958  {
959  return QStringList() << QStringLiteral( "str" )
960  << QStringLiteral( "QgsProperty" );
961  }
962 
963  QStringList acceptedStringValues() const override
964  {
965  return QStringList() << QObject::tr( "Path for an existing or new folder" );
966  }
967 
968 };
969 
979 {
980  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
981  {
982  return new QgsProcessingParameterRasterDestination( name );
983  }
984 
985  QString description() const override
986  {
987  return QCoreApplication::translate( "Processing", "A raster layer destination parameter." );
988  }
989 
990  QString name() const override
991  {
992  return QCoreApplication::translate( "Processing", "Raster Destination" );
993  }
994 
995  QString id() const override
996  {
997  return QStringLiteral( "rasterDestination" );
998  }
999 
1000  QString pythonImportString() const override
1001  {
1002  return QStringLiteral( "from qgis.core import QgsProcessingParameterRasterDestination" );
1003  }
1004 
1005  QString className() const override
1006  {
1007  return QStringLiteral( "QgsProcessingParameterRasterDestination" );
1008  }
1009 
1010  ParameterFlags flags() const override
1011  {
1012  ParameterFlags flags = QgsProcessingParameterType::flags();
1013  flags.setFlag( ParameterFlag::ExposeToModeler, false );
1014  return flags;
1015  }
1016 
1017  QStringList acceptedPythonTypes() const override
1018  {
1019  return QStringList() << QStringLiteral( "str" )
1020  << QStringLiteral( "QgsProperty" )
1021  << QStringLiteral( "QgsProcessingOutputLayerDefinition" );
1022  }
1023 
1024  QStringList acceptedStringValues() const override
1025  {
1026  return QStringList() << QObject::tr( "Path for new raster layer" );
1027  }
1028 
1029 };
1030 
1039 {
1040  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1041  {
1042  return new QgsProcessingParameterString( name );
1043  }
1044 
1045  QString description() const override
1046  {
1047  return QCoreApplication::translate( "Processing", "A freeform string parameter." );
1048  }
1049 
1050  QString name() const override
1051  {
1052  return QCoreApplication::translate( "Processing", "String" );
1053  }
1054 
1055  QString id() const override
1056  {
1057  return QStringLiteral( "string" );
1058  }
1059 
1060  QString pythonImportString() const override
1061  {
1062  return QStringLiteral( "from qgis.core import QgsProcessingParameterString" );
1063  }
1064 
1065  QString className() const override
1066  {
1067  return QStringLiteral( "QgsProcessingParameterString" );
1068  }
1069 
1070  QStringList acceptedPythonTypes() const override
1071  {
1072  return QStringList() << QStringLiteral( "str" )
1073  << QStringLiteral( "QgsProperty" );
1074  }
1075 
1076  QStringList acceptedStringValues() const override
1077  {
1078  return QStringList() << QObject::tr( "String value" );
1079  }
1080 
1081 };
1082 
1091 {
1092  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1093  {
1094  return new QgsProcessingParameterAuthConfig( name );
1095  }
1096 
1097  QString description() const override
1098  {
1099  return QCoreApplication::translate( "Processing", "A authentication configuration parameter." );
1100  }
1101 
1102  QString name() const override
1103  {
1104  return QCoreApplication::translate( "Processing", "Authentication Configuration" );
1105  }
1106 
1107  QString id() const override
1108  {
1109  return QStringLiteral( "authcfg" );
1110  }
1111 
1112  QString pythonImportString() const override
1113  {
1114  return QStringLiteral( "from qgis.core import QgsProcessingParameterAuthConfig" );
1115  }
1116 
1117  QString className() const override
1118  {
1119  return QStringLiteral( "QgsProcessingParameterAuthConfig" );
1120  }
1121 
1122  QStringList acceptedPythonTypes() const override
1123  {
1124  return QStringList() << QStringLiteral( "str" );
1125  }
1126 
1127  QStringList acceptedStringValues() const override
1128  {
1129  return QStringList() << QObject::tr( "An existing QGIS authentication ID string" );
1130  }
1131 
1132 };
1133 
1142 {
1143  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1144  {
1145  return new QgsProcessingParameterMultipleLayers( name );
1146  }
1147 
1148  QString description() const override
1149  {
1150  return QCoreApplication::translate( "Processing", "An input allowing selection of multiple sources, including multiple map layers or file sources." );
1151  }
1152 
1153  QString name() const override
1154  {
1155  return QCoreApplication::translate( "Processing", "Multiple Input" );
1156  }
1157 
1158  QString id() const override
1159  {
1160  return QStringLiteral( "multilayer" );
1161  }
1162 
1163  QString pythonImportString() const override
1164  {
1165  return QStringLiteral( "from qgis.core import QgsProcessingParameterMultipleLayers" );
1166  }
1167 
1168  QString className() const override
1169  {
1170  return QStringLiteral( "QgsProcessingParameterMultipleLayers" );
1171  }
1172 
1173  QStringList acceptedPythonTypes() const override
1174  {
1175  return QStringList() << QObject::tr( "list[str]: list of layer IDs" )
1176  << QObject::tr( "list[str]: list of layer names" )
1177  << QObject::tr( "list[str]: list of layer sources" )
1178  << QStringLiteral( "list[QgsMapLayer]" )
1179  << QStringLiteral( "QgsProperty" );
1180  }
1181 };
1182 
1191 {
1192  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1193  {
1194  return new QgsProcessingParameterFeatureSource( name );
1195  }
1196 
1197  QString description() const override
1198  {
1199  return QCoreApplication::translate( "Processing", "A vector feature parameter, e.g. for algorithms which operate on the features within a layer." );
1200  }
1201 
1202  QString name() const override
1203  {
1204  return QCoreApplication::translate( "Processing", "Vector Features" );
1205  }
1206 
1207  QString id() const override
1208  {
1209  return QStringLiteral( "source" );
1210  }
1211 
1212  QString pythonImportString() const override
1213  {
1214  return QStringLiteral( "from qgis.core import QgsProcessingParameterFeatureSource" );
1215  }
1216 
1217  QString className() const override
1218  {
1219  return QStringLiteral( "QgsProcessingParameterFeatureSource" );
1220  }
1221 
1222  QStringList acceptedPythonTypes() const override
1223  {
1224  return QStringList() << QObject::tr( "str: layer ID" )
1225  << QObject::tr( "str: layer name" )
1226  << QObject::tr( "str: layer source" )
1227  << QStringLiteral( "QgsProcessingFeatureSourceDefinition" )
1228  << QStringLiteral( "QgsProperty" )
1229  << QStringLiteral( "QgsVectorLayer" );
1230  }
1231 
1232  QStringList acceptedStringValues() const override
1233  {
1234  return QStringList() << QObject::tr( "Path to a vector layer" );
1235  }
1236 
1237 };
1238 
1247 {
1248  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1249  {
1250  return new QgsProcessingParameterNumber( name );
1251  }
1252 
1253  QString description() const override
1254  {
1255  return QCoreApplication::translate( "Processing", "A numeric parameter, including float or integer values." );
1256  }
1257 
1258  QString name() const override
1259  {
1260  return QCoreApplication::translate( "Processing", "Number" );
1261  }
1262 
1263  QString id() const override
1264  {
1265  return QStringLiteral( "number" );
1266  }
1267 
1268  QString pythonImportString() const override
1269  {
1270  return QStringLiteral( "from qgis.core import QgsProcessingParameterNumber" );
1271  }
1272 
1273  QString className() const override
1274  {
1275  return QStringLiteral( "QgsProcessingParameterNumber" );
1276  }
1277 
1278  QStringList acceptedPythonTypes() const override
1279  {
1280  return QStringList() << QStringLiteral( "int" )
1281  << QStringLiteral( "float" )
1282  << QStringLiteral( "QgsProperty" );
1283  }
1284 
1285  QStringList acceptedStringValues() const override
1286  {
1287  return QStringList() << QObject::tr( "A numeric value" );
1288  }
1289 
1290 };
1291 
1300 {
1301  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1302  {
1303  return new QgsProcessingParameterDistance( name );
1304  }
1305 
1306  QString description() const override
1307  {
1308  return QCoreApplication::translate( "Processing", "A numeric parameter representing a distance measure." );
1309  }
1310 
1311  QString name() const override
1312  {
1313  return QCoreApplication::translate( "Processing", "Distance" );
1314  }
1315 
1316  QString id() const override
1317  {
1318  return QStringLiteral( "distance" );
1319  }
1320 
1321  QString pythonImportString() const override
1322  {
1323  return QStringLiteral( "from qgis.core import QgsProcessingParameterDistance" );
1324  }
1325 
1326  QString className() const override
1327  {
1328  return QStringLiteral( "QgsProcessingParameterDistance" );
1329  }
1330 
1331  QStringList acceptedPythonTypes() const override
1332  {
1333  return QStringList() << QStringLiteral( "int" )
1334  << QStringLiteral( "float" )
1335  << QStringLiteral( "QgsProperty" );
1336  }
1337 
1338  QStringList acceptedStringValues() const override
1339  {
1340  return QStringList() << QObject::tr( "A numeric value" );
1341  }
1342 
1343 
1344 };
1345 
1346 
1355 {
1356  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1357  {
1358  return new QgsProcessingParameterScale( name );
1359  }
1360 
1361  QString description() const override
1362  {
1363  return QCoreApplication::translate( "Processing", "A numeric parameter representing a map scale." );
1364  }
1365 
1366  QString name() const override
1367  {
1368  return QCoreApplication::translate( "Processing", "Scale" );
1369  }
1370 
1371  QString id() const override
1372  {
1373  return QStringLiteral( "scale" );
1374  }
1375 
1376  QString pythonImportString() const override
1377  {
1378  return QStringLiteral( "from qgis.core import QgsProcessingParameterScale" );
1379  }
1380 
1381  QString className() const override
1382  {
1383  return QStringLiteral( "QgsProcessingParameterScale" );
1384  }
1385 
1386  QStringList acceptedPythonTypes() const override
1387  {
1388  return QStringList() << QStringLiteral( "int: scale denominator" )
1389  << QStringLiteral( "float: scale denominator" )
1390  << QStringLiteral( "QgsProperty" );
1391  }
1392 
1393  QStringList acceptedStringValues() const override
1394  {
1395  return QStringList() << QObject::tr( "A numeric value representing the scale denominator" );
1396  }
1397 
1398 
1399 };
1400 
1409 {
1410  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1411  {
1412  return new QgsProcessingParameterBand( name );
1413  }
1414 
1415  QString description() const override
1416  {
1417  return QCoreApplication::translate( "Processing", "A raster band parameter, for selecting an existing band from a raster source." );
1418  }
1419 
1420  QString name() const override
1421  {
1422  return QCoreApplication::translate( "Processing", "Raster Band" );
1423  }
1424 
1425  QString id() const override
1426  {
1427  return QStringLiteral( "band" );
1428  }
1429 
1430  QString pythonImportString() const override
1431  {
1432  return QStringLiteral( "from qgis.core import QgsProcessingParameterBand" );
1433  }
1434 
1435  QString className() const override
1436  {
1437  return QStringLiteral( "QgsProcessingParameterBand" );
1438  }
1439 
1440  QStringList acceptedPythonTypes() const override
1441  {
1442  return QStringList() << QStringLiteral( "int" )
1443  << QStringLiteral( "QgsProperty" );
1444  }
1445 
1446  QStringList acceptedStringValues() const override
1447  {
1448  return QStringList() << QObject::tr( "Integer value representing an existing raster band number" );
1449  }
1450 
1451 
1452 };
1453 
1462 {
1463  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1464  {
1465  return new QgsProcessingParameterFeatureSink( name );
1466  }
1467 
1468  ParameterFlags flags() const override
1469  {
1470  ParameterFlags flags = QgsProcessingParameterType::flags();
1471  flags.setFlag( ParameterFlag::ExposeToModeler, false );
1472  return flags;
1473  }
1474 
1475  QString description() const override
1476  {
1477  return QCoreApplication::translate( "Processing", "A feature sink destination parameter." );
1478  }
1479 
1480  QString name() const override
1481  {
1482  return QCoreApplication::translate( "Processing", "Feature Sink" );
1483  }
1484 
1485  QString id() const override
1486  {
1487  return QStringLiteral( "sink" );
1488  }
1489 
1490  QString pythonImportString() const override
1491  {
1492  return QStringLiteral( "from qgis.core import QgsProcessingParameterFeatureSink" );
1493  }
1494 
1495  QString className() const override
1496  {
1497  return QStringLiteral( "QgsProcessingParameterFeatureSink" );
1498  }
1499 
1500  QStringList acceptedPythonTypes() const override
1501  {
1502  return QStringList() << QObject::tr( "str: destination vector file, e.g. 'd:/test.shp'" )
1503  << QObject::tr( "str: 'memory:' to store result in temporary memory layer" )
1504  << QObject::tr( "str: using vector provider ID prefix and destination URI, e.g. 'postgres:…' to store result in PostGIS table" )
1505  << QStringLiteral( "QgsProcessingOutputLayerDefinition" )
1506  << QStringLiteral( "QgsProperty" );
1507  }
1508 
1509  QStringList acceptedStringValues() const override
1510  {
1511  return QStringList() << QObject::tr( "Path for new vector layer" );
1512  }
1513 
1514 
1515 };
1516 
1517 
1526 {
1527  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1528  {
1529  return new QgsProcessingParameterLayout( name );
1530  }
1531 
1532  QString description() const override
1533  {
1534  return QCoreApplication::translate( "Processing", "A print layout parameter." );
1535  }
1536 
1537  QString name() const override
1538  {
1539  return QCoreApplication::translate( "Processing", "Print Layout" );
1540  }
1541 
1542  QString id() const override
1543  {
1544  return QStringLiteral( "layout" );
1545  }
1546 
1547  QString pythonImportString() const override
1548  {
1549  return QStringLiteral( "from qgis.core import QgsProcessingParameterLayout" );
1550  }
1551 
1552  QString className() const override
1553  {
1554  return QStringLiteral( "QgsProcessingParameterLayout" );
1555  }
1556 
1557  QStringList acceptedPythonTypes() const override
1558  {
1559  return QStringList() << QObject::tr( "str: name of print layout in current project" )
1560  << QStringLiteral( "QgsProperty" );
1561  }
1562 
1563  QStringList acceptedStringValues() const override
1564  {
1565  return QStringList() << QObject::tr( "Name of print layout in current project" );
1566  }
1567 
1568 
1569 };
1570 
1571 
1572 
1581 {
1582  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1583  {
1584  return new QgsProcessingParameterLayoutItem( name );
1585  }
1586 
1587  QString description() const override
1588  {
1589  return QCoreApplication::translate( "Processing", "A print layout item parameter." );
1590  }
1591 
1592  QString name() const override
1593  {
1594  return QCoreApplication::translate( "Processing", "Print Layout Item" );
1595  }
1596 
1597  QString id() const override
1598  {
1599  return QStringLiteral( "layoutitem" );
1600  }
1601 
1602  QString pythonImportString() const override
1603  {
1604  return QStringLiteral( "from qgis.core import QgsProcessingParameterLayoutItem" );
1605  }
1606 
1607  QString className() const override
1608  {
1609  return QStringLiteral( "QgsProcessingParameterLayoutItem" );
1610  }
1611 
1612  QStringList acceptedPythonTypes() const override
1613  {
1614  return QStringList() << QObject::tr( "str: UUID of print layout item" )
1615  << QObject::tr( "str: id of print layout item" )
1616  << QStringLiteral( "QgsProperty" );
1617  }
1618 
1619  QStringList acceptedStringValues() const override
1620  {
1621  return QStringList() << QObject::tr( "UUID or item id of layout item" );
1622  }
1623 
1624 
1625 };
1626 #endif // QGSPROCESSINGPARAMETERTYPEIMPL_H
A boolean parameter for processing algorithms.
A feature sink parameter for Processing algorithms.
A vector layer destination parameter, for specifying the destination path for a vector layer created ...
An input file or folder parameter for processing algorithms.
A parameter for processing algorithms which accepts multiple map layers.
A generic file based destination parameter, for specifying the destination path for a file (non-map l...
A vector layer or feature source field parameter for processing algorithms.
A print layout parameter, allowing users to select a print layout.
A mesh layer parameter for processing algorithms.
A map layer parameter for processing algorithms.
virtual QString id() const =0
A static id for this type which will be used for storing this parameter type.
An expression parameter for processing algorithms.
A folder destination parameter, for specifying the destination path for a folder created by the algor...
virtual QStringList acceptedPythonTypes() const
Returns a list of the Python data types accepted as values for the parameter.
A numeric range parameter for processing algorithms.
An expression parameter for processing algorithms.
A raster band parameter for Processing algorithms.
A vector layer or feature source field parameter for processing algorithms.
virtual QStringList acceptedStringValues() const
Returns a descriptive list of the possible string values acceptable for the parameter.
A numeric parameter for processing algorithms.
A distance parameter for processing algorithms.
A string parameter for processing algorithms.
A feature sink output for processing algorithms.
A raster layer destination parameter, for specifying the destination path for a raster layer created ...
A vector layer parameter for processing algorithms.
A numeric range parameter for processing algorithms.
A double numeric parameter for map scale values.
A boolean parameter for processing algorithms.
A generic map layer parameter for processing algorithms.
An input file or folder parameter for processing algorithms.
A raster layer parameter for processing algorithms.
A raster layer parameter for processing algorithms.
virtual QgsProcessingParameterDefinition * create(const QString &name) const =0
Creates a new parameter of this type.
A raster layer destination parameter, for specifying the destination path for a raster layer created ...
An enum based parameter for processing algorithms, allowing for selection from predefined values...
virtual QString name() const =0
A human readable and translatable short name for this parameter type.
A scale parameter for processing algorithms.
A double numeric parameter for distance values.
A authentication configuration parameter for processing algorithms.
A vector layer (with or without geometry) parameter for processing algorithms.
#define SIP_FACTORY
Definition: qgis_sip.h:69
A print layout item parameter, allowing users to select a particular item from a print layout...
A mesh layer parameter for processing algorithms.
A coordinate reference system parameter for processing algorithms.
A rectangular map extent parameter for processing algorithms.
A numeric parameter for processing algorithms.
A generic file based destination parameter, for specifying the destination path for a file (non-map l...
A point parameter for processing algorithms.
A table (matrix) parameter for processing algorithms.
A vector layer destination parameter, for specifying the destination path for a vector layer created ...
A parameter for processing algorithms which accepts multiple map layers.
A point parameter for processing algorithms.
A crs parameter for processing algorithms.
virtual QString description() const =0
A human readable and translatable description for this parameter type.
An input feature source (such as vector layers) parameter for processing algorithms.
A folder destination parameter, for specifying the destination path for a folder created by the algor...
virtual QString className() const
Returns the corresponding class name for the parameter type.
Makes metadata of processing parameters available.
Base class for the definition of processing parameters.
virtual QString pythonImportString() const
Returns a valid Python import string for importing the corresponding parameter type, e.g.
An input feature source (such as vector layers) parameter for processing algorithms.
A rectangular map extent parameter for processing algorithms.
An enum based parameter for processing algorithms, allowing for selection from predefined values...
A table (matrix) parameter for processing algorithms.
A string parameter for authentication configuration ID values.
virtual ParameterFlags flags() const
Determines if this parameter is available in the modeler.
A print layout parameter for Processing algorithms.
A raster band parameter for Processing algorithms.
A string parameter for processing algorithms.
A print layout item parameter for Processing algorithms.