Warning, file /office/calligra/gemini/TemplatesModel.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE project
0002  * SPDX-FileCopyrightText: 2014 Dan Leinir Turthra Jensen <admin@leinir.dk>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef TEMPLATESMODEL_H
0008 #define TEMPLATESMODEL_H
0009 
0010 #include <QAbstractListModel>
0011 
0012 class TemplatesModel : public QAbstractListModel
0013 {
0014     Q_OBJECT
0015     Q_PROPERTY(QString templateType READ templateType WRITE setTemplateType NOTIFY templateTypeChanged)
0016     Q_PROPERTY(bool showWide READ showWide WRITE setShowWide NOTIFY showWideChanged)
0017 public:
0018     enum TemplateRoles {
0019         TitleRole = Qt::UserRole + 1,
0020         DescriptionRole,
0021         ColorRole,
0022         ThumbnailRole,
0023         UrlRole,
0024         VariantCountRole,
0025         VariantsRole
0026     };
0027     explicit TemplatesModel(QObject* parent = 0);
0028     ~TemplatesModel() override;
0029 
0030     QHash<int, QByteArray> roleNames() const override;
0031     QVariant data(const QModelIndex& index, int role) const override;
0032     int rowCount(const QModelIndex& parent) const override;
0033 
0034     QString templateType() const;
0035     void setTemplateType(const QString& newType);
0036 
0037     bool showWide() const;
0038     void setShowWide(const bool& newValue);
0039 
0040 Q_SIGNALS:
0041     void templateTypeChanged();
0042     void showWideChanged();
0043 
0044 private:
0045     class Private;
0046     Private* d;
0047 };
0048 
0049 #endif // TEMPLATESMODEL_H