File indexing completed on 2024-07-07 14:59:30

0001 /*
0002    SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "customuserstatus.h"
0010 #include "libruqolacore_export.h"
0011 #include <QDebug>
0012 #include <QVector>
0013 
0014 class LIBRUQOLACORE_EXPORT CustomUserStatuses
0015 {
0016 public:
0017     CustomUserStatuses();
0018     ~CustomUserStatuses();
0019 
0020     [[nodiscard]] bool isEmpty() const;
0021     void clear();
0022     [[nodiscard]] int count() const;
0023     [[nodiscard]] CustomUserStatus at(int index) const;
0024 
0025     [[nodiscard]] int offset() const;
0026     void setOffset(int offset);
0027 
0028     [[nodiscard]] int total() const;
0029     void setTotal(int total);
0030 
0031     [[nodiscard]] QVector<CustomUserStatus> customUserses() const;
0032     void setCustomUserses(const QVector<CustomUserStatus> &customUserses);
0033 
0034     void parseCustomUserStatuses(const QJsonObject &customStatusObj);
0035     void deleteCustomUserStatuses(const QJsonArray &replyArray);
0036     void updateCustomUserStatues(const QJsonArray &replyArray);
0037 
0038 private:
0039     LIBRUQOLACORE_NO_EXPORT void parseListCustomUserStatuses(const QJsonObject &commandsObj);
0040     QVector<CustomUserStatus> mCustomUserses;
0041     int mCustomUserCount = 0;
0042     int mOffset = 0;
0043     int mTotal = 0;
0044 };
0045 LIBRUQOLACORE_EXPORT QDebug operator<<(QDebug d, const CustomUserStatuses &t);