File: qgslayoutitemregistry.sip.in

package info (click to toggle)
qgis 3.34.7%2Bdfsg-1~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 1,087,388 kB
  • sloc: cpp: 1,440,033; python: 234,418; xml: 23,096; perl: 3,499; sh: 3,364; ansic: 2,219; sql: 2,130; yacc: 1,063; lex: 577; javascript: 540; lisp: 411; makefile: 155
file content (312 lines) | stat: -rw-r--r-- 8,969 bytes parent folder | download | duplicates (4)
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
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/core/layout/qgslayoutitemregistry.h                              *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.pl again   *
 ************************************************************************/




class QgsLayoutItemAbstractMetadata
{
%Docstring(signature="appended")
Stores metadata about one layout item class.

A companion class, :py:class:`QgsLayoutItemAbstractGuiMetadata`, handles the
GUI behavior of :py:class:`QgsLayoutItems`.

.. note::

   In C++ you can use :py:class:`QgsLayoutItemMetadata` convenience class.

.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgslayoutitemregistry.h"
%End
  public:

    QgsLayoutItemAbstractMetadata( int type, const QString &visibleName, const QString &visiblePluralName = QString() );
%Docstring
Constructor for QgsLayoutItemAbstractMetadata with the specified class ``type``
and ``visibleName``.

The optional ``visiblePluralName`` argument can be used to specify a plural variant of the item type.
%End

    virtual ~QgsLayoutItemAbstractMetadata();

    int type() const;
%Docstring
Returns the unique item type code for the layout item class.
%End

    QString visibleName() const;
%Docstring
Returns a translated, user visible name for the layout item class.

.. seealso:: :py:func:`visiblePluralName`
%End

    QString visiblePluralName() const;
%Docstring
Returns a translated, user visible name for plurals of the layout item class (e.g. "Labels" for a "Label" item).

.. versionadded:: 3.10
%End


    virtual QgsLayoutItem *createItem( QgsLayout *layout ) = 0 /TransferBack/;
%Docstring
Creates a layout item of this class for a specified ``layout``.
%End

    virtual void resolvePaths( QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving );
%Docstring
Resolve paths in the item's ``properties`` (if there are any paths).
When ``saving`` is ``True``, paths are converted from absolute to relative,
when ``saving`` is ``False``, paths are converted from relative to absolute.
This ensures that paths in project files can be relative, but in item
instances the paths are always absolute.
%End

};




class QgsLayoutMultiFrameAbstractMetadata
{
%Docstring(signature="appended")
Stores metadata about one layout multiframe class.

A companion class, :py:class:`QgsLayoutMultiFrameAbstractGuiMetadata`, handles the
GUI behavior of :py:class:`QgsLayoutMultiFrames`.

.. note::

   In C++ you can use :py:class:`QgsLayoutMultiFrameMetadata` convenience class.

.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgslayoutitemregistry.h"
%End
  public:

    QgsLayoutMultiFrameAbstractMetadata( int type, const QString &visibleName );
%Docstring
Constructor for QgsLayoutMultiFrameAbstractMetadata with the specified class ``type``
and ``visibleName``.
%End

    virtual ~QgsLayoutMultiFrameAbstractMetadata();

    int type() const;
%Docstring
Returns the unique item type code for the layout multiframe class.
%End

    virtual QIcon icon() const;
%Docstring
Returns an icon representing the layout multiframe type.
%End

    QString visibleName() const;
%Docstring
Returns a translated, user visible name for the layout multiframe class.
%End


    virtual QgsLayoutMultiFrame *createMultiFrame( QgsLayout *layout ) = 0 /TransferBack/;
%Docstring
Creates a layout multiframe of this class for a specified ``layout``.
%End

    virtual void resolvePaths( QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving );
%Docstring
Resolve paths in the item's ``properties`` (if there are any paths).
When ``saving`` is ``True``, paths are converted from absolute to relative,
when ``saving`` is ``False``, paths are converted from relative to absolute.
This ensures that paths in project files can be relative, but in item
instances the paths are always absolute.
%End

};





class QgsLayoutItemRegistry : QObject
{
%Docstring(signature="appended")
Registry of available layout item types.

:py:class:`QgsLayoutItemRegistry` is not usually directly created, but rather accessed through
:py:func:`QgsApplication.layoutItemRegistry()`.

A companion class, :py:class:`QgsLayoutItemGuiRegistry`, handles the GUI behavior
of layout items.

.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgslayoutitemregistry.h"
%End
  public:

    enum ItemType
    {
      LayoutItem,
      LayoutGroup,

      // known item types

      // WARNING!!!! SIP CASTING OF QgsLayoutItem and QgsLayoutMultiFrame DEPENDS on these
      // values, and must be updated if any additional types are added

      LayoutPage,
      LayoutMap,
      LayoutPicture,
      LayoutLabel,
      LayoutLegend,
      LayoutShape,
      LayoutPolygon,
      LayoutPolyline,
      LayoutScaleBar,
      LayoutFrame,

      // known multi-frame types

      // WARNING!!!! SIP CASTING OF QgsLayoutItem and QgsLayoutMultiFrame DEPENDS on these
      // values, and must be updated if any additional types are added

      LayoutHtml,
      LayoutAttributeTable,
      LayoutTextTable,

      Layout3DMap,

      LayoutManualTable,
      LayoutMarker,

      LayoutElevationProfile,

      // WARNING!!!! SIP CASTING OF QgsLayoutItem and QgsLayoutMultiFrame DEPENDS on these
      // values, and must be updated if any additional types are added

      // item types provided by plugins
      PluginItem,
    };

    QgsLayoutItemRegistry( QObject *parent = 0 );
%Docstring
Creates a new empty item registry.

QgsLayoutItemRegistry is not usually directly created, but rather accessed through
:py:func:`QgsApplication.layoutItemRegistry()`.

.. seealso:: :py:func:`populate`
%End

    ~QgsLayoutItemRegistry();

    bool populate();
%Docstring
Populates the registry with standard item types. If called on a non-empty registry
then this will have no effect and will return ``False``.
%End


    QgsLayoutItemAbstractMetadata *itemMetadata( int type ) const;
%Docstring
Returns the metadata for the specified item ``type``. Returns ``None`` if
a corresponding type was not found in the registry.

.. seealso:: :py:func:`multiFrameMetadata`
%End

    QgsLayoutMultiFrameAbstractMetadata *multiFrameMetadata( int type ) const;
%Docstring
Returns the metadata for the specified multiframe ``type``. Returns ``None`` if
a corresponding type was not found in the registry.

.. seealso:: :py:func:`itemMetadata`
%End


    bool addLayoutItemType( QgsLayoutItemAbstractMetadata *metadata /Transfer/ );
%Docstring
Registers a new layout item type. Takes ownership of the metadata instance.

.. seealso:: :py:func:`addLayoutMultiFrameType`
%End

    bool addLayoutMultiFrameType( QgsLayoutMultiFrameAbstractMetadata *metadata /Transfer/ );
%Docstring
Registers a new layout multiframe type. Takes ownership of the metadata instance.

.. seealso:: :py:func:`addLayoutItemType`
%End

    QgsLayoutItem *createItem( int type, QgsLayout *layout ) const /TransferBack/;
%Docstring
Creates a new instance of a layout item given the item ``type``, and target ``layout``.

.. seealso:: :py:func:`createMultiFrame`
%End

    QgsLayoutMultiFrame *createMultiFrame( int type, QgsLayout *layout ) const /TransferBack/;
%Docstring
Creates a new instance of a layout multiframe given the multiframe ``type``, and target ``layout``.

.. seealso:: :py:func:`createItem`
%End

    void resolvePaths( int type, QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving ) const;
%Docstring
Resolve paths in properties of a particular symbol layer.
This normally means converting relative paths to absolute paths when loading
and converting absolute paths to relative paths when saving.
%End

    QMap< int, QString> itemTypes() const;
%Docstring
Returns a map of available item types to translated name.
%End

  signals:

    void typeAdded( int type, const QString &name );
%Docstring
Emitted whenever a new item type is added to the registry, with the specified
``type`` and visible ``name``.
%End

    void multiFrameTypeAdded( int type, const QString &name );
%Docstring
Emitted whenever a new multiframe type is added to the registry, with the specified
``type`` and visible ``name``.
%End

  private:
    QgsLayoutItemRegistry( const QgsLayoutItemRegistry &rh );
};





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