16#ifndef QGSABSTRACTREPORTSECTION_H
17#define QGSABSTRACTREPORTSECTION_H
36class CORE_EXPORT QgsReportSectionContext
47 QVariantMap fieldFilters;
62 if (
dynamic_cast< QgsReportSectionFieldGroup *
>( sipCpp ) )
63 sipType = sipType_QgsReportSectionFieldGroup;
64 else if (
dynamic_cast< QgsReportSectionLayout *
>( sipCpp ) )
65 sipType = sipType_QgsReportSectionLayout;
77 QgsAbstractReportSection( QgsAbstractReportSection *parentSection =
nullptr );
79 ~QgsAbstractReportSection()
override;
82 QgsAbstractReportSection(
const QgsAbstractReportSection &other ) =
delete;
85 QgsAbstractReportSection &operator=(
const QgsAbstractReportSection &other ) =
delete;
90 virtual QString type()
const = 0;
95 virtual QString description()
const = 0;
100 virtual QIcon icon()
const = 0;
109 virtual QgsAbstractReportSection *clone()
const = 0
SIP_FACTORY;
114 QgsAbstractReportSection *parentSection() {
return mParent; }
122 int count()
const override {
return -1; }
124 QString filePath(
const QString &baseFilePath,
const QString &extension )
override;
126 bool beginRender()
override;
127 bool next()
override;
128 bool endRender()
override;
133 virtual void reset();
141 virtual bool prepareHeader();
149 virtual bool prepareFooter();
157 virtual QgsLayout *nextBody(
bool &ok
SIP_OUT ) { ok =
false;
return nullptr; }
165 bool headerEnabled()
const {
return mHeaderEnabled; }
173 void setHeaderEnabled(
bool enabled ) { mHeaderEnabled = enabled; }
182 QgsLayout *header() {
return mHeader.get(); }
200 bool footerEnabled()
const {
return mFooterEnabled; }
208 void setFooterEnabled(
bool enabled ) { mFooterEnabled = enabled; }
217 QgsLayout *footer() {
return mFooter.get(); }
234 int childCount()
const {
return mChildren.count(); }
250 QList< QgsAbstractReportSection * > childSections()
const {
return mChildren; }
256 QgsAbstractReportSection *childSection(
int index );
263 void appendChild( QgsAbstractReportSection *section
SIP_TRANSFER );
270 void insertChild(
int index, QgsAbstractReportSection *section
SIP_TRANSFER );
276 void removeChild( QgsAbstractReportSection *section );
282 void removeChildAt(
int index );
288 void setContext(
const QgsReportSectionContext &context );
294 const QgsReportSectionContext &context()
const {
return mContext; }
300 bool writeXml( QDomElement &parentElement, QDomDocument &document,
const QgsReadWriteContext &context )
const;
306 bool readXml(
const QDomElement §ionElement,
const QDomDocument &document,
const QgsReadWriteContext &context );
311 virtual void reloadSettings();
340 void copyCommonProperties( QgsAbstractReportSection *destination )
const;
345 virtual void setParentSection( QgsAbstractReportSection *parent ) { mParent = parent; }
352 virtual bool writePropertiesToElement( QDomElement &element, QDomDocument &document,
const QgsReadWriteContext &context )
const;
359 virtual bool readPropertiesFromElement(
const QDomElement &element,
const QDomDocument &document,
const QgsReadWriteContext &context );
363 QgsAbstractReportSection *mParent =
nullptr;
365 int mSectionNumber = 0;
366 SubSection mNextSection = Header;
370 bool mHeaderEnabled =
false;
371 bool mFooterEnabled =
false;
372 std::unique_ptr< QgsLayout > mHeader;
373 std::unique_ptr< QgsLayout > mFooter;
375 QList< QgsAbstractReportSection * > mChildren;
377 QgsReportSectionContext mContext;
380 QgsAbstractReportSection(
const QgsAbstractReportSection &other );
An abstract base class for QgsLayout based classes which can be exported by QgsLayoutExporter.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
The class is used as a container of context for various read/write operations on other objects.
An interface for classes which can visit style entity (e.g.
Represents a vector layer which manages a vector based data sets.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)