File: qgsmaplayerlegend.sip.in

package info (click to toggle)
qgis 3.40.11%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,183,800 kB
  • sloc: cpp: 1,595,841; python: 372,637; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,257; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 154
file content (407 lines) | stat: -rw-r--r-- 12,160 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsmaplayerlegend.h                                         *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/







class QgsMapLayerLegend : QObject
{
%Docstring(signature="appended")
The :py:class:`QgsMapLayerLegend` class is abstract interface for
implementations of legends for one map layer.
%End

%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
:py:func:`~QgsMapLayerLegend.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
:py:func:`~QgsMapLayerLegend.readXml`

.. versionadded:: 3.2
%End

    virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) = 0 /Factory/;
%Docstring
Returns list of legend nodes to be used for a particular layer tree
layer node. Ownership is transferred to the caller.
%End


    static QgsMapLayerLegend *defaultVectorLegend( QgsVectorLayer *vl ) /Factory/;
%Docstring
Create new legend implementation for vector layer
%End

    static QgsMapLayerLegend *defaultRasterLegend( QgsRasterLayer *rl ) /Factory/;
%Docstring
Create new legend implementation for raster layer
%End

    static QgsMapLayerLegend *defaultMeshLegend( QgsMeshLayer *ml ) /Factory/;
%Docstring
Create new legend implementation for mesh layer
%End

    static QgsMapLayerLegend *defaultPointCloudLegend( QgsPointCloudLayer *layer ) /Factory/;
%Docstring
Create new legend implementation for a point cloud ``layer``.

.. versionadded:: 3.18
%End

  signals:
    void itemsChanged();
%Docstring
Emitted when existing items/nodes got invalid and should be replaced by
new ones
%End
};


class QgsMapLayerLegendUtils
{
%Docstring(signature="appended")
Miscellaneous utility functions for handling of map layer legend
%End

%TypeHeaderCode
#include "qgsmaplayerlegend.h"
%End
  public:
    static void setLegendNodeOrder( QgsLayerTreeLayer *nodeLayer, const QList<int> &order );
    static QList<int> legendNodeOrder( QgsLayerTreeLayer *nodeLayer );
    static bool hasLegendNodeOrder( QgsLayerTreeLayer *nodeLayer );

    static void setLegendNodeUserLabel( QgsLayerTreeLayer *nodeLayer, int originalIndex, const QString &newLabel );
    static QString legendNodeUserLabel( QgsLayerTreeLayer *nodeLayer, int originalIndex );
    static bool hasLegendNodeUserLabel( QgsLayerTreeLayer *nodeLayer, int originalIndex );

    static void setLegendNodePatchShape( QgsLayerTreeLayer *nodeLayer, int originalIndex, const QgsLegendPatchShape &shape );
%Docstring
Sets the legend patch ``shape`` for the legend node belonging to
``nodeLayer`` at the specified ``originalIndex``.

.. seealso:: :py:func:`legendNodePatchShape`

.. versionadded:: 3.14
%End

    static QgsLegendPatchShape legendNodePatchShape( QgsLayerTreeLayer *nodeLayer, int originalIndex );
%Docstring
Returns the legend patch shape for the legend node belonging to
``nodeLayer`` at the specified ``originalIndex``.

.. seealso:: :py:func:`setLegendNodePatchShape`

.. versionadded:: 3.14
%End

    static void setLegendNodeSymbolSize( QgsLayerTreeLayer *nodeLayer, int originalIndex, QSizeF size );
%Docstring
Sets the legend symbol ``size`` for the legend node belonging to
``nodeLayer`` at the specified ``originalIndex``.

If either the width or height are non-zero, they will be used when
rendering the legend node instead of the default symbol width or height
from :py:class:`QgsLegendSettings`.

.. seealso:: :py:func:`legendNodeSymbolSize`

.. versionadded:: 3.14
%End

    static QSizeF legendNodeSymbolSize( QgsLayerTreeLayer *nodeLayer, int originalIndex );
%Docstring
Returns the legend node symbol size for the legend node belonging to
``nodeLayer`` at the specified ``originalIndex``.

If either the width or height are non-zero, they will be used when
rendering the legend node instead of the default symbol width or height
from :py:class:`QgsLegendSettings`.

.. seealso:: :py:func:`setLegendNodeSymbolSize`

.. versionadded:: 3.14
%End

    static void setLegendNodeCustomSymbol( QgsLayerTreeLayer *nodeLayer, int originalIndex, const QgsSymbol *symbol );
%Docstring
Sets a custom legend ``symbol`` for the legend node belonging to
``nodeLayer`` at the specified ``originalIndex``.

If ``symbol`` is non-``None``, it will be used in place of the default
symbol when rendering the legend node.

.. seealso:: :py:func:`legendNodeCustomSymbol`

.. versionadded:: 3.14
%End

    static QgsSymbol *legendNodeCustomSymbol( QgsLayerTreeLayer *nodeLayer, int originalIndex ) /Factory/;
%Docstring
Returns the custom legend symbol for the legend node belonging to
``nodeLayer`` at the specified ``originalIndex``.

If the symbol is non-``None``, it will be used in place of the default
symbol when rendering the legend node.

Caller takes ownership of the returned symbol.

.. seealso:: :py:func:`setLegendNodeCustomSymbol`

.. versionadded:: 3.14
%End

    static void setLegendNodeColorRampSettings( QgsLayerTreeLayer *nodeLayer, int originalIndex, const QgsColorRampLegendNodeSettings *settings );
%Docstring
Sets a custom legend color ramp ``settings`` for the legend node
belonging to ``nodeLayer`` at the specified ``originalIndex``.

If the corresponding legend node is not a
:py:class:`QgsColorRampLegendNode` then calling this method will have no
effect.

If ``settings`` is non-``None``, they will be used in place of the
default settigns when rendering the legend node.

.. seealso:: :py:func:`legendNodeColorRampSettings`

.. versionadded:: 3.18
%End

    static QgsColorRampLegendNodeSettings *legendNodeColorRampSettings( QgsLayerTreeLayer *nodeLayer, int originalIndex ) /Factory/;
%Docstring
Returns the custom legend color ramp settings for the legend node
belonging to ``nodeLayer`` at the specified ``originalIndex``.

If the corresponding legend node is not a
:py:class:`QgsColorRampLegendNode` then calling this method will return
``None``.

If the returned value is non-``None``, they will be used in place of the
default settings when rendering the legend node.

Caller takes ownership of the returned settings.

.. seealso:: :py:func:`setLegendNodeColorRampSettings`

.. versionadded:: 3.18
%End


    static void setLegendNodeColumnBreak( QgsLayerTreeLayer *nodeLayer, int originalIndex, bool columnBreakBeforeNode );
%Docstring
Sets whether a forced column break should occur before the node.

.. seealso:: :py:func:`legendNodeColumnBreak`

.. versionadded:: 3.14
%End

    static bool legendNodeColumnBreak( QgsLayerTreeLayer *nodeLayer, int originalIndex );
%Docstring
Returns whether a forced column break should occur before the node.

.. seealso:: :py:func:`setLegendNodeColumnBreak`

.. versionadded:: 3.14
%End

    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
};




class QgsDefaultVectorLayerLegend : QgsMapLayerLegend
{
%Docstring(signature="appended")
Default legend implementation for vector layers
%End

%TypeHeaderCode
#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
:py:func:`~QgsDefaultVectorLayerLegend.textOnSymbolContent` and
:py:func:`~QgsDefaultVectorLayerLegend.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
:py:func:`~QgsDefaultVectorLayerLegend.textOnSymbolContent` and
:py:func:`~QgsDefaultVectorLayerLegend.textOnSymbolTextFormat`.

.. versionadded:: 3.2
%End

    bool showLabelLegend() const;
%Docstring
Returns whether the legend for the labeling is shown

.. versionadded:: 3.20
%End

    void setShowLabelLegend( bool enabled );
%Docstring
Sets if a legend for the labeling should be shown

:param enabled: true to show label legend entries

.. versionadded:: 3.20
%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

    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
{
%Docstring(signature="appended")
Default legend implementation for raster layers
%End

%TypeHeaderCode
#include "qgsmaplayerlegend.h"
%End
  public:
    explicit QgsDefaultRasterLayerLegend( QgsRasterLayer *rl );

    virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;


};


class QgsDefaultMeshLayerLegend : QgsMapLayerLegend
{
%Docstring(signature="appended")
Default legend implementation for mesh layers

.. versionadded:: 3.4
%End

%TypeHeaderCode
#include "qgsmaplayerlegend.h"
%End
  public:
    explicit QgsDefaultMeshLayerLegend( QgsMeshLayer *ml );
%Docstring
Creates an instance for the given mesh layer
%End

    virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;


};

class QgsDefaultPointCloudLayerLegend : QgsMapLayerLegend
{
%Docstring(signature="appended")
Default legend implementation for point cloud layers

.. versionadded:: 3.18
%End

%TypeHeaderCode
#include "qgsmaplayerlegend.h"
%End
  public:
    explicit QgsDefaultPointCloudLayerLegend( QgsPointCloudLayer *layer );
%Docstring
Creates an instance for the given point cloud layer
%End

    virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;


};


/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/qgsmaplayerlegend.h                                         *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/