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 "moderationinfo.h"
0011 #include <QDebug>
0012 #include <QString>
0013 #include <QVector>
0014 
0015 class LIBRUQOLACORE_EXPORT ModerationInfos
0016 {
0017 public:
0018     ModerationInfos();
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 moderationInfosCount() const;
0029     void setModerationInfosCount(int newModerationInfosCount);
0030 
0031     [[nodiscard]] const QVector<ModerationInfo> &moderationInfosList() const;
0032     void setModerationInfosList(const QVector<ModerationInfo> &newModerationInfosList);
0033 
0034     [[nodiscard]] bool isEmpty() const;
0035     [[nodiscard]] int count() const;
0036     [[nodiscard]] ModerationInfo at(int index) const;
0037 
0038     void parseModerationInfos(const QJsonObject &moderationInfosObj);
0039     void parseMoreModerationInfos(const QJsonObject &moderationInfosObj);
0040 
0041     ModerationInfo takeAt(int index);
0042 
0043 private:
0044     LIBRUQOLACORE_NO_EXPORT void parseModerationInfosObj(const QJsonObject &moderationInfosObj);
0045     QVector<ModerationInfo> mModerationInfosList;
0046     int mModerationInfosCount = 0;
0047     int mOffset = 0;
0048     int mTotal = 0;
0049 };
0050 Q_DECLARE_METATYPE(ModerationInfos)
0051 LIBRUQOLACORE_EXPORT QDebug operator<<(QDebug d, const ModerationInfos &t);