File indexing completed on 2024-12-15 03:45:00

0001 /*
0002     SPDX-FileCopyrightText: 2017 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: MIT
0005 */
0006 
0007 #ifndef KUSERFEEDBACK_CONSOLE_AGGREGATIONELEMENTEDITMODEL_H
0008 #define KUSERFEEDBACK_CONSOLE_AGGREGATIONELEMENTEDITMODEL_H
0009 
0010 #include <core/aggregation.h>
0011 
0012 #include <QAbstractListModel>
0013 
0014 namespace KUserFeedback {
0015 namespace Console {
0016 
0017 class AggregationElementEditModel : public QAbstractListModel
0018 {
0019     Q_OBJECT
0020 public:
0021     explicit AggregationElementEditModel(QObject *parent = nullptr);
0022     ~AggregationElementEditModel() override;
0023 
0024     Aggregation aggregation() const;
0025     void setAggregation(const Aggregation &aggregation);
0026 
0027     int rowCount(const QModelIndex & parent) const override;
0028     QVariant data(const QModelIndex & index, int role) const override;
0029     QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
0030     Qt::ItemFlags flags(const QModelIndex & index) const override;
0031     bool setData(const QModelIndex & index, const QVariant & value, int role) override;
0032 
0033 private:
0034     Aggregation m_aggr;
0035 };
0036 
0037 }}
0038 
0039 #endif // KUSERFEEDBACK_CONSOLE_AGGREGATIONELEMENTEDITMODEL_H