Skip to content

Commit 1fd7423

Browse files
m-kuhnnyalldawson
authored andcommitted
Add processing parameter type definitions
1 parent 2bc30c7 commit 1fd7423

12 files changed

+962
-16
lines changed

python/core/core_auto.sip

+2
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@
177177
%Include processing/qgsprocessingcontext.sip
178178
%Include processing/qgsprocessingoutputs.sip
179179
%Include processing/qgsprocessingparameters.sip
180+
%Include processing/qgsprocessingparametertype.sip
181+
%Include processing/qgsprocessingparametertypeimpl.sip
180182
%Include processing/qgsprocessingutils.sip
181183
%Include processing/models/qgsprocessingmodelalgorithm.sip
182184
%Include processing/models/qgsprocessingmodelchildalgorithm.sip
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/processing/qgsprocessingparameterregistry.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
class QgsProcessingParameterType
11+
{
12+
%Docstring
13+
Makes metadata of processing parameters available.
14+
15+
.. versionadded:: 3.2
16+
%End
17+
18+
%TypeHeaderCode
19+
#include "qgsprocessingparameterregistry.h"
20+
%End
21+
public:
22+
23+
virtual QgsProcessingParameterDefinition *create( const QString &name ) const = 0 /Factory/;
24+
%Docstring
25+
Creates a new parameter of this type.
26+
%End
27+
28+
virtual QString description() const = 0;
29+
%Docstring
30+
A human readable and translatable description for this parameter type.
31+
This can be a longer description suitable for tooltips and other elements
32+
that give the user context for a given parameter.
33+
%End
34+
35+
virtual QString name() const = 0;
36+
%Docstring
37+
A human readable and translatable short name for this parameter type.
38+
This will be used in comboboxes and list widgets.
39+
%End
40+
41+
virtual QString id() const = 0;
42+
%Docstring
43+
A static id for this type which will be used for storing this parameter type.
44+
%End
45+
};
46+
47+
class QgsProcessingParameterTypeRegistry : QObject
48+
{
49+
50+
%TypeHeaderCode
51+
#include "qgsprocessingparameterregistry.h"
52+
%End
53+
public:
54+
explicit QgsProcessingParameterTypeRegistry( QObject *parent = 0 );
55+
56+
void registerParameter( QgsProcessingParameterType *type /Transfer/ );
57+
58+
void unregisterParameter( QgsProcessingParameterType *type );
59+
60+
QgsProcessingParameterType *parameterType( const QString &id ) const;
61+
62+
QList<QgsProcessingParameterType *> parameterTypes() const;
63+
64+
signals:
65+
void parameterRegistered( QgsProcessingParameterType *type );
66+
67+
void parameterUnregistered( QgsProcessingParameterType *type );
68+
69+
};
70+
71+
/************************************************************************
72+
* This file has been generated automatically from *
73+
* *
74+
* src/core/processing/qgsprocessingparameterregistry.h *
75+
* *
76+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
77+
************************************************************************/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/processing/qgsprocessingparametertype.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
class QgsProcessingParameterType
11+
{
12+
%Docstring
13+
Makes metadata of processing parameters available.
14+
15+
.. versionadded:: 3.2
16+
%End
17+
18+
%TypeHeaderCode
19+
#include "qgsprocessingparametertype.h"
20+
%End
21+
public:
22+
23+
virtual QgsProcessingParameterDefinition *create( const QString &name ) const = 0 /Factory/;
24+
%Docstring
25+
Creates a new parameter of this type.
26+
%End
27+
28+
virtual ~QgsProcessingParameterType();
29+
30+
virtual QString description() const = 0;
31+
%Docstring
32+
A human readable and translatable description for this parameter type.
33+
This can be a longer description suitable for tooltips and other elements
34+
that give the user context for a given parameter.
35+
%End
36+
37+
virtual QString name() const = 0;
38+
%Docstring
39+
A human readable and translatable short name for this parameter type.
40+
This will be used in comboboxes and list widgets.
41+
%End
42+
43+
virtual QString id() const = 0;
44+
%Docstring
45+
A static id for this type which will be used for storing this parameter type.
46+
%End
47+
};
48+
49+
/************************************************************************
50+
* This file has been generated automatically from *
51+
* *
52+
* src/core/processing/qgsprocessingparametertype.h *
53+
* *
54+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
55+
************************************************************************/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/core/processing/qgsprocessingparametertypeimpl.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
class QgsProcessingParameterTypeRasterLayer : QgsProcessingParameterType
12+
{
13+
14+
%TypeHeaderCode
15+
#include "qgsprocessingparametertypeimpl.h"
16+
%End
17+
};
18+
19+
class QgsProcessingParameterTypeVectorLayer : QgsProcessingParameterType
20+
{
21+
22+
%TypeHeaderCode
23+
#include "qgsprocessingparametertypeimpl.h"
24+
%End
25+
};
26+
27+
class QgsProcessingParameterTypeBoolean : QgsProcessingParameterType
28+
{
29+
30+
%TypeHeaderCode
31+
#include "qgsprocessingparametertypeimpl.h"
32+
%End
33+
};
34+
35+
class QgsProcessingParameterTypeCrs : QgsProcessingParameterType
36+
{
37+
38+
%TypeHeaderCode
39+
#include "qgsprocessingparametertypeimpl.h"
40+
%End
41+
};
42+
43+
class QgsProcessingParameterTypeRange : QgsProcessingParameterType
44+
{
45+
46+
%TypeHeaderCode
47+
#include "qgsprocessingparametertypeimpl.h"
48+
%End
49+
};
50+
51+
class QgsProcessingParameterTypePoint : QgsProcessingParameterType
52+
{
53+
54+
%TypeHeaderCode
55+
#include "qgsprocessingparametertypeimpl.h"
56+
%End
57+
};
58+
59+
class QgsProcessingParameterTypeEnum : QgsProcessingParameterType
60+
{
61+
62+
%TypeHeaderCode
63+
#include "qgsprocessingparametertypeimpl.h"
64+
%End
65+
};
66+
67+
class QgsProcessingParameterTypeExtent : QgsProcessingParameterType
68+
{
69+
70+
%TypeHeaderCode
71+
#include "qgsprocessingparametertypeimpl.h"
72+
%End
73+
};
74+
75+
class QgsProcessingParameterTypeMatrix : QgsProcessingParameterType
76+
{
77+
78+
%TypeHeaderCode
79+
#include "qgsprocessingparametertypeimpl.h"
80+
%End
81+
};
82+
83+
class QgsProcessingParameterTypeFile : QgsProcessingParameterType
84+
{
85+
86+
%TypeHeaderCode
87+
#include "qgsprocessingparametertypeimpl.h"
88+
%End
89+
};
90+
91+
class QgsProcessingParameterTypeField : QgsProcessingParameterType
92+
{
93+
94+
%TypeHeaderCode
95+
#include "qgsprocessingparametertypeimpl.h"
96+
%End
97+
};
98+
99+
class QgsProcessingParameterTypeVectorDestination : QgsProcessingParameterType
100+
{
101+
102+
%TypeHeaderCode
103+
#include "qgsprocessingparametertypeimpl.h"
104+
%End
105+
};
106+
107+
class QgsProcessingParameterTypeFileDestination : QgsProcessingParameterType
108+
{
109+
110+
%TypeHeaderCode
111+
#include "qgsprocessingparametertypeimpl.h"
112+
%End
113+
};
114+
115+
class QgsProcessingParameterTypeFolderDestination : QgsProcessingParameterType
116+
{
117+
118+
%TypeHeaderCode
119+
#include "qgsprocessingparametertypeimpl.h"
120+
%End
121+
};
122+
123+
class QgsProcessingParameterTypeRasterDestination : QgsProcessingParameterType
124+
{
125+
126+
%TypeHeaderCode
127+
#include "qgsprocessingparametertypeimpl.h"
128+
%End
129+
};
130+
131+
class QgsProcessingParameterTypeString : QgsProcessingParameterType
132+
{
133+
134+
%TypeHeaderCode
135+
#include "qgsprocessingparametertypeimpl.h"
136+
%End
137+
};
138+
139+
class QgsProcessingParameterTypeMultipleLayers : QgsProcessingParameterType
140+
{
141+
142+
%TypeHeaderCode
143+
#include "qgsprocessingparametertypeimpl.h"
144+
%End
145+
};
146+
147+
class QgsProcessingParameterTypeFeatureSource : QgsProcessingParameterType
148+
{
149+
150+
%TypeHeaderCode
151+
#include "qgsprocessingparametertypeimpl.h"
152+
%End
153+
};
154+
155+
class QgsProcessingParameterTypeNumber : QgsProcessingParameterType
156+
{
157+
158+
%TypeHeaderCode
159+
#include "qgsprocessingparametertypeimpl.h"
160+
%End
161+
};
162+
163+
164+
/************************************************************************
165+
* This file has been generated automatically from *
166+
* *
167+
* src/core/processing/qgsprocessingparametertypeimpl.h *
168+
* *
169+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
170+
************************************************************************/

python/core/processing/qgsprocessingregistry.sip.in

+51
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010

1111

12+
1213
class QgsProcessingRegistry : QObject
1314
{
1415
%Docstring
@@ -106,6 +107,41 @@ according to some user configuration.
106107
.. seealso:: :py:func:`algorithmById`
107108
%End
108109

110+
void addParameterType( QgsProcessingParameterType *type );
111+
%Docstring
112+
Register a new parameter type for processing.
113+
Will emit parameterTypeAdded
114+
115+
.. seealso:: :py:func:`removeParameterType`
116+
117+
.. versionadded:: 3.2
118+
%End
119+
120+
void removeParameterType( QgsProcessingParameterType *type );
121+
%Docstring
122+
Unregister a custom parameter type from processing.
123+
Will emit parameterTypeRemoved
124+
125+
.. seealso:: :py:func:`addParameterType`
126+
127+
.. versionadded:: 3.2
128+
%End
129+
130+
QgsProcessingParameterType *parameterType( const QString &id ) const;
131+
%Docstring
132+
Return the parameter type registered for ``id``.
133+
134+
.. versionadded:: 3.2
135+
%End
136+
137+
QList<QgsProcessingParameterType *> parameterTypes() const;
138+
%Docstring
139+
Return a list with all known parameter types.
140+
141+
.. versionadded:: 3.2
142+
%End
143+
144+
109145
signals:
110146

111147
void providerAdded( const QString &id );
@@ -116,6 +152,21 @@ Emitted when a provider has been added to the registry.
116152
void providerRemoved( const QString &id );
117153
%Docstring
118154
Emitted when a provider is removed from the registry
155+
%End
156+
157+
void parameterTypeAdded( QgsProcessingParameterType *type );
158+
%Docstring
159+
Emitted when a new parameter type has been added to the registry.
160+
161+
.. versionadded:: 3.2
162+
%End
163+
164+
void parameterTypeRemoved( QgsProcessingParameterType *type );
165+
%Docstring
166+
Emitted when a parameter type has been removed from the
167+
registry and is about to be deleted.
168+
169+
.. versionadded:: 3.2
119170
%End
120171

121172
private:

0 commit comments

Comments
 (0)