16 #ifndef QGSREPORTSECTIONFIELDGROUP_H
17 #define QGSREPORTSECTIONFIELDGROUP_H
19 #include "qgis_core.h"
38 class CORE_EXPORT QgsReportSectionFieldGroup :
public QgsAbstractReportSection
45 enum SectionVisibility
47 IncludeWhenFeaturesFound,
55 QgsReportSectionFieldGroup( QgsAbstractReportSection *parentSection =
nullptr );
57 QString type()
const override {
return QStringLiteral(
"SectionFieldGroup" ); }
58 QString description()
const override;
59 QIcon icon()
const override;
84 bool bodyEnabled()
const {
return mBodyEnabled; }
92 void setBodyEnabled(
bool enabled ) { mBodyEnabled = enabled; }
105 void setLayer(
QgsVectorLayer *layer ) { mCoverageLayer = layer; }
111 QString field()
const {
return mField; }
117 void setField(
const QString &field ) { mField = field; }
124 bool sortAscending()
const;
131 void setSortAscending(
bool sortAscending );
137 SectionVisibility headerVisibility()
const {
return mHeaderVisibility; }
143 void setHeaderVisibility( SectionVisibility visibility ) { mHeaderVisibility = visibility; }
149 SectionVisibility footerVisibility()
const {
return mFooterVisibility; }
155 void setFooterVisibility( SectionVisibility visibility ) { mFooterVisibility = visibility; }
157 QgsReportSectionFieldGroup *clone() const override
SIP_FACTORY;
158 bool beginRender() override;
159 bool prepareHeader() override;
160 bool prepareFooter() override;
161 QgsLayout *nextBody(
bool &ok ) override;
162 void reset() override;
163 void setParentSection( QgsAbstractReportSection *parentSection ) override;
164 void reloadSettings() override;
168 bool writePropertiesToElement( QDomElement &element, QDomDocument &document, const
QgsReadWriteContext &context ) const override;
169 bool readPropertiesFromElement( const QDomElement &element, const QDomDocument &document, const
QgsReadWriteContext &context ) override;
175 bool mSortAscending = true;
176 int mFieldIndex = -1;
178 bool mSkipNextRequest = false;
179 bool mNoFeatures = false;
180 SectionVisibility mHeaderVisibility = IncludeWhenFeaturesFound;
181 SectionVisibility mFooterVisibility = IncludeWhenFeaturesFound;
184 QSet< QVariant > mEncounteredValues;
186 bool mBodyEnabled = false;
192 void updateChildContexts( const
QgsFeature &feature );
199 #endif //QGSREPORTSECTIONFIELDGROUP_H