File indexing completed on 2024-10-06 12:54:19
0001 /* 0002 SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "customemoji.h" 0010 #include "libruqolacore_export.h" 0011 #include <QDebug> 0012 #include <QVector> 0013 class LIBRUQOLACORE_EXPORT CustomEmojisInfo 0014 { 0015 public: 0016 CustomEmojisInfo(); 0017 0018 [[nodiscard]] bool isEmpty() const; 0019 void clear(); 0020 [[nodiscard]] int count() const; 0021 [[nodiscard]] CustomEmoji at(int index) const; 0022 0023 [[nodiscard]] int offset() const; 0024 void setOffset(int offset); 0025 0026 [[nodiscard]] int total() const; 0027 void setTotal(int total); 0028 0029 void parseCustomEmojis(const QJsonObject &obj); 0030 void parseMoreCustomEmojis(const QJsonObject &obj); 0031 0032 [[nodiscard]] int roomsCount() const; 0033 void setRoomsCount(int adminroomsCount); 0034 0035 const QVector<CustomEmoji> &customSoundInfos() const; 0036 void setCustomSoundInfos(const QVector<CustomEmoji> &newCustomSoundInfos); 0037 0038 CustomEmoji takeAt(int index); 0039 0040 private: 0041 LIBRUQOLACORE_NO_EXPORT void parseListCustomEmoji(const QJsonObject &obj); 0042 QVector<CustomEmoji> mCustomEmojiInfos; 0043 int mRoomsCount = 0; 0044 int mOffset = 0; 0045 int mTotal = 0; 0046 }; 0047 0048 Q_DECLARE_METATYPE(CustomEmojisInfo) 0049 LIBRUQOLACORE_EXPORT QDebug operator<<(QDebug d, const CustomEmojisInfo &t);