17#ifndef QGSLAYOUTPAGECOLLECTION_H
18#define QGSLAYOUTPAGECOLLECTION_H
55 QString
stringType()
const override {
return QStringLiteral(
"LayoutPageCollection" ); }
63 QList< QgsLayoutItemPage * > pages();
69 int pageCount()
const;
101 QList< QgsLayoutItemPage * > visiblePages(
const QRectF ®ion )
const;
108 QList< int > visiblePageNumbers(
const QRectF ®ion )
const;
115 bool pageIsEmpty(
int page )
const;
120 QList< QgsLayoutItem *> itemsOnPage(
int page )
const;
129 const QList<QGraphicsItem *> graphicsItemList = mLayout->items();
130 for ( QGraphicsItem *graphicsItem : graphicsItemList )
132 T *item =
dynamic_cast<T *
>( graphicsItem );
133 if ( item && item->page() ==
page )
135 itemList.push_back( item );
148 bool shouldExportPage(
int page )
const;
202 void deletePage(
int pageNumber );
247 void beginPageSizeChange();
255 void endPageSizeChange();
269 double maximumPageWidth() const;
277 QSizeF maximumPageSize() const;
285 bool hasUniformPageSizes() const;
301 int pageNumberForPoint( QPointF point ) const;
318 int predictPageNumberForPoint( QPointF point ) const;
336 QPointF pagePositionToLayoutPosition(
int page, const
QgsLayoutPoint &position ) const;
349 QPointF positionOnPage( QPointF point ) const;
354 double spaceBetweenPages() const;
359 double pageShadowWidth() const;
369 void resizeToContents( const
QgsMargins &margins,
Qgis::LayoutUnit marginUnits );
375 bool writeXml( QDomElement &parentElement, QDomDocument &document, const
QgsReadWriteContext &context ) const override;
381 bool readXml( const QDomElement &collectionElement, const QDomDocument &document, const
QgsReadWriteContext &context ) override;
398 void applyPropertiesToAllOtherPages(
int sourcePage );
433 bool mBlockUndoCommands = false;
435 QMap< QString, QPair<
int,
QgsLayoutPoint > > mPreviousItemPositions;
437 void createDefaultPageStyleSymbol();
Provides global constants and enumerations for use throughout the application.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
Stores and manages the snap guides used by a layout.
Item representing the paper in a layout.
void changed()
Emitted when pages are added or removed from the collection.
void itemsOnPage(QList< T * > &itemList, int page) const
Returns layout items of a specific type on a specified page.
QgsLayoutPageCollection(QgsLayout *layout)
Constructor for QgsLayoutItemPage, with the specified parent layout.
friend class QgsLayoutPageCollectionUndoCommand
QgsLayout * layout() override
Returns the layout the object belongs to.
void pageAboutToBeRemoved(int pageNumber)
Emitted just before a page is removed from the collection.
QgsLayoutItemPage * page(int pageNumber)
Returns a specific page (by pageNumber) from the collection.
int pageNumber(QgsLayoutItemPage *page) const
Returns the page number for the specified page, or -1 if the page is not contained in the collection.
QString stringType() const override
Returns the object type as a string.
Provides a method of storing points, consisting of an x and y coordinate, for use in QGIS layouts.
An interface for layout objects which can be stored and read from DOM elements.
virtual QgsLayout * layout()=0
Returns the layout the object belongs to.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Defines the four margins of a rectangle.
A container for the context for various read/write operations on objects.