File indexing completed on 2024-05-12 05:02:07

0001 /*
0002    SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QAbstractListModel>
0010 
0011 #include "libruqolacore_export.h"
0012 #include "moderation/moderationreportinfos.h"
0013 #include <QVector>
0014 
0015 class LIBRUQOLACORE_EXPORT ModerationReportInfoModel : public QAbstractListModel
0016 {
0017     Q_OBJECT
0018 public:
0019     enum ModerationReportInfoRoles {
0020         Message = Qt::UserRole + 1,
0021         ReportIdentifier,
0022         ReportUserName,
0023         DateTime,
0024     };
0025     Q_ENUM(ModerationReportInfoRoles)
0026 
0027     explicit ModerationReportInfoModel(QObject *parent = nullptr);
0028     ~ModerationReportInfoModel() override;
0029 
0030     [[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
0031     [[nodiscard]] QVariant data(const QModelIndex &index, int role) const override;
0032 
0033     void clear();
0034 
0035     void addModerationReportInfos(const ModerationReportInfos &infos);
0036 
0037 private:
0038     ModerationReportInfos mModerationReportInfos;
0039 };