16 #ifndef QGSLAYOUTMANAGER_H
17 #define QGSLAYOUTMANAGER_H
19 #include "qgis_core.h"
23 #include <QAbstractListModel>
24 #include <QSortFilterProxyModel>
87 QList< QgsMasterLayoutInterface * > layouts()
const;
92 QList< QgsPrintLayout * > printLayouts()
const;
105 bool readXml(
const QDomElement &element,
const QDomDocument &doc );
111 QDomElement writeXml( QDomDocument &doc )
const;
140 void layoutAboutToBeAdded(
const QString &name );
143 void layoutAdded(
const QString &name );
146 void layoutRemoved(
const QString &name );
149 void layoutAboutToBeRemoved(
const QString &name );
158 QList< QgsMasterLayoutInterface * > mLayouts;
181 LayoutRole = Qt::UserRole + 1,
189 int rowCount(
const QModelIndex &parent )
const override;
190 QVariant data(
const QModelIndex &index,
int role )
const override;
191 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
192 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
210 void setAllowEmptyLayout(
bool allowEmpty );
219 void layoutAboutToBeAdded(
const QString &name );
220 void layoutAboutToBeRemoved(
const QString &name );
221 void layoutAdded(
const QString &name );
222 void layoutRemoved(
const QString &name );
226 bool mAllowEmpty =
false;
247 FilterPrintLayouts = 1 << 1,
248 FilterReports = 1 << 2,
250 Q_DECLARE_FLAGS( Filters, Filter )
257 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
258 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
265 QgsLayoutManagerProxyModel::Filters filters()
const;
272 void setFilters( QgsLayoutManagerProxyModel::Filters filters );
291 void setFilterString(
const QString &filter );
295 Filters mFilters = Filters( FilterPrintLayouts | FilterReports );
297 QString mFilterString;
302 #endif // QGSLAYOUTMANAGER_H