QGIS/python/core/qgsmaplayerlegend.sip.in

200 lines
5.9 KiB
Plaintext
Raw Normal View History

2017-05-14 09:48:41 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaplayerlegend.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapLayerLegend : QObject
{
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
The QgsMapLayerLegend class is abstract interface for implementations
of legends for one map layer.
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.6
%End
2014-08-17 13:37:26 +02:00
2017-05-14 09:48:41 +02:00
%TypeHeaderCode
#include "qgsmaplayerlegend.h"
%End
public:
explicit QgsMapLayerLegend( QObject *parent /TransferThis/ = 0 );
%Docstring
Constructor for QgsMapLayerLegend
%End
virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
%Docstring
Reads configuration from a DOM element previously written by writeXml()
.. versionadded:: 3.2
%End
virtual QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
%Docstring
Writes configuration to a DOM element, to be used later with readXml()
.. versionadded:: 3.2
%End
2017-05-14 09:48:41 +02:00
virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) = 0 /Factory/;
%Docstring
2017-12-15 10:36:55 -04:00
Return list of legend nodes to be used for a particular layer tree layer node.
Ownership is transferred to the caller.
2017-05-14 09:48:41 +02:00
%End
static QgsMapLayerLegend *defaultVectorLegend( QgsVectorLayer *vl ) /Factory/;
2017-05-14 09:48:41 +02:00
%Docstring
Create new legend implementation for vector layer
%End
static QgsMapLayerLegend *defaultRasterLegend( QgsRasterLayer *rl ) /Factory/;
2017-05-14 09:48:41 +02:00
%Docstring
Create new legend implementation for raster layer
%End
signals:
void itemsChanged();
2017-05-14 09:48:41 +02:00
%Docstring
Emitted when existing items/nodes got invalid and should be replaced by new ones
%End
};
2014-08-20 19:32:29 +07:00
class QgsMapLayerLegendUtils
{
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Miscellaneous utility functions for handling of map layer legend
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.6
%End
2014-08-20 19:32:29 +07:00
%TypeHeaderCode
2017-05-14 09:48:41 +02:00
#include "qgsmaplayerlegend.h"
2014-08-20 19:32:29 +07:00
%End
public:
static void setLegendNodeOrder( QgsLayerTreeLayer *nodeLayer, const QList<int> &order );
static QList<int> legendNodeOrder( QgsLayerTreeLayer *nodeLayer );
static bool hasLegendNodeOrder( QgsLayerTreeLayer *nodeLayer );
2014-08-20 19:32:29 +07:00
static void setLegendNodeUserLabel( QgsLayerTreeLayer *nodeLayer, int originalIndex, const QString &newLabel );
static QString legendNodeUserLabel( QgsLayerTreeLayer *nodeLayer, int originalIndex );
static bool hasLegendNodeUserLabel( QgsLayerTreeLayer *nodeLayer, int originalIndex );
2014-08-20 19:32:29 +07:00
2017-05-14 09:48:41 +02:00
static void applyLayerNodeProperties( QgsLayerTreeLayer *nodeLayer, QList<QgsLayerTreeModelLegendNode *> &nodes );
%Docstring
update according to layer node's custom properties (order of items, user labels for items)
%End
2014-08-20 19:32:29 +07:00
};
class QgsDefaultVectorLayerLegend : QgsMapLayerLegend
{
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Default legend implementation for vector layers
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.6
%End
%TypeHeaderCode
2017-05-14 09:48:41 +02:00
#include "qgsmaplayerlegend.h"
%End
public:
explicit QgsDefaultVectorLayerLegend( QgsVectorLayer *vl );
bool textOnSymbolEnabled() const;
%Docstring
Returns whether the "text on symbol" functionality is enabled. When enabled, legend symbols
may have extra text rendered on top. The content of labels and their style is controlled
by textOnSymbolContent() and textOnSymbolTextFormat().
.. versionadded:: 3.2
%End
void setTextOnSymbolEnabled( bool enabled );
%Docstring
Sets whether the "text on symbol" functionality is enabled. When enabled, legend symbols
may have extra text rendered on top. The content of labels and their style is controlled
by textOnSymbolContent() and textOnSymbolTextFormat().
.. versionadded:: 3.2
%End
QgsTextFormat textOnSymbolTextFormat() const;
%Docstring
Returns text format of symbol labels for "text on symbol" functionality.
.. versionadded:: 3.2
%End
void setTextOnSymbolTextFormat( const QgsTextFormat &format );
%Docstring
Sets text format of symbol labels for "text on symbol" functionality.
.. versionadded:: 3.2
%End
QHash<QString, QString> textOnSymbolContent() const;
%Docstring
Returns per-symbol content of labels for "text on symbol" functionality. In the passed dictionary
the keys are rule keys of legend items, the values are labels to be shown.
.. versionadded:: 3.2
%End
void setTextOnSymbolContent( const QHash<QString, QString> &content );
%Docstring
Sets per-symbol content of labels for "text on symbol" functionality. In the passed dictionary
the keys are rule keys of legend items, the values are labels to be shown.
.. versionadded:: 3.2
%End
2017-05-14 09:48:41 +02:00
virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;
virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
virtual QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
};
class QgsDefaultRasterLayerLegend : QgsMapLayerLegend
{
2017-05-14 09:48:41 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Default legend implementation for raster layers
2017-05-14 09:48:41 +02:00
.. versionadded:: 2.6
%End
%TypeHeaderCode
2017-05-14 09:48:41 +02:00
#include "qgsmaplayerlegend.h"
%End
public:
explicit QgsDefaultRasterLayerLegend( QgsRasterLayer *rl );
2017-05-14 09:48:41 +02:00
virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;
};
2017-05-14 09:48:41 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmaplayerlegend.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/