File indexing completed on 2024-12-01 13:09:01

0001 /*
0002    SPDX-FileCopyrightText: 2018-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "libruqolacore_export.h"
0010 #include <QDebug>
0011 class EmojiManager;
0012 class LIBRUQOLACORE_EXPORT Reaction
0013 {
0014     Q_GADGET
0015 public:
0016     Reaction();
0017 
0018     [[nodiscard]] QString reactionName() const;
0019     void setReactionName(const QString &reactionName, EmojiManager *emojiManager = nullptr);
0020 
0021     [[nodiscard]] QStringList userNames() const;
0022     void setUserNames(const QStringList &userNames);
0023 
0024     [[nodiscard]] int count() const;
0025 
0026     [[nodiscard]] bool operator==(const Reaction &other) const;
0027 
0028     [[nodiscard]] QString convertedReactionName() const;
0029     [[nodiscard]] QString convertedUsersNameAtToolTip() const;
0030 
0031     [[nodiscard]] bool isAnimatedImage() const;
0032     void setIsAnimatedImage(bool isAnimatedImage);
0033 
0034 private:
0035     QString mReactionName;
0036     QString mCacheConvertedReactionName;
0037     QStringList mUserNames;
0038     bool mIsAnimatedImage = false;
0039 };
0040 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
0041 Q_DECLARE_METATYPE(Reaction)
0042 #endif
0043 Q_DECLARE_TYPEINFO(Reaction, Q_MOVABLE_TYPE);
0044 LIBRUQOLACORE_EXPORT QDebug operator<<(QDebug d, const Reaction &t);