-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
qgslayoutpagecollection.sip
285 lines (221 loc) · 8.5 KB
/
qgslayoutpagecollection.sip
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
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutpagecollection.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsLayoutPageCollection : QObject, QgsLayoutSerializableObject
{
%Docstring
A manager for a collection of pages in a layout.
.. versionadded:: 3.0
%End
%TypeHeaderCode
#include "qgslayoutpagecollection.h"
%End
public:
explicit QgsLayoutPageCollection( QgsLayout *layout /TransferThis/ );
%Docstring
Constructor for QgsLayoutItemPage, with the specified parent ``layout``.
%End
~QgsLayoutPageCollection();
virtual QString stringType() const;
virtual QgsLayout *layout();
QList< QgsLayoutItemPage * > pages();
%Docstring
Returns a list of pages in the collection.
.. seealso:: page()
.. seealso:: pageCount()
:rtype: list of QgsLayoutItemPage
%End
int pageCount() const;
%Docstring
Returns the number of pages in the collection.
.. seealso:: pages()
:rtype: int
%End
QgsLayoutItemPage *page( int pageNumber );
%Docstring
Returns a specific page (by ``pageNumber``) from the collection.
Internal page numbering starts at 0 - so a ``pageNumber`` of 0
corresponds to the first page in the collection.
A None is returned if an invalid page number is specified.
.. seealso:: pages()
:rtype: QgsLayoutItemPage
%End
int pageNumber( QgsLayoutItemPage *page ) const;
%Docstring
Returns the page number for the specified ``page``, or -1 if the page
is not contained in the collection.
:rtype: int
%End
QList< QgsLayoutItemPage * > visiblePages( QRectF region ) const;
%Docstring
Returns a list of the pages which are visible within the specified
``region`` (in layout coordinates).
.. seealso:: visiblePageNumbers()
:rtype: list of QgsLayoutItemPage
%End
QList< int > visiblePageNumbers( QRectF region ) const;
%Docstring
Returns a list of the page numbers which are visible within the specified
``region`` (in layout coordinates).
.. seealso:: visiblePages()
:rtype: list of int
%End
void addPage( QgsLayoutItemPage *page /Transfer/ );
%Docstring
Adds a ``page`` to the collection. Ownership of the ``page`` is transferred
to the collection, and the page will automatically be added to the collection's
layout() (there is no need to manually add the page item to the layout).
The page will be added after all pages currently contained in the collection.
Calling addPage() automatically triggers a reflow() of pages.
.. seealso:: insertPage()
%End
void insertPage( QgsLayoutItemPage *page /Transfer/, int beforePage );
%Docstring
Inserts a ``page`` into a specific position in the collection.
Ownership of the ``page`` is transferred
to the collection, and the page will automatically be added to the collection's
layout() (there is no need to manually add the page item to the layout).
The page will be added after before the page number specified by ``beforePage``.
(Page numbers in collections begin at 0 - so a ``beforePage`` of 0 will insert
the page before all existing pages).
Calling insertPage() automatically triggers a reflow() of pages.
.. seealso:: addPage()
%End
void deletePage( int pageNumber );
%Docstring
Deletes a page from the collection. The page will automatically be removed
from the collection's layout().
Page numbers in collections begin at 0 - so a ``pageNumber`` of 0 will delete
the first page in the collection.
Calling deletePage() automatically triggers a reflow() of pages.
%End
void deletePage( QgsLayoutItemPage *page );
%Docstring
Deletes a page from the collection. The page will automatically be removed
from the collection's layout().
Calling deletePage() automatically triggers a reflow() of pages.
%End
QgsLayoutItemPage *takePage( QgsLayoutItemPage *page ) /TransferBack/;
%Docstring
Takes a ``page`` from the collection, returning ownership of the page to the caller.
:rtype: QgsLayoutItemPage
%End
void setPageStyleSymbol( QgsFillSymbol *symbol );
%Docstring
Sets the ``symbol`` to use for drawing pages in the collection.
Ownership is not transferred, and a copy of the symbol is created internally.
.. seealso:: pageStyleSymbol()
%End
const QgsFillSymbol *pageStyleSymbol() const;
%Docstring
Returns the symbol to use for drawing pages in the collection.
.. seealso:: setPageStyleSymbol()
:rtype: QgsFillSymbol
%End
void reflow();
%Docstring
Forces the page collection to reflow the arrangement of pages, e.g. to account
for page size/orientation change.
%End
double maximumPageWidth() const;
%Docstring
Returns the maximum width of pages in the collection. The returned value is
in layout units.
:rtype: float
%End
int pageNumberForPoint( QPointF point ) const;
%Docstring
Returns the page number corresponding to a ``point`` in the layout (in layout units).
Page numbers in collections begin at 0 - so a page number of 0 indicates the
first page.
.. note::
This is a relaxed check, which will always return a page number. For instance,
it does not consider x coordinates and vertical coordinates before the first page or
after the last page will still return the nearest page.
.. seealso:: pageAtPoint()
.. seealso:: positionOnPage()
:rtype: int
%End
QgsLayoutItemPage *pageAtPoint( QPointF point ) const;
%Docstring
Returns the page at a specified ``point`` (in layout coordinates).
If no page exists at ``point``, None will be returned.
.. note::
Unlike pageNumberForPoint(), this method only returns pages which
directly intersect with the specified point.
.. seealso:: pageNumberForPoint()
:rtype: QgsLayoutItemPage
%End
QPointF pagePositionToLayoutPosition( int page, const QgsLayoutPoint &position ) const;
%Docstring
Converts a ``position`` on a ``page`` to an absolute position in layout coordinates.\
.. seealso:: pagePositionToAbsolute()
:rtype: QPointF
%End
QgsLayoutPoint pagePositionToAbsolute( int page, const QgsLayoutPoint &position ) const;
%Docstring
Converts a ``position`` on a ``page`` to an absolute position in (maintaining the units from the input ``position``).
.. seealso:: pagePositionToLayoutPosition()
:rtype: QgsLayoutPoint
%End
QPointF positionOnPage( QPointF point ) const;
%Docstring
Returns the position within a page of a ``point`` in the layout (in layout units).
.. seealso:: pageNumberForPoint()
:rtype: QPointF
%End
double spaceBetweenPages() const;
%Docstring
Returns the space between pages, in layout units.
:rtype: float
%End
double pageShadowWidth() const;
%Docstring
Returns the size of the page shadow, in layout units.
:rtype: float
%End
virtual bool writeXml( QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context ) const;
%Docstring
Stores the collection's state in a DOM element. The ``parentElement`` should refer to the parent layout's DOM element.
.. seealso:: readXml()
:rtype: bool
%End
virtual bool readXml( const QDomElement &collectionElement, const QDomDocument &document, const QgsReadWriteContext &context );
%Docstring
Sets the collection's state from a DOM element. collectionElement is the DOM node corresponding to the collection.
.. seealso:: writeXml()
:rtype: bool
%End
QgsLayoutGuideCollection &guides();
%Docstring
Returns a reference to the collection's guide collection, which manages page snap guides.
:rtype: QgsLayoutGuideCollection
%End
public slots:
void redraw();
%Docstring
Triggers a redraw for all pages.
%End
signals:
void changed();
%Docstring
Emitted when pages are added or removed from the collection.
%End
void pageAboutToBeRemoved( int pageNumber );
%Docstring
Emitted just before a page is removed from the collection.
Page numbers in collections begin at 0 - so a page number of 0 indicates the
first page.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/layout/qgslayoutpagecollection.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/