Navigation Menu

Skip to content

Commit

Permalink
Add processing parameter type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn authored and nyalldawson committed Mar 6, 2018
1 parent 2bc30c7 commit 1fd7423
Show file tree
Hide file tree
Showing 12 changed files with 962 additions and 16 deletions.
2 changes: 2 additions & 0 deletions python/core/core_auto.sip
Expand Up @@ -177,6 +177,8 @@
%Include processing/qgsprocessingcontext.sip
%Include processing/qgsprocessingoutputs.sip
%Include processing/qgsprocessingparameters.sip
%Include processing/qgsprocessingparametertype.sip
%Include processing/qgsprocessingparametertypeimpl.sip
%Include processing/qgsprocessingutils.sip
%Include processing/models/qgsprocessingmodelalgorithm.sip
%Include processing/models/qgsprocessingmodelchildalgorithm.sip
Expand Down
77 changes: 77 additions & 0 deletions python/core/processing/qgsprocessingparameterregistry.sip.in
@@ -0,0 +1,77 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/processing/qgsprocessingparameterregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/


class QgsProcessingParameterType
{
%Docstring
Makes metadata of processing parameters available.

.. versionadded:: 3.2
%End

%TypeHeaderCode
#include "qgsprocessingparameterregistry.h"
%End
public:

virtual QgsProcessingParameterDefinition *create( const QString &name ) const = 0 /Factory/;
%Docstring
Creates a new parameter of this type.
%End

virtual QString description() const = 0;
%Docstring
A human readable and translatable description for this parameter type.
This can be a longer description suitable for tooltips and other elements
that give the user context for a given parameter.
%End

virtual QString name() const = 0;
%Docstring
A human readable and translatable short name for this parameter type.
This will be used in comboboxes and list widgets.
%End

virtual QString id() const = 0;
%Docstring
A static id for this type which will be used for storing this parameter type.
%End
};

class QgsProcessingParameterTypeRegistry : QObject
{

%TypeHeaderCode
#include "qgsprocessingparameterregistry.h"
%End
public:
explicit QgsProcessingParameterTypeRegistry( QObject *parent = 0 );

void registerParameter( QgsProcessingParameterType *type /Transfer/ );

void unregisterParameter( QgsProcessingParameterType *type );

QgsProcessingParameterType *parameterType( const QString &id ) const;

QList<QgsProcessingParameterType *> parameterTypes() const;

signals:
void parameterRegistered( QgsProcessingParameterType *type );

void parameterUnregistered( QgsProcessingParameterType *type );

};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/processing/qgsprocessingparameterregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
55 changes: 55 additions & 0 deletions python/core/processing/qgsprocessingparametertype.sip.in
@@ -0,0 +1,55 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/processing/qgsprocessingparametertype.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/


class QgsProcessingParameterType
{
%Docstring
Makes metadata of processing parameters available.

.. versionadded:: 3.2
%End

%TypeHeaderCode
#include "qgsprocessingparametertype.h"
%End
public:

virtual QgsProcessingParameterDefinition *create( const QString &name ) const = 0 /Factory/;
%Docstring
Creates a new parameter of this type.
%End

virtual ~QgsProcessingParameterType();

virtual QString description() const = 0;
%Docstring
A human readable and translatable description for this parameter type.
This can be a longer description suitable for tooltips and other elements
that give the user context for a given parameter.
%End

virtual QString name() const = 0;
%Docstring
A human readable and translatable short name for this parameter type.
This will be used in comboboxes and list widgets.
%End

virtual QString id() const = 0;
%Docstring
A static id for this type which will be used for storing this parameter type.
%End
};

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/processing/qgsprocessingparametertype.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
170 changes: 170 additions & 0 deletions python/core/processing/qgsprocessingparametertypeimpl.sip.in
@@ -0,0 +1,170 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/processing/qgsprocessingparametertypeimpl.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/



class QgsProcessingParameterTypeRasterLayer : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeVectorLayer : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeBoolean : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeCrs : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeRange : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypePoint : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeEnum : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeExtent : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeMatrix : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeFile : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeField : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeVectorDestination : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeFileDestination : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeFolderDestination : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeRasterDestination : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeString : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeMultipleLayers : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeFeatureSource : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};

class QgsProcessingParameterTypeNumber : QgsProcessingParameterType
{

%TypeHeaderCode
#include "qgsprocessingparametertypeimpl.h"
%End
};


/************************************************************************
* This file has been generated automatically from *
* *
* src/core/processing/qgsprocessingparametertypeimpl.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
51 changes: 51 additions & 0 deletions python/core/processing/qgsprocessingregistry.sip.in
Expand Up @@ -9,6 +9,7 @@




class QgsProcessingRegistry : QObject
{
%Docstring
Expand Down Expand Up @@ -106,6 +107,41 @@ according to some user configuration.
.. seealso:: :py:func:`algorithmById`
%End

void addParameterType( QgsProcessingParameterType *type );
%Docstring
Register a new parameter type for processing.
Will emit parameterTypeAdded

.. seealso:: :py:func:`removeParameterType`

.. versionadded:: 3.2
%End

void removeParameterType( QgsProcessingParameterType *type );
%Docstring
Unregister a custom parameter type from processing.
Will emit parameterTypeRemoved

.. seealso:: :py:func:`addParameterType`

.. versionadded:: 3.2
%End

QgsProcessingParameterType *parameterType( const QString &id ) const;
%Docstring
Return the parameter type registered for ``id``.

.. versionadded:: 3.2
%End

QList<QgsProcessingParameterType *> parameterTypes() const;
%Docstring
Return a list with all known parameter types.

.. versionadded:: 3.2
%End


signals:

void providerAdded( const QString &id );
Expand All @@ -116,6 +152,21 @@ Emitted when a provider has been added to the registry.
void providerRemoved( const QString &id );
%Docstring
Emitted when a provider is removed from the registry
%End

void parameterTypeAdded( QgsProcessingParameterType *type );
%Docstring
Emitted when a new parameter type has been added to the registry.

.. versionadded:: 3.2
%End

void parameterTypeRemoved( QgsProcessingParameterType *type );
%Docstring
Emitted when a parameter type has been removed from the
registry and is about to be deleted.

.. versionadded:: 3.2
%End

private:
Expand Down

0 comments on commit 1fd7423

Please sign in to comment.