KTextAddons

unicodeemoticon.h
1/*
2 SPDX-FileCopyrightText: 2018-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "textemoticonscore_export.h"
10#include <QDebug>
11#include <QString>
12namespace TextEmoticonsCore
13{
14/**
15 * @brief The UnicodeEmoticon class
16 * @author Laurent Montel <montel@kde.org>
17 */
18class TEXTEMOTICONSCORE_EXPORT UnicodeEmoticon
19{
20 Q_GADGET
21public:
23
24 [[nodiscard]] QString identifier() const;
25 void setIdentifier(const QString &identifier);
26
27 [[nodiscard]] QString unicode() const;
28 [[nodiscard]] QString unicodeDisplay() const;
29 void setUnicode(const QString &unicode);
30
31 [[nodiscard]] QString category() const;
32 void setCategory(const QString &category);
33
34 [[nodiscard]] QStringList aliases() const;
35 void setAliases(const QStringList &aliases);
36
37 [[nodiscard]] bool hasEmoji(const QString &identifier) const;
38
39 [[nodiscard]] bool isValid() const;
40
41 [[nodiscard]] int order() const;
42 void setOrder(int order);
43
44 [[nodiscard]] QString key() const;
45 void setKey(const QString &key);
46
47 bool operator==(const UnicodeEmoticon &other) const;
48
49private:
50 [[nodiscard]] TEXTEMOTICONSCORE_NO_EXPORT QString escapeUnicodeEmoji(const QString &pString);
51 QStringList mAliases;
52 QString mIdentifier;
53 QString mUnicode;
54 QString mCategory;
55 QString mKey;
56 mutable QString mCachedHtml;
57 int mOrder = -1;
58};
59}
60Q_DECLARE_METATYPE(TextEmoticonsCore::UnicodeEmoticon)
61Q_DECLARE_TYPEINFO(TextEmoticonsCore::UnicodeEmoticon, Q_MOVABLE_TYPE);
62TEXTEMOTICONSCORE_EXPORT QDebug operator<<(QDebug d, const TextEmoticonsCore::UnicodeEmoticon &t);
The UnicodeEmoticon class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:19:49 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.