QGIS API Documentation  3.4.15-Madeira (e83d02e274)
qgsreport.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsreport.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 QGSREPORT_H
17 #define QGSREPORT_H
18 
19 #include "qgis_core.h"
22 
24 
25 // This is not considered stable API - it is exposed to python bindings only for unit testing!
26 
40 class CORE_EXPORT QgsReport : public QObject, public QgsAbstractReportSection, public QgsMasterLayoutInterface
41 {
42 
43  Q_OBJECT
44 
45  public:
46 
53  QgsReport( QgsProject *project );
54 
56  QString type() const override { return QStringLiteral( "SectionReport" ); }
57  QString description() const override { return QObject::tr( "Report" ); }
58  QIcon icon() const override;
59  QgsProject *layoutProject() const override { return mProject; }
60  QgsReport *clone() const override SIP_FACTORY;
61  QString name() const override { return mName; }
62  void setName( const QString &name ) override;
63  QDomElement writeLayoutXml( QDomDocument &document, const QgsReadWriteContext &context ) const override;
64  bool readLayoutXml( const QDomElement &layoutElement, const QDomDocument &document, const QgsReadWriteContext &context ) override;
65  void updateSettings() override;
66 
67  signals:
68 
73  void nameChanged( const QString &name );
74 
75  private:
76 
77  QgsProject *mProject = nullptr;
78  QString mName;
79 
80 };
81 
83 
84 #endif //QGSREPORT_H
The class is used as a container of context for various read/write operations on other objects...
virtual QgsMasterLayoutInterface * clone() const =0
Creates a clone of the layout.
virtual QgsProject * layoutProject() const =0
The project associated with the layout.
virtual QIcon icon() const =0
Returns an icon for the layout.
virtual void setName(const QString &name)=0
Sets the layout's name.
virtual QDomElement writeLayoutXml(QDomDocument &document, const QgsReadWriteContext &context) const =0
Returns the layout's state encapsulated in a DOM element.
virtual bool readLayoutXml(const QDomElement &layoutElement, const QDomDocument &document, const QgsReadWriteContext &context)=0
Sets the layout's state from a DOM element.
virtual QgsMasterLayoutInterface::Type layoutType() const =0
Returns the master layout type.
Reads and writes project states.
Definition: qgsproject.h:89
#define SIP_FACTORY
Definition: qgis_sip.h:69
virtual void updateSettings()=0
Refreshes the layout when global layout related options change.
Interface for master layout type objects, such as print layouts and reports.