Skip to content

Commit

Permalink
Sipify
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 21, 2017
1 parent 86f33c6 commit 312c810
Showing 1 changed file with 85 additions and 18 deletions.
103 changes: 85 additions & 18 deletions python/core/processing/qgsprocessingparameters.sip
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@




class QgsProcessingFeatureSourceDefinition
{
%Docstring
Expand Down Expand Up @@ -1308,8 +1307,72 @@ class QgsProcessingParameterFeatureSource : QgsProcessingParameterDefinition

};

class QgsProcessingDestinationParameter : QgsProcessingParameterDefinition
{
%Docstring
Base class for all parameter definitions which represent file or layer destinations, e.g. parameters
which are used for the destination for layers output by an algorithm.
.. versionadded:: 3.0
%End

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

QgsProcessingDestinationParameter( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(),
bool optional = false );
%Docstring
Constructor for QgsProcessingDestinationParameter.
%End

virtual bool isDestination() const;
virtual QVariantMap toVariantMap() const;

virtual bool fromVariantMap( const QVariantMap &map );


virtual QgsProcessingOutputDefinition *toOutputDefinition() const = 0 /Factory/;
%Docstring
Returns a new QgsProcessingOutputDefinition corresponding to the definition of the destination
parameter.
:rtype: QgsProcessingOutputDefinition
%End

bool supportsNonFileBasedOutputs() const;
%Docstring
Returns true if the destination parameter supports non filed-based outputs,
such as memory layers or direct database outputs.
.. seealso:: setSupportsNonFileBasedOutputs()
:rtype: bool
%End

void setSupportsNonFileBasedOutputs( bool supportsNonFileBasedOutputs );
%Docstring
Sets whether the destination parameter supports non filed-based outputs,
such as memory layers or direct database outputs.
.. seealso:: supportsNonFileBasedOutputs()
%End

virtual QString defaultFileExtension() const = 0;
%Docstring
Returns the default file extension for destination file paths
associated with this parameter.
:rtype: str
%End

class QgsProcessingParameterFeatureSink : QgsProcessingParameterDefinition
virtual QString generateTemporaryDestination() const;
%Docstring
Generates a temporary destination value for this parameter. The returned
value will be a file path or QGIS data provider URI suitable for
temporary storage of created layers and files.
:rtype: str
%End

};


class QgsProcessingParameterFeatureSink : QgsProcessingDestinationParameter
{
%Docstring
A feature sink output for processing algorithms.
Expand All @@ -1330,11 +1393,14 @@ class QgsProcessingParameterFeatureSink : QgsProcessingParameterDefinition
%End

virtual QString type() const;
virtual bool isDestination() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;

virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;

virtual QgsProcessingOutputDefinition *toOutputDefinition() const /Factory/;

virtual QString defaultFileExtension() const;


QgsProcessingParameterDefinition::LayerType dataType() const;
%Docstring
Expand All @@ -1360,14 +1426,8 @@ class QgsProcessingParameterFeatureSink : QgsProcessingParameterDefinition

virtual bool fromVariantMap( const QVariantMap &map );


virtual QString generateTemporaryDestination() const;
%Docstring
Generates a temporary destination value for this parameter. The returned
value will be a file path or QGIS data provider URI suitable for
temporary storage of created layers and files.
:rtype: str
%End


};

Expand Down Expand Up @@ -1422,12 +1482,10 @@ class QgsProcessingParameterVectorOutput : QgsProcessingParameterDefinition

virtual bool fromVariantMap( const QVariantMap &map );

virtual QString generateTemporaryDestination() const;


};

class QgsProcessingParameterRasterOutput : QgsProcessingParameterDefinition
class QgsProcessingParameterRasterOutput : QgsProcessingDestinationParameter
{
%Docstring
A raster layer output parameter.
Expand All @@ -1447,14 +1505,17 @@ class QgsProcessingParameterRasterOutput : QgsProcessingParameterDefinition
%End

virtual QString type() const;
virtual bool isDestination() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;

virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;

virtual QgsProcessingOutputDefinition *toOutputDefinition() const /Factory/;

virtual QString defaultFileExtension() const;

};

class QgsProcessingParameterFileOutput : QgsProcessingParameterDefinition
class QgsProcessingParameterFileOutput : QgsProcessingDestinationParameter
{
%Docstring
A generic file based output parameter.
Expand All @@ -1475,11 +1536,14 @@ class QgsProcessingParameterFileOutput : QgsProcessingParameterDefinition
%End

virtual QString type() const;
virtual bool isDestination() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;

virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const;

virtual QgsProcessingOutputDefinition *toOutputDefinition() const /Factory/;

virtual QString defaultFileExtension() const;


QString fileFilter() const;
%Docstring
Expand All @@ -1501,7 +1565,7 @@ class QgsProcessingParameterFileOutput : QgsProcessingParameterDefinition

};

class QgsProcessingParameterFolderOutput : QgsProcessingParameterDefinition
class QgsProcessingParameterFolderOutput : QgsProcessingDestinationParameter
{
%Docstring
A folder output parameter.
Expand All @@ -1521,9 +1585,12 @@ class QgsProcessingParameterFolderOutput : QgsProcessingParameterDefinition
%End

virtual QString type() const;
virtual bool isDestination() const;
virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const;

virtual QgsProcessingOutputDefinition *toOutputDefinition() const /Factory/;

virtual QString defaultFileExtension() const;


};

Expand Down

0 comments on commit 312c810

Please sign in to comment.