QGIS/python/core/auto_generated/callouts/qgscalloutsregistry.sip.in

185 lines
5.0 KiB
Plaintext
Raw Normal View History

2019-07-05 11:05:58 +10:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/callouts/qgscalloutsregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsCalloutWidget /External/;
class QgsCalloutAbstractMetadata
{
%Docstring
Stores metadata about one callout renderer class.
.. note::
It's necessary to implement createCallout() function.
In C++ you can use QgsCalloutMetadata convenience class.
2019-07-10 19:11:35 +10:00
.. versionadded:: 3.10
2019-07-05 11:05:58 +10:00
%End
%TypeHeaderCode
#include "qgscalloutsregistry.h"
%End
public:
2019-07-10 19:11:35 +10:00
QgsCalloutAbstractMetadata( const QString &name, const QString &visibleName, const QIcon &icon = QIcon() );
2019-07-10 19:11:35 +10:00
%Docstring
Constructor for QgsCalloutAbstractMetadata, with the specified ``name``.
The ``visibleName`` argument gives a translated, user friendly string identifying the callout type.
The ``icon`` argument can be used to specify an icon representing the callout.
2019-07-10 19:11:35 +10:00
%End
2019-07-05 11:05:58 +10:00
virtual ~QgsCalloutAbstractMetadata();
QString name() const;
%Docstring
Returns the unique name of the callout type. This value is not translated.
.. seealso:: :py:func:`visibleName`
%End
QString visibleName() const;
%Docstring
Returns a friendly display name of the callout type. This value is translated.
.. seealso:: :py:func:`name`
%End
QIcon icon() const;
%Docstring
Returns an icon representing the callout.
.. seealso:: :py:func:`setIcon`
%End
void setIcon( const QIcon &icon );
%Docstring
Sets an ``icon`` representing the callout.
.. seealso:: :py:func:`icon`
2019-07-05 11:05:58 +10:00
%End
2019-07-05 11:50:07 +10:00
virtual QgsCallout *createCallout( const QVariantMap &properties, const QgsReadWriteContext &context ) = 0 /Factory/;
2019-07-05 11:05:58 +10:00
%Docstring
Create a callout of this type given the map of ``properties``.
Ownership of the callout is transferred to the caller.
%End
virtual QgsCalloutWidget *createCalloutWidget( QgsVectorLayer * );
%Docstring
Creates a widget for configuring callouts of this type. Can return ``None`` if there's no GUI required.
Ownership of the widget is transferred to the caller.
%End
protected:
};
class QgsCalloutMetadata : QgsCalloutAbstractMetadata
{
%Docstring
Convenience metadata class that uses static functions to create callouts and their widgets.
.. versionadded:: 3.10
%End
%TypeHeaderCode
#include "qgscalloutsregistry.h"
%End
public:
2019-07-05 11:50:07 +10:00
virtual QgsCallout *createCallout( const QVariantMap &properties, const QgsReadWriteContext &context ) /Factory/;
2019-07-05 11:05:58 +10:00
virtual QgsCalloutWidget *createCalloutWidget( QgsVectorLayer *vl ) /Factory/;
protected:
private:
QgsCalloutMetadata();
};
class QgsCalloutRegistry
{
%Docstring
Registry of available callout classes.
QgsCalloutRegistry is not usually directly created, but rather accessed through
:py:func:`QgsApplication.calloutRegistry()`
.. versionadded:: 3.10
%End
%TypeHeaderCode
#include "qgscalloutsregistry.h"
%End
public:
QgsCalloutRegistry();
~QgsCalloutRegistry();
2019-07-05 11:50:07 +10:00
QgsCalloutAbstractMetadata *calloutMetadata( const QString &type ) const;
2019-07-05 11:05:58 +10:00
%Docstring
Returns the metadata for specified the specified callout ``type``. Returns ``None`` if no matching callout style was found.
%End
bool addCalloutType( QgsCalloutAbstractMetadata *metadata /Transfer/ );
%Docstring
Registers a new callout type.
2019-07-05 11:50:07 +10:00
Ownership of ``metadata`` is transferred to the registry.
2019-07-05 11:05:58 +10:00
%End
2019-07-05 11:50:07 +10:00
QgsCallout *createCallout( const QString &type, const QVariantMap &properties = QVariantMap(), const QgsReadWriteContext &context = QgsReadWriteContext() ) const /Factory/;
2019-07-05 11:05:58 +10:00
%Docstring
Creates a new instance of a callout, given the callout ``type`` and ``properties``.
The caller takes ownership of the callout.
%End
2019-07-05 11:50:07 +10:00
QgsCallout *createCallout( const QString &type, const QDomElement &element, const QgsReadWriteContext &context ) const /Factory/;
2019-07-05 11:05:58 +10:00
%Docstring
Creates a new instance of a callout of the specified ``type``, using the properties from a DOM ``element``.
The caller takes ownership of the callout.
2019-07-05 11:50:07 +10:00
%End
QStringList calloutTypes() const;
%Docstring
Returns a list of all available callout types.
2019-07-05 11:05:58 +10:00
%End
static QgsCallout *defaultCallout() /Factory/;
%Docstring
Create a new instance of a callout with default settings.
The caller takes ownership of the callout.
%End
private:
QgsCalloutRegistry( const QgsCalloutRegistry &rh );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/callouts/qgscalloutsregistry.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/