QGIS API Documentation  3.4.15-Madeira (e83d02e274)
qgsreportsectionlayout.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsreportsectionlayout.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 QGSREPORTSECTIONLAYOUT_H
17 #define QGSREPORTSECTIONLAYOUT_H
18 
19 #include "qgis_core.h"
21 
23 
24 // This is not considered stable API - it is exposed to python bindings only for unit testing!
25 
34 class CORE_EXPORT QgsReportSectionLayout : public QgsAbstractReportSection
35 {
36  public:
37 
42  QgsReportSectionLayout( QgsAbstractReportSection *parentSection = nullptr );
43 
44  QString type() const override { return QStringLiteral( "SectionLayout" ); }
45  QString description() const override { return QObject::tr( "Section" ); }
46  QIcon icon() const override;
47 
54  QgsLayout *body() { return mBody.get(); }
55 
63  void setBody( QgsLayout *body SIP_TRANSFER ) { mBody.reset( body ); }
64 
71  bool bodyEnabled() const { return mBodyEnabled; }
72 
79  void setBodyEnabled( bool enabled ) { mBodyEnabled = enabled; }
80 
81  QgsReportSectionLayout *clone() const override SIP_FACTORY;
82  bool beginRender() override;
83  QgsLayout *nextBody( bool &ok ) override;
84  void reloadSettings() override;
85 
86  protected:
87 
88  bool writePropertiesToElement( QDomElement &element, QDomDocument &document, const QgsReadWriteContext &context ) const override;
89  bool readPropertiesFromElement( const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context ) override;
90 
91  private:
92 
93  bool mExportedBody = false;
94  std::unique_ptr< QgsLayout > mBody;
95  bool mBodyEnabled = true;
96 };
97 
99 
100 #endif //QGSREPORTSECTIONLAYOUT_H
The class is used as a container of context for various read/write operations on other objects...
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
Definition: qgsgeos.h:79
#define SIP_TRANSFER
Definition: qgis_sip.h:36
#define SIP_FACTORY
Definition: qgis_sip.h:69
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition: qgslayout.h:49