Skip to content
Permalink
Browse files

Sipify

  • Loading branch information
nyalldawson committed Jun 21, 2017
1 parent 86f33c6 commit 312c81078736d0dc5e34542c59905012c4a3813a
Showing with 85 additions and 18 deletions.
  1. +85 −18 python/core/processing/qgsprocessingparameters.sip
@@ -11,7 +11,6 @@




class QgsProcessingFeatureSourceDefinition
{
%Docstring
@@ -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.
@@ -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
@@ -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


};

@@ -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.
@@ -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.
@@ -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
@@ -1501,7 +1565,7 @@ class QgsProcessingParameterFileOutput : QgsProcessingParameterDefinition

};

class QgsProcessingParameterFolderOutput : QgsProcessingParameterDefinition
class QgsProcessingParameterFolderOutput : QgsProcessingDestinationParameter
{
%Docstring
A folder output parameter.
@@ -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;


};

0 comments on commit 312c810

Please sign in to comment.
You can’t perform that action at this time.