File indexing completed on 2024-12-08 04:33:20

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 "libruqolacore_export.h"
0010 #include "moderationreportinfo.h"
0011 #include <QDebug>
0012 #include <QString>
0013 #include <QVector>
0014 
0015 class LIBRUQOLACORE_EXPORT ModerationReportInfos
0016 {
0017 public:
0018     ModerationReportInfos();
0019 
0020     void clear();
0021 
0022     [[nodiscard]] int offset() const;
0023     void setOffset(int newOffset);
0024 
0025     [[nodiscard]] int total() const;
0026     void setTotal(int newTotal);
0027 
0028     [[nodiscard]] int moderationReportInfosCount() const;
0029     void setModerationReportInfosCount(int newModerationReportInfosCount);
0030 
0031     [[nodiscard]] const QVector<ModerationReportInfo> &moderationReportInfosList() const;
0032     void setModerationReportInfosList(const QVector<ModerationReportInfo> &newModerationReportInfosList);
0033 
0034     [[nodiscard]] bool isEmpty() const;
0035     [[nodiscard]] int count() const;
0036     [[nodiscard]] ModerationReportInfo at(int index) const;
0037 
0038     void parseModerationReportInfos(const QJsonObject &moderationReportInfosObj);
0039     void parseMoreModerationReportInfos(const QJsonObject &moderationReportInfosObj);
0040 
0041     ModerationReportInfo takeAt(int index);
0042 
0043 private:
0044     LIBRUQOLACORE_NO_EXPORT void parseModerationReportInfosObj(const QJsonObject &moderationReportInfosObj);
0045     QVector<ModerationReportInfo> mModerationReportInfosList;
0046     int mModerationReportInfosCount = 0;
0047     int mOffset = 0;
0048     int mTotal = 0;
0049 };
0050 Q_DECLARE_METATYPE(ModerationReportInfos)
0051 LIBRUQOLACORE_EXPORT QDebug operator<<(QDebug d, const ModerationReportInfos &t);