QGIS/python/core/auto_generated/processing/qgsprocessingprovider.sip.in
Nyall Dawson 3f6b490218 Sipify
2025-04-02 11:11:10 +10:00

427 lines
13 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/processing/qgsprocessingprovider.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsProcessingProvider : QObject
{
%Docstring(signature="appended")
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.
%End
%TypeHeaderCode
#include "qgsprocessingprovider.h"
%End
public:
QgsProcessingProvider( QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsProcessingProvider.
%End
~QgsProcessingProvider();
virtual QIcon icon() const /HoldGIL/;
%Docstring
Returns an icon for the provider.
.. seealso:: :py:func:`svgIconPath`
%End
virtual QString svgIconPath() const /HoldGIL/;
%Docstring
Returns a path to an SVG version of the provider's icon.
.. seealso:: :py:func:`icon`
%End
virtual Qgis::ProcessingProviderFlags flags() const /HoldGIL/;
%Docstring
Returns the flags indicating how and when the provider operates and
should be exposed to users. Default is no flags.
.. versionadded:: 3.14
%End
virtual QString id() const = 0 /HoldGIL/;
%Docstring
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 /HoldGIL/;
%Docstring
Returns the provider help id string, used for creating
:py:class:`QgsHelp` urls for algorithms belong to this provider. By
default, this returns an empty string, meaning that no
:py:class:`QgsHelp` url should be created for the provider's algorithms.
.. seealso:: :py:func:`id`
%End
virtual QString name() const = 0 /HoldGIL/;
%Docstring
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`
.. seealso:: :py:func:`id`
%End
virtual QString longName() const /HoldGIL/;
%Docstring
Returns the longer version of the provider name, which can include extra
details such as version numbers. E.g. "Lastools LIDAR tools (version
2.2.1)". This string should be localised.
The default implementation returns the same string as
:py:func:`~QgsProcessingProvider.name`.
.. seealso:: :py:func:`name`
.. seealso:: :py:func:`id`
%End
virtual QString versionInfo() const /HoldGIL/;
%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
Returns ``True`` if the provider can be activated, or ``False`` if it
cannot be activated (e.g. due to missing external dependencies).
.. seealso:: :py:func:`isActive`
%End
virtual QString warningMessage() const;
%Docstring
Returns an optional warning message to show users when running
algorithms from this provider.
This can be used to return a translated warning message which should be
shown to users of this provider. It's intended for use in cases such as
a provider which relies on a 3rd-party backend, where the version of the
backend software is not officially supported, or for alerting users to
providers in a "beta" or "untrustworthy" state.
.. versionadded:: 3.10.1
%End
virtual bool isActive() const;
%Docstring
Returns ``True`` if the provider is active and able to run algorithms.
%End
virtual QStringList supportedOutputRasterLayerExtensions() const;
%Docstring
Returns a list of the raster format file extensions supported by this
provider.
.. seealso:: :py:func:`supportedOutputVectorLayerExtensions`
.. seealso:: :py:func:`supportedOutputPointCloudLayerExtensions`
.. seealso:: :py:func:`supportedOutputVectorTileLayerExtensions`
%End
virtual QStringList supportedOutputVectorLayerExtensions() const;
%Docstring
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`
.. seealso:: :py:func:`supportedOutputPointCloudLayerExtensions`
.. seealso:: :py:func:`supportedOutputVectorTileLayerExtensions`
%End
virtual QStringList supportedOutputPointCloudLayerExtensions() const;
%Docstring
Returns a list of the point cloud format file extensions supported by
this provider.
.. seealso:: :py:func:`supportedOutputVectorLayerExtensions`
.. seealso:: :py:func:`supportedOutputRasterLayerExtensions`
.. seealso:: :py:func:`supportedOutputVectorTileLayerExtensions`
.. seealso:: :py:func:`supportedOutputTableExtensions`
.. seealso:: :py:func:`defaultVectorFileExtension`
.. seealso:: :py:func:`supportsNonFileBasedOutput`
.. versionadded:: 3.24
%End
virtual QStringList supportedOutputVectorTileLayerExtensions() const;
%Docstring
Returns a list of the vector tile format file extensions supported by
this provider.
By default returns a list containing only "mbtiles" extension.
.. seealso:: :py:func:`supportedOutputVectorLayerExtensions`
.. seealso:: :py:func:`supportedOutputRasterLayerExtensions`
.. seealso:: :py:func:`supportedOutputTableExtensions`
.. seealso:: :py:func:`defaultVectorFileExtension`
.. seealso:: :py:func:`supportsNonFileBasedOutput`
.. versionadded:: 3.32
%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
:py:func:`~QgsProcessingProvider.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`
.. seealso:: :py:func:`supportedOutputRasterLayerExtensions`
.. seealso:: :py:func:`supportsNonFileBasedOutput`
.. seealso:: :py:func:`supportedOutputPointCloudLayerExtensions`
.. versionadded:: 3.4.3
%End
virtual bool isSupportedOutputValue( const QVariant &outputValue, const QgsProcessingDestinationParameter *parameter, QgsProcessingContext &context, QString &error /Out/ ) const;
%Docstring
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
Returns the default file extension to use for vector outputs created by
the provider.
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.
The default implementation returns the user's default Processing vector
output format setting, if it's supported by the provider (see
:py:func:`~QgsProcessingProvider.supportedOutputVectorLayerExtensions`).
Otherwise the first reported supported vector format will be used.
.. seealso:: :py:func:`supportedOutputVectorLayerExtensions`
.. seealso:: :py:func:`defaultRasterFileExtension`
.. seealso:: :py:func:`defaultPointCloudFileExtension`
.. seealso:: :py:func:`defaultVectorTileFileExtension`
%End
virtual QString defaultRasterFileExtension() const;
%Docstring
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
:py:func:`~QgsProcessingProvider.supportedOutputRasterLayerExtensions`).
Otherwise the first reported supported raster format will be used.
.. seealso:: :py:func:`supportedOutputRasterLayerExtensions`
.. seealso:: :py:func:`defaultVectorFileExtension`
.. seealso:: :py:func:`defaultPointCloudFileExtension`
.. seealso:: :py:func:`defaultVectorTileFileExtension`
%End
virtual QString defaultPointCloudFileExtension() const;
%Docstring
Returns the default file extension to use for point cloud outputs
created by the provider.
The default implementation returns the user's default Processing point
cloud output format setting, if it's supported by the provider (see
:py:func:`~QgsProcessingProvider.supportedOutputPointCloudLayerExtensions`).
Otherwise the first reported supported point cloud format will be used.
.. seealso:: :py:func:`supportedOutputPointCloudLayerExtensions`
.. seealso:: :py:func:`defaultVectorFileExtension`
.. seealso:: :py:func:`defaultRasterFileExtension`
.. seealso:: :py:func:`defaultVectorTileFileExtension`
.. versionadded:: 3.24
%End
virtual QString defaultVectorTileFileExtension() const;
%Docstring
Returns the default file extension to use for vector tile outputs
created by the provider.
The default implementation returns the user's default Processing vector
tile output format setting, if it's supported by the provider (see
:py:func:`~QgsProcessingProvider.supportedOutputVectorTileLayerExtensions`).
Otherwise the first reported supported vector tile format will be used.
.. seealso:: :py:func:`supportedOutputPointCloudLayerExtensions`
.. seealso:: :py:func:`defaultVectorFileExtension`
.. seealso:: :py:func:`defaultRasterFileExtension`
.. versionadded:: 3.32
%End
virtual bool supportsNonFileBasedOutput() const;
%Docstring
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 support for non-file based
outputs. Returning ``True`` indicates that the algorithm's parameters
will each individually declare their non-file based support.
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
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 :py:func:`~QgsProcessingProvider.load` implementations, as that
must occur within the :py:func:`~QgsProcessingProvider.loadAlgorithms`
method. Instead, subclasses should call
:py:func:`~QgsProcessingProvider.refreshAlgorithms` from any overloaded
:py:func:`~QgsProcessingProvider.load` method to trigger an initial load
of the provider's algorithms.
:return: ``True`` if provider could be successfully loaded
.. seealso:: :py:func:`unload`
%End
virtual void unload();
%Docstring
Unloads the provider. Any tear-down steps required by the provider
should be implemented here.
.. seealso:: :py:func:`load`
%End
void refreshAlgorithms();
%Docstring
Refreshes the algorithms available from the provider, causing it to
re-populate with all associated algorithms.
%End
QList< const QgsProcessingAlgorithm * > algorithms() const;
%Docstring
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
algorithm is contained by this provider.
.. seealso:: :py:func:`algorithms`
%End
signals:
void algorithmsLoaded();
%Docstring
Emitted when the provider has loaded (or refreshed) its list of
available algorithms.
.. seealso:: :py:func:`refreshAlgorithms`
%End
protected:
virtual void loadAlgorithms() = 0;
%Docstring
Loads all algorithms belonging to this provider. Subclasses should
implement this, calling :py:func:`~QgsProcessingProvider.addAlgorithm`
to register all their associated algorithms.
%End
bool addAlgorithm( QgsProcessingAlgorithm *algorithm /Transfer/ );
%Docstring
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.py again *
************************************************************************/