QGIS API Documentation  3.6.0-Noosa (5873452)
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 
85 {
86  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
87  {
88  return new QgsProcessingParameterMeshLayer( name );
89  }
90 
91  QString description() const override
92  {
93  return QCoreApplication::translate( "Processing", "A mesh layer parameter." );
94  }
95 
96  QString name() const override
97  {
98  return QCoreApplication::translate( "Processing", "Mesh Layer" );
99  }
100 
101  QString pythonImportString() const override
102  {
103  return QStringLiteral( "from qgis.core import QgsProcessingParameterMeshLayer" );
104  }
105 
106  QString className() const override
107  {
108  return QStringLiteral( "QgsProcessingParameterMeshLayer" );
109  }
110 
111  QString id() const override
112  {
113  return QStringLiteral( "mesh" );
114  }
115 
116  QStringList acceptedPythonTypes() const override
117  {
118  return QStringList() << QObject::tr( "str: layer ID" )
119  << QObject::tr( "str: layer name" )
120  << QObject::tr( "str: layer source" )
121  << QStringLiteral( "QgsMeshLayer" );
122  }
123 };
124 
133 {
134  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
135  {
136  return new QgsProcessingParameterVectorLayer( name );
137  }
138 
139  QString description() const override
140  {
141  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." );
142  }
143 
144  QString name() const override
145  {
146  return QCoreApplication::translate( "Processing", "Vector Layer" );
147  }
148 
149  QString pythonImportString() const override
150  {
151  return QStringLiteral( "from qgis.core import QgsProcessingParameterVectorLayer" );
152  }
153 
154  QString className() const override
155  {
156  return QStringLiteral( "QgsProcessingParameterVectorLayer" );
157  }
158 
159  QString id() const override
160  {
161  return QStringLiteral( "vector" );
162  }
163 
164  QStringList acceptedPythonTypes() const override
165  {
166  return QStringList() << QObject::tr( "str: layer ID" )
167  << QObject::tr( "str: layer name" )
168  << QObject::tr( "str: layer source" )
169  << QStringLiteral( "QgsProperty" )
170  << QStringLiteral( "QgsVectorLayer" );
171  }
172 };
173 
182 {
183  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
184  {
185  return new QgsProcessingParameterMapLayer( name );
186  }
187 
188  QString description() const override
189  {
190  return QCoreApplication::translate( "Processing", "A generic map layer parameter, which accepts either vector or raster layers." );
191  }
192 
193  QString name() const override
194  {
195  return QCoreApplication::translate( "Processing", "Map Layer" );
196  }
197 
198  QString id() const override
199  {
200  return QStringLiteral( "layer" );
201  }
202 
203  QString pythonImportString() const override
204  {
205  return QStringLiteral( "from qgis.core import QgsProcessingParameterMapLayer" );
206  }
207 
208  QString className() const override
209  {
210  return QStringLiteral( "QgsProcessingParameterMapLayer" );
211  }
212 
213  QStringList acceptedPythonTypes() const override
214  {
215  return QStringList() << QObject::tr( "str: layer ID" )
216  << QObject::tr( "str: layer name" )
217  << QObject::tr( "str: layer source" )
218  << QStringLiteral( "QgsMapLayer" )
219  << QStringLiteral( "QgsProperty" )
220  << QStringLiteral( "QgsRasterLayer" )
221  << QStringLiteral( "QgsVectorLayer" );
222  }
223 };
224 
233 {
234  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
235  {
236  return new QgsProcessingParameterBoolean( name );
237  }
238 
239  QString description() const override
240  {
241  return QCoreApplication::translate( "Processing", "A boolean parameter, for true/false values." );
242  }
243 
244  QString name() const override
245  {
246  return QCoreApplication::translate( "Processing", "Boolean" );
247  }
248 
249  QString id() const override
250  {
251  return QStringLiteral( "boolean" );
252  }
253 
254  QString pythonImportString() const override
255  {
256  return QStringLiteral( "from qgis.core import QgsProcessingParameterBoolean" );
257  }
258 
259  QString className() const override
260  {
261  return QStringLiteral( "QgsProcessingParameterBoolean" );
262  }
263 
264  QStringList acceptedPythonTypes() const override
265  {
266  return QStringList() << QStringLiteral( "bool" )
267  << QStringLiteral( "int" )
268  << QStringLiteral( "str" )
269  << QStringLiteral( "QgsProperty" );
270  }
271 };
272 
281 {
282  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
283  {
284  return new QgsProcessingParameterExpression( name );
285  }
286 
287  QString description() const override
288  {
289  return QCoreApplication::translate( "Processing", "An expression parameter, to add custom expressions based on layer fields." );
290  }
291 
292  QString name() const override
293  {
294  return QCoreApplication::translate( "Processing", "Expression" );
295  }
296 
297  QString id() const override
298  {
299  return QStringLiteral( "expression" );
300  }
301 
302  QString pythonImportString() const override
303  {
304  return QStringLiteral( "from qgis.core import QgsProcessingParameterExpression" );
305  }
306 
307  QString className() const override
308  {
309  return QStringLiteral( "QgsProcessingParameterExpression" );
310  }
311 
312  QStringList acceptedPythonTypes() const override
313  {
314  return QStringList() << QStringLiteral( "str" )
315  << QStringLiteral( "QgsProperty" );
316  }
317 };
318 
327 {
328  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
329  {
330  return new QgsProcessingParameterCrs( name );
331  }
332 
333  QString description() const override
334  {
335  return QCoreApplication::translate( "Processing", "A coordinate reference system (CRS) input parameter." );
336  }
337 
338  QString name() const override
339  {
340  return QCoreApplication::translate( "Processing", "CRS" );
341  }
342 
343  QString id() const override
344  {
345  return QStringLiteral( "crs" );
346  }
347 
348  QString pythonImportString() const override
349  {
350  return QStringLiteral( "from qgis.core import QgsProcessingParameterCrs" );
351  }
352 
353  QString className() const override
354  {
355  return QStringLiteral( "QgsProcessingParameterCrs" );
356  }
357 
358  QStringList acceptedPythonTypes() const override
359  {
360  return QStringList()
361  << QStringLiteral( "str: 'ProjectCrs'" )
362  << QObject::tr( "str: CRS auth ID (e.g. 'EPSG:3111')" )
363  << QObject::tr( "str: CRS PROJ4 (e.g. 'PROJ4:…')" )
364  << QObject::tr( "str: CRS WKT (e.g. 'WKT:…')" )
365  << QObject::tr( "str: layer ID. CRS of layer is used." )
366  << QObject::tr( "str: layer name. CRS of layer is used." )
367  << QObject::tr( "str: layer source. CRS of layer is used." )
368  << QObject::tr( "QgsCoordinateReferenceSystem" )
369  << QObject::tr( "QgsMapLayer: CRS of layer is used" )
370  << QObject::tr( "QgsProcessingFeatureSourceDefinition: CRS of source is used" )
371  << QStringLiteral( "QgsProperty" );
372  }
373 };
374 
383 {
384  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
385  {
386  return new QgsProcessingParameterRange( name );
387  }
388 
389  QString description() const override
390  {
391  return QCoreApplication::translate( "Processing", "A numeric range parameter for processing algorithms." );
392  }
393 
394  QString name() const override
395  {
396  return QCoreApplication::translate( "Processing", "Range" );
397  }
398 
399  QString id() const override
400  {
401  return QStringLiteral( "range" );
402  }
403 
404  QString pythonImportString() const override
405  {
406  return QStringLiteral( "from qgis.core import QgsProcessingParameterRange" );
407  }
408 
409  QString className() const override
410  {
411  return QStringLiteral( "QgsProcessingParameterRange" );
412  }
413 
414  QStringList acceptedPythonTypes() const override
415  {
416  return QStringList() << QObject::tr( "list[float]: list of 2 float values" )
417  << QObject::tr( "list[str]: list of strings representing floats" )
418  << QObject::tr( "str: as two comma delimited floats, e.g. '1,10'" )
419  << QStringLiteral( "QgsProperty" );
420  }
421 };
422 
431 {
432  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
433  {
434  return new QgsProcessingParameterPoint( name );
435  }
436 
437  QString description() const override
438  {
439  return QCoreApplication::translate( "Processing", "A geographic point parameter." );
440  }
441 
442  QString name() const override
443  {
444  return QCoreApplication::translate( "Processing", "Point" );
445  }
446 
447  QString id() const override
448  {
449  return QStringLiteral( "point" );
450  }
451 
452  QString pythonImportString() const override
453  {
454  return QStringLiteral( "from qgis.core import QgsProcessingParameterPoint" );
455  }
456 
457  QString className() const override
458  {
459  return QStringLiteral( "QgsProcessingParameterPoint" );
460  }
461 
462  QStringList acceptedPythonTypes() const override
463  {
464  return QStringList() << QObject::tr( "str: as an 'x,y' string, e.g. '1.5,10.1'" )
465  << QStringLiteral( "QgsPointXY" )
466  << QStringLiteral( "QgsProperty" )
467  << QStringLiteral( "QgsReferencedPointXY" );
468  }
469 };
470 
479 {
480  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
481  {
482  return new QgsProcessingParameterEnum( name );
483  }
484 
485  QString description() const override
486  {
487  return QCoreApplication::translate( "Processing", "An enumerated type parameter." );
488  }
489 
490  QString name() const override
491  {
492  return QCoreApplication::translate( "Processing", "Enum" );
493  }
494 
495  QString id() const override
496  {
497  return QStringLiteral( "enum" );
498  }
499 
500  QString pythonImportString() const override
501  {
502  return QStringLiteral( "from qgis.core import QgsProcessingParameterEnum" );
503  }
504 
505  QString className() const override
506  {
507  return QStringLiteral( "QgsProcessingParameterEnum" );
508  }
509 
510  QStringList acceptedPythonTypes() const override
511  {
512  return QStringList() << QStringLiteral( "int" )
513  << QObject::tr( "str: as string representation of int, e.g. '1'" )
514  << QStringLiteral( "QgsProperty" );
515  }
516 };
517 
526 {
527  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
528  {
529  return new QgsProcessingParameterExtent( name );
530  }
531 
532  QString description() const override
533  {
534  return QCoreApplication::translate( "Processing", "A map extent parameter." );
535  }
536 
537  QString name() const override
538  {
539  return QCoreApplication::translate( "Processing", "Extent" );
540  }
541 
542  QString id() const override
543  {
544  return QStringLiteral( "extent" );
545  }
546 
547  QString pythonImportString() const override
548  {
549  return QStringLiteral( "from qgis.core import QgsProcessingParameterExtent" );
550  }
551 
552  QString className() const override
553  {
554  return QStringLiteral( "QgsProcessingParameterExtent" );
555  }
556 
557  QStringList acceptedPythonTypes() const override
558  {
559  return QStringList() << QObject::tr( "str: as comma delimited list of x min, x max, y min, y max. E.g. '4,10,101,105'" )
560  << QObject::tr( "str: layer ID. Extent of layer is used." )
561  << QObject::tr( "str: layer name. Extent of layer is used." )
562  << QObject::tr( "str: layer source. Extent of layer is used." )
563  << QObject::tr( "QgsMapLayer: Extent of layer is used" )
564  << QObject::tr( "QgsProcessingFeatureSourceDefinition: Extent of source is used" )
565  << QStringLiteral( "QgsProperty" )
566  << QStringLiteral( "QgsRectangle" )
567  << QStringLiteral( "QgsReferencedRectangle" );
568  }
569 };
570 
579 {
580  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
581  {
582  return new QgsProcessingParameterMatrix( name );
583  }
584 
585  QString description() const override
586  {
587  return QCoreApplication::translate( "Processing", "A table (matrix) parameter for processing algorithms." );
588  }
589 
590  QString name() const override
591  {
592  return QCoreApplication::translate( "Processing", "Matrix" );
593  }
594 
595  QString id() const override
596  {
597  return QStringLiteral( "matrix" );
598  }
599 
600  QString pythonImportString() const override
601  {
602  return QStringLiteral( "from qgis.core import QgsProcessingParameterMatrix" );
603  }
604 
605  QString className() const override
606  {
607  return QStringLiteral( "QgsProcessingParameterMatrix" );
608  }
609 
610  QStringList acceptedPythonTypes() const override
611  {
612  return QStringList() << QObject::tr( "str: as comma delimited list of values" )
613  << QStringLiteral( "list" )
614  << QStringLiteral( "QgsProperty" );
615  }
616 };
617 
626 {
627  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
628  {
629  return new QgsProcessingParameterFile( name );
630  }
631 
632  QString description() const override
633  {
634  return QCoreApplication::translate( "Processing", "A file or folder parameter, for use with non-map layer file sources or folders." );
635  }
636 
637  QString name() const override
638  {
639  return QCoreApplication::translate( "Processing", "File/Folder" );
640  }
641 
642  QString id() const override
643  {
644  return QStringLiteral( "file" );
645  }
646 
647  QString pythonImportString() const override
648  {
649  return QStringLiteral( "from qgis.core import QgsProcessingParameterFile" );
650  }
651 
652  QString className() const override
653  {
654  return QStringLiteral( "QgsProcessingParameterFile" );
655  }
656 
657  QStringList acceptedPythonTypes() const override
658  {
659  return QStringList() << QStringLiteral( "str" )
660  << QStringLiteral( "QgsProperty" );
661  }
662 };
663 
672 {
673  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
674  {
675  return new QgsProcessingParameterField( name );
676  }
677 
678  QString description() const override
679  {
680  return QCoreApplication::translate( "Processing", "A vector field parameter, for selecting an existing field from a vector source." );
681  }
682 
683  QString name() const override
684  {
685  return QCoreApplication::translate( "Processing", "Vector Field" );
686  }
687 
688  QString id() const override
689  {
690  return QStringLiteral( "field" );
691  }
692 
693  QString pythonImportString() const override
694  {
695  return QStringLiteral( "from qgis.core import QgsProcessingParameterField" );
696  }
697 
698  QString className() const override
699  {
700  return QStringLiteral( "QgsProcessingParameterField" );
701  }
702 
703  QStringList acceptedPythonTypes() const override
704  {
705  return QStringList() << QStringLiteral( "str" )
706  << QStringLiteral( "QgsProperty" );
707  }
708 };
709 
719 {
720  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
721  {
722  return new QgsProcessingParameterVectorDestination( name );
723  }
724 
725  QString description() const override
726  {
727  return QCoreApplication::translate( "Processing", "A vector layer destination parameter." );
728  }
729 
730  QString name() const override
731  {
732  return QCoreApplication::translate( "Processing", "Vector Destination" );
733  }
734 
735  QString id() const override
736  {
737  return QStringLiteral( "vectorDestination" );
738  }
739 
740  QString pythonImportString() const override
741  {
742  return QStringLiteral( "from qgis.core import QgsProcessingParameterVectorDestination" );
743  }
744 
745  QString className() const override
746  {
747  return QStringLiteral( "QgsProcessingParameterVectorDestination" );
748  }
749 
750  ParameterFlags flags() const override
751  {
752  ParameterFlags flags = QgsProcessingParameterType::flags();
753  flags.setFlag( ParameterFlag::ExposeToModeler, false );
754  return flags;
755  }
756 
757  QStringList acceptedPythonTypes() const override
758  {
759  return QStringList() << QStringLiteral( "str" )
760  << QStringLiteral( "QgsProperty" )
761  << QStringLiteral( "QgsProcessingOutputLayerDefinition" );
762  }
763 };
764 
774 {
775  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
776  {
777  return new QgsProcessingParameterFileDestination( name );
778  }
779 
780  QString description() const override
781  {
782  return QCoreApplication::translate( "Processing", "A generic file based destination parameter." );
783  }
784 
785  QString name() const override
786  {
787  return QCoreApplication::translate( "Processing", "File Destination" );
788  }
789 
790  QString id() const override
791  {
792  return QStringLiteral( "fileDestination" );
793  }
794 
795  QString pythonImportString() const override
796  {
797  return QStringLiteral( "from qgis.core import QgsProcessingParameterFileDestination" );
798  }
799 
800  QString className() const override
801  {
802  return QStringLiteral( "QgsProcessingParameterFileDestination" );
803  }
804 
805  ParameterFlags flags() const override
806  {
807  ParameterFlags flags = QgsProcessingParameterType::flags();
808  flags.setFlag( ParameterFlag::ExposeToModeler, false );
809  return flags;
810  }
811 
812  QStringList acceptedPythonTypes() const override
813  {
814  return QStringList() << QStringLiteral( "str" )
815  << QStringLiteral( "QgsProperty" );
816  }
817 };
818 
829 {
830  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
831  {
832  return new QgsProcessingParameterFolderDestination( name );
833  }
834 
835  QString description() const override
836  {
837  return QCoreApplication::translate( "Processing", "A folder destination parameter." );
838  }
839 
840  QString name() const override
841  {
842  return QCoreApplication::translate( "Processing", "Folder Destination" );
843  }
844 
845  QString id() const override
846  {
847  return QStringLiteral( "folderDestination" );
848  }
849 
850  QString pythonImportString() const override
851  {
852  return QStringLiteral( "from qgis.core import QgsProcessingParameterFolderDestination" );
853  }
854 
855  QString className() const override
856  {
857  return QStringLiteral( "QgsProcessingParameterFolderDestination" );
858  }
859 
860  ParameterFlags flags() const override
861  {
862  ParameterFlags flags = QgsProcessingParameterType::flags();
863  flags.setFlag( ParameterFlag::ExposeToModeler, false );
864  return flags;
865  }
866 
867  QStringList acceptedPythonTypes() const override
868  {
869  return QStringList() << QStringLiteral( "str" )
870  << QStringLiteral( "QgsProperty" );
871  }
872 };
873 
883 {
884  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
885  {
886  return new QgsProcessingParameterRasterDestination( name );
887  }
888 
889  QString description() const override
890  {
891  return QCoreApplication::translate( "Processing", "A raster layer destination parameter." );
892  }
893 
894  QString name() const override
895  {
896  return QCoreApplication::translate( "Processing", "Raster Destination" );
897  }
898 
899  QString id() const override
900  {
901  return QStringLiteral( "rasterDestination" );
902  }
903 
904  QString pythonImportString() const override
905  {
906  return QStringLiteral( "from qgis.core import QgsProcessingParameterRasterDestination" );
907  }
908 
909  QString className() const override
910  {
911  return QStringLiteral( "QgsProcessingParameterRasterDestination" );
912  }
913 
914  ParameterFlags flags() const override
915  {
916  ParameterFlags flags = QgsProcessingParameterType::flags();
917  flags.setFlag( ParameterFlag::ExposeToModeler, false );
918  return flags;
919  }
920 
921  QStringList acceptedPythonTypes() const override
922  {
923  return QStringList() << QStringLiteral( "str" )
924  << QStringLiteral( "QgsProperty" )
925  << QStringLiteral( "QgsProcessingOutputLayerDefinition" );
926  }
927 };
928 
937 {
938  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
939  {
940  return new QgsProcessingParameterString( name );
941  }
942 
943  QString description() const override
944  {
945  return QCoreApplication::translate( "Processing", "A freeform string parameter." );
946  }
947 
948  QString name() const override
949  {
950  return QCoreApplication::translate( "Processing", "String" );
951  }
952 
953  QString id() const override
954  {
955  return QStringLiteral( "string" );
956  }
957 
958  QString pythonImportString() const override
959  {
960  return QStringLiteral( "from qgis.core import QgsProcessingParameterString" );
961  }
962 
963  QString className() const override
964  {
965  return QStringLiteral( "QgsProcessingParameterString" );
966  }
967 
968  QStringList acceptedPythonTypes() const override
969  {
970  return QStringList() << QStringLiteral( "str" )
971  << QStringLiteral( "QgsProperty" );
972  }
973 };
974 
983 {
984  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
985  {
986  return new QgsProcessingParameterAuthConfig( name );
987  }
988 
989  QString description() const override
990  {
991  return QCoreApplication::translate( "Processing", "A authentication configuration parameter." );
992  }
993 
994  QString name() const override
995  {
996  return QCoreApplication::translate( "Processing", "Authentication Configuration" );
997  }
998 
999  QString id() const override
1000  {
1001  return QStringLiteral( "authcfg" );
1002  }
1003 
1004  QString pythonImportString() const override
1005  {
1006  return QStringLiteral( "from qgis.core import QgsProcessingParameterAuthConfig" );
1007  }
1008 
1009  QString className() const override
1010  {
1011  return QStringLiteral( "QgsProcessingParameterAuthConfig" );
1012  }
1013 
1014  QStringList acceptedPythonTypes() const override
1015  {
1016  return QStringList() << QStringLiteral( "str" );
1017  }
1018 };
1019 
1028 {
1029  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1030  {
1031  return new QgsProcessingParameterMultipleLayers( name );
1032  }
1033 
1034  QString description() const override
1035  {
1036  return QCoreApplication::translate( "Processing", "An input allowing selection of multiple sources, including multiple map layers or file sources." );
1037  }
1038 
1039  QString name() const override
1040  {
1041  return QCoreApplication::translate( "Processing", "Multiple Input" );
1042  }
1043 
1044  QString id() const override
1045  {
1046  return QStringLiteral( "multilayer" );
1047  }
1048 
1049  QString pythonImportString() const override
1050  {
1051  return QStringLiteral( "from qgis.core import QgsProcessingParameterMultipleLayers" );
1052  }
1053 
1054  QString className() const override
1055  {
1056  return QStringLiteral( "QgsProcessingParameterMultipleLayers" );
1057  }
1058 
1059  QStringList acceptedPythonTypes() const override
1060  {
1061  return QStringList() << QObject::tr( "list[str]: list of layer IDs" )
1062  << QObject::tr( "list[str]: list of layer names" )
1063  << QObject::tr( "list[str]: list of layer sources" )
1064  << QStringLiteral( "list[QgsMapLayer]" )
1065  << QStringLiteral( "QgsProperty" );
1066  }
1067 };
1068 
1077 {
1078  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1079  {
1080  return new QgsProcessingParameterFeatureSource( name );
1081  }
1082 
1083  QString description() const override
1084  {
1085  return QCoreApplication::translate( "Processing", "A vector feature parameter, e.g. for algorithms which operate on the features within a layer." );
1086  }
1087 
1088  QString name() const override
1089  {
1090  return QCoreApplication::translate( "Processing", "Vector Features" );
1091  }
1092 
1093  QString id() const override
1094  {
1095  return QStringLiteral( "source" );
1096  }
1097 
1098  QString pythonImportString() const override
1099  {
1100  return QStringLiteral( "from qgis.core import QgsProcessingParameterFeatureSource" );
1101  }
1102 
1103  QString className() const override
1104  {
1105  return QStringLiteral( "QgsProcessingParameterFeatureSource" );
1106  }
1107 
1108  QStringList acceptedPythonTypes() const override
1109  {
1110  return QStringList() << QObject::tr( "str: layer ID" )
1111  << QObject::tr( "str: layer name" )
1112  << QObject::tr( "str: layer source" )
1113  << QStringLiteral( "QgsProcessingFeatureSourceDefinition" )
1114  << QStringLiteral( "QgsProperty" )
1115  << QStringLiteral( "QgsVectorLayer" );
1116  }
1117 };
1118 
1127 {
1128  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1129  {
1130  return new QgsProcessingParameterNumber( name );
1131  }
1132 
1133  QString description() const override
1134  {
1135  return QCoreApplication::translate( "Processing", "A numeric parameter, including float or integer values." );
1136  }
1137 
1138  QString name() const override
1139  {
1140  return QCoreApplication::translate( "Processing", "Number" );
1141  }
1142 
1143  QString id() const override
1144  {
1145  return QStringLiteral( "number" );
1146  }
1147 
1148  QString pythonImportString() const override
1149  {
1150  return QStringLiteral( "from qgis.core import QgsProcessingParameterNumber" );
1151  }
1152 
1153  QString className() const override
1154  {
1155  return QStringLiteral( "QgsProcessingParameterNumber" );
1156  }
1157 
1158  QStringList acceptedPythonTypes() const override
1159  {
1160  return QStringList() << QStringLiteral( "int" )
1161  << QStringLiteral( "float" )
1162  << QStringLiteral( "QgsProperty" );
1163  }
1164 };
1165 
1174 {
1175  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1176  {
1177  return new QgsProcessingParameterDistance( name );
1178  }
1179 
1180  QString description() const override
1181  {
1182  return QCoreApplication::translate( "Processing", "A numeric parameter representing a distance measure." );
1183  }
1184 
1185  QString name() const override
1186  {
1187  return QCoreApplication::translate( "Processing", "Distance" );
1188  }
1189 
1190  QString id() const override
1191  {
1192  return QStringLiteral( "distance" );
1193  }
1194 
1195  QString pythonImportString() const override
1196  {
1197  return QStringLiteral( "from qgis.core import QgsProcessingParameterDistance" );
1198  }
1199 
1200  QString className() const override
1201  {
1202  return QStringLiteral( "QgsProcessingParameterDistance" );
1203  }
1204 
1205  QStringList acceptedPythonTypes() const override
1206  {
1207  return QStringList() << QStringLiteral( "int" )
1208  << QStringLiteral( "float" )
1209  << QStringLiteral( "QgsProperty" );
1210  }
1211 
1212 };
1213 
1222 {
1223  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1224  {
1225  return new QgsProcessingParameterBand( name );
1226  }
1227 
1228  QString description() const override
1229  {
1230  return QCoreApplication::translate( "Processing", "A raster band parameter, for selecting an existing band from a raster source." );
1231  }
1232 
1233  QString name() const override
1234  {
1235  return QCoreApplication::translate( "Processing", "Raster Band" );
1236  }
1237 
1238  QString id() const override
1239  {
1240  return QStringLiteral( "band" );
1241  }
1242 
1243  QString pythonImportString() const override
1244  {
1245  return QStringLiteral( "from qgis.core import QgsProcessingParameterBand" );
1246  }
1247 
1248  QString className() const override
1249  {
1250  return QStringLiteral( "QgsProcessingParameterBand" );
1251  }
1252 
1253  QStringList acceptedPythonTypes() const override
1254  {
1255  return QStringList() << QStringLiteral( "int" )
1256  << QStringLiteral( "QgsProperty" );
1257  }
1258 
1259 };
1260 
1269 {
1270  QgsProcessingParameterDefinition *create( const QString &name ) const override SIP_FACTORY
1271  {
1272  return new QgsProcessingParameterFeatureSink( name );
1273  }
1274 
1275  ParameterFlags flags() const override
1276  {
1277  ParameterFlags flags = QgsProcessingParameterType::flags();
1278  flags.setFlag( ParameterFlag::ExposeToModeler, false );
1279  return flags;
1280  }
1281 
1282  QString description() const override
1283  {
1284  return QCoreApplication::translate( "Processing", "A feature sink destination parameter." );
1285  }
1286 
1287  QString name() const override
1288  {
1289  return QCoreApplication::translate( "Processing", "Feature Sink" );
1290  }
1291 
1292  QString id() const override
1293  {
1294  return QStringLiteral( "sink" );
1295  }
1296 
1297  QString pythonImportString() const override
1298  {
1299  return QStringLiteral( "from qgis.core import QgsProcessingParameterFeatureSink" );
1300  }
1301 
1302  QString className() const override
1303  {
1304  return QStringLiteral( "QgsProcessingParameterFeatureSink" );
1305  }
1306 
1307  QStringList acceptedPythonTypes() const override
1308  {
1309  return QStringList() << QObject::tr( "str: destination vector file, e.g. 'd:/test.shp'" )
1310  << QObject::tr( "str: 'memory:' to store result in temporary memory layer" )
1311  << QObject::tr( "str: using vector provider ID prefix and destination URI, e.g. 'postgres:…' to store result in PostGIS table" )
1312  << QStringLiteral( "QgsProcessingOutputLayerDefinition" )
1313  << QStringLiteral( "QgsProperty" );
1314  }
1315 
1316 };
1317 
1318 #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 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.
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 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 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 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 configuration ID values.
virtual ParameterFlags flags() const
Determines if this parameter is available in the modeler.
A raster band parameter for Processing algorithms.
A string parameter for processing algorithms.