QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsprintlayout.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsprintlayout.h
3  -------------------
4  begin : December 2017
5  copyright : (C) 2017 by Nyall Dawson
6  email : nyall dot dawson at gmail dot com
7  ***************************************************************************/
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 #ifndef QGSPRINTLAYOUT_H
17 #define QGSPRINTLAYOUT_H
18 
19 #include "qgis_core.h"
20 #include "qgslayout.h"
21 
22 class QgsLayoutAtlas;
23 
30 class CORE_EXPORT QgsPrintLayout : public QgsLayout, public QgsMasterLayoutInterface
31 {
32  Q_OBJECT
33  Q_PROPERTY( QString name READ name WRITE setName NOTIFY nameChanged )
34 
35  public:
36 
40  QgsPrintLayout( QgsProject *project );
41 
42  QgsPrintLayout *clone() const override SIP_FACTORY;
43  QgsProject *layoutProject() const override;
44  QgsMasterLayoutInterface::Type layoutType() const override;
45  QIcon icon() const override;
46 
50  QgsLayoutAtlas *atlas();
51 
52  QString name() const override { return mName; }
53  void setName( const QString &name ) override;
54 
55  QDomElement writeXml( QDomDocument &document, const QgsReadWriteContext &context ) const override;
56  bool readXml( const QDomElement &layoutElement, const QDomDocument &document, const QgsReadWriteContext &context ) override;
57 
58  // QgsLayoutInterface
59  QDomElement writeLayoutXml( QDomDocument &document, const QgsReadWriteContext &context ) const override;
60  bool readLayoutXml( const QDomElement &layoutElement, const QDomDocument &document, const QgsReadWriteContext &context ) override;
62  void updateSettings() override;
63 
64  bool layoutAccept( QgsStyleEntityVisitorInterface *visitor ) const override;
65 
66  signals:
67 
72  void nameChanged( const QString &name );
73 
74  private:
75 
76  QString mName;
77  QgsLayoutAtlas *mAtlas = nullptr;
78 
79  QgsPrintLayout( const QgsPrintLayout & ) = delete;
80  QgsPrintLayout &operator=( const QgsPrintLayout & ) = delete;
81 };
82 
83 #endif //QGSPRINTLAYOUT_H
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition: qgsexpressioncontext.h:369
QgsReadWriteContext
Definition: qgsreadwritecontext.h:34
QgsStyleEntityVisitorInterface
Definition: qgsstyleentityvisitor.h:33
QgsMasterLayoutInterface::writeLayoutXml
virtual QDomElement writeLayoutXml(QDomDocument &document, const QgsReadWriteContext &context) const =0
Returns the layout's state encapsulated in a DOM element.
QgsMasterLayoutInterface::readLayoutXml
virtual bool readLayoutXml(const QDomElement &layoutElement, const QDomDocument &document, const QgsReadWriteContext &context)=0
Sets the layout's state from a DOM element.
QgsLayout::createExpressionContext
QgsExpressionContext createExpressionContext() const override
Creates an expression context relating to the layout's current state.
Definition: qgslayout.cpp:394
QgsProject
Definition: qgsproject.h:92
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
QgsLayout::clone
QgsLayout * clone() const
Creates a clone of the layout.
Definition: qgslayout.cpp:82
QgsMasterLayoutInterface::setName
virtual void setName(const QString &name)=0
Sets the layout's name.
QgsPrintLayout
Print layout, a QgsLayout subclass for static or atlas-based layouts.
Definition: qgsprintlayout.h:30
QgsMasterLayoutInterface::layoutAccept
virtual bool layoutAccept(QgsStyleEntityVisitorInterface *visitor) const
Accepts the specified style entity visitor, causing it to visit all style entities associated with th...
Definition: qgsmasterlayoutinterface.h:134
QgsLayout::readXml
virtual bool readXml(const QDomElement &layoutElement, const QDomDocument &document, const QgsReadWriteContext &context)
Sets the collection's state from a DOM element.
Definition: qgslayout.cpp:948
QgsMasterLayoutInterface::Type
Type
Master layout type.
Definition: qgsmasterlayoutinterface.h:66
qgslayout.h
QgsLayout::writeXml
virtual QDomElement writeXml(QDomDocument &document, const QgsReadWriteContext &context) const
Returns the layout's state encapsulated in a DOM element.
Definition: qgslayout.cpp:822
QgsLayout
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition: qgslayout.h:49
QgsMasterLayoutInterface
Interface for master layout type objects, such as print layouts and reports.
Definition: qgsmasterlayoutinterface.h:42
QgsMasterLayoutInterface::updateSettings
virtual void updateSettings()=0
Refreshes the layout when global layout related options change.
QgsLayoutAtlas
Definition: qgslayoutatlas.h:41