QGIS/python/core/auto_generated/processing/qgsprocessingprovider.sip.in

284 lines
9.2 KiB
Plaintext
Raw Normal View History

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/processing/qgsprocessingprovider.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsProcessingProvider : QObject
{
%Docstring
2017-12-15 10:36:55 -04:00
Abstract base class for processing providers. An algorithm provider is a set of
related algorithms, typically from the same external application or related
to a common area of analysis.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgsprocessingprovider.h"
%End
public:
QgsProcessingProvider( QObject *parent /TransferThis/ = 0 );
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsProcessingProvider.
%End
~QgsProcessingProvider();
virtual QIcon icon() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns an icon for the provider.
.. seealso:: :py:func:`svgIconPath`
%End
virtual QString svgIconPath() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a path to an SVG version of the provider's icon.
.. seealso:: :py:func:`icon`
%End
virtual QString id() const = 0;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the unique provider id, used for identifying the provider. This string
should be a unique, short, character only string, eg "qgis" or "gdal". This
string should not be localised.
.. seealso:: :py:func:`name`
.. seealso:: :py:func:`helpId`
%End
virtual QString helpId() const;
%Docstring
Returns the provider help id string, used for creating QgsHelp urls for algorithms
2018-10-13 03:39:40 +02:00
belong to this provider. By default, this returns an empty string, meaning that
no QgsHelp url should be created for the provider's algorithms.
.. seealso:: :py:func:`id`
%End
virtual QString name() const = 0;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the provider name, which is used to describe the provider within the GUI.
This string should be short (e.g. "Lastools") and localised.
.. seealso:: :py:func:`longName`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`id`
%End
virtual QString longName() const;
%Docstring
2018-10-13 03:39:40 +02:00
Returns the longer version of the provider name, which can include extra details
2017-12-15 10:36:55 -04:00
such as version numbers. E.g. "Lastools LIDAR tools (version 2.2.1)".
This string should be localised.
2017-12-15 10:36:55 -04:00
The default implementation returns the same string as name().
.. seealso:: :py:func:`name`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`id`
%End
virtual QString versionInfo() const;
%Docstring
Returns a version information string for the provider, or an empty string if this
is not applicable (e.g. for inbuilt Processing providers).
For plugin based providers, this should return the plugin's version identifier.
.. versionadded:: 3.8
%End
virtual bool canBeActivated() const;
%Docstring
2019-02-26 19:54:09 +10:00
Returns ``True`` if the provider can be activated, or ``False`` if it cannot be activated (e.g. due to
2017-12-15 10:36:55 -04:00
missing external dependencies).
.. seealso:: :py:func:`isActive`
%End
virtual bool isActive() const;
%Docstring
2019-02-26 19:54:09 +10:00
Returns ``True`` if the provider is active and able to run algorithms.
%End
virtual QStringList supportedOutputRasterLayerExtensions() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of the raster format file extensions supported by this provider.
.. seealso:: :py:func:`supportedOutputVectorLayerExtensions`
%End
virtual QStringList supportedOutputVectorLayerExtensions() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of the vector format file extensions supported by this provider.
.. seealso:: :py:func:`supportedOutputTableExtensions`
.. seealso:: :py:func:`defaultVectorFileExtension`
.. seealso:: :py:func:`supportedOutputRasterLayerExtensions`
.. seealso:: :py:func:`supportsNonFileBasedOutput`
%End
virtual QStringList supportedOutputTableExtensions() const;
%Docstring
Returns a list of the table (geometry-less vector layers) file extensions supported by this provider.
By default this is the same as supportedOutputVectorLayerExtensions(). Providers which utilize different
formats for geometry-less layers can override this method to return a different list of supported formats.
.. seealso:: :py:func:`supportedOutputVectorLayerExtensions`
.. seealso:: :py:func:`defaultVectorFileExtension`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`supportedOutputRasterLayerExtensions`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`supportsNonFileBasedOutput`
.. versionadded:: 3.4.3
%End
virtual bool isSupportedOutputValue( const QVariant &outputValue, const QgsProcessingDestinationParameter *parameter, QgsProcessingContext &context, QString &error /Out/ ) const;
%Docstring
2019-02-26 19:54:09 +10:00
Returns ``True`` if the specified ``outputValue`` is of a supported file format for the given destination ``parameter``.
If the output value is not supported, ``error`` will be set to a descriptive message explaining why.
.. versionadded:: 3.6
%End
virtual QString defaultVectorFileExtension( bool hasGeometry = true ) const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the default file extension to use for vector outputs created by the
provider.
2019-02-26 19:54:09 +10:00
If ``hasGeometry`` is ``True`` then the output file format must have support for
geometry. If ``hasGeometry`` is ``False`` then non-spatial formats can be used.
2017-12-15 10:36:55 -04:00
The default implementation returns the user's default Processing vector output format
setting, if it's supported by the provider (see supportedOutputVectorLayerExtensions()).
Otherwise the first reported supported vector format will be used.
.. seealso:: :py:func:`supportedOutputVectorLayerExtensions`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`defaultRasterFileExtension`
%End
virtual QString defaultRasterFileExtension() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the default file extension to use for raster outputs created by the
provider.
The default implementation returns the user's default Processing raster output format
setting, if it's supported by the provider (see supportedOutputRasterLayerExtensions()).
Otherwise the first reported supported raster format will be used.
.. seealso:: :py:func:`supportedOutputRasterLayerExtensions`
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`defaultVectorFileExtension`
%End
virtual bool supportsNonFileBasedOutput() const;
%Docstring
2019-02-26 19:54:09 +10:00
Returns ``True`` if the provider supports non-file based outputs (such as memory layers
or direct database outputs). If a provider returns ``False`` for this method than it
indicates that none of the outputs from any of the provider's algorithms have
2019-02-26 19:54:09 +10:00
support for non-file based outputs. Returning ``True`` indicates that the algorithm's
parameters will each individually declare their non-file based support.
2017-12-15 10:36:55 -04:00
The default behavior for providers is to support non-file based outputs, and most
providers which rely solely on QGIS API (and which do not depend on third-party scripts
or external dependencies) will automatically support this.
.. seealso:: :py:func:`supportedOutputVectorLayerExtensions`
%End
virtual bool load();
%Docstring
2017-12-15 10:36:55 -04:00
Loads the provider. This will be called when the plugin is being loaded, and any general
setup actions should occur in an overridden version of this method.
Subclasses should not individually load any algorithms in their load() implementations, as that must
occur within the loadAlgorithms() method. Instead, subclasses should call refreshAlgorithms()
from any overloaded load() method to trigger an initial load of the provider's algorithms.
2019-02-26 19:54:09 +10:00
:return: ``True`` if provider could be successfully loaded
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`unload`
%End
virtual void unload();
%Docstring
2017-12-15 10:36:55 -04:00
Unloads the provider. Any tear-down steps required by the provider should be implemented here.
.. seealso:: :py:func:`load`
%End
void refreshAlgorithms();
%Docstring
2017-12-15 10:36:55 -04:00
Refreshes the algorithms available from the provider, causing it to re-populate with all associated algorithms.
%End
QList< const QgsProcessingAlgorithm * > algorithms() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns a list of algorithms supplied by this provider.
.. seealso:: :py:func:`algorithm`
%End
const QgsProcessingAlgorithm *algorithm( const QString &name ) const;
%Docstring
Returns the matching algorithm by ``name``, or ``None`` if no matching
2017-12-15 10:36:55 -04:00
algorithm is contained by this provider.
.. seealso:: :py:func:`algorithms`
%End
signals:
void algorithmsLoaded();
%Docstring
2017-12-15 10:36:55 -04:00
Emitted when the provider has loaded (or refreshed) its list of available
algorithms.
.. seealso:: :py:func:`refreshAlgorithms`
%End
protected:
virtual void loadAlgorithms() = 0;
%Docstring
2017-12-15 10:36:55 -04:00
Loads all algorithms belonging to this provider. Subclasses should implement this, calling
addAlgorithm() to register all their associated algorithms.
%End
bool addAlgorithm( QgsProcessingAlgorithm *algorithm /Transfer/ );
%Docstring
2017-12-15 10:36:55 -04:00
Adds an ``algorithm`` to the provider. Ownership of the algorithm is transferred to the provider.
%End
private:
QgsProcessingProvider( const QgsProcessingProvider &other );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/processing/qgsprocessingprovider.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/