KTextAddons

emoticontexteditselector.h
1/*
2 SPDX-FileCopyrightText: 2012-2024 Laurent Montel <montel@kde.org>
3 based on code from kopete
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#pragma once
9
10#include "textemoticonswidgets_export.h"
11#include <QWidget>
12namespace TextEmoticonsCore
13{
14}
15namespace TextEmoticonsWidgets
16{
17/**
18 * @brief The EmoticonTextEditSelector class
19 *
20 * @short A widget to select emojis.
21 *
22 * @image html emoticontexteditselector.png "EmoticonTextEditSelector"
23 *
24 * @author Laurent Montel <montel@kde.org>
25 */
26class TEXTEMOTICONSWIDGETS_EXPORT EmoticonTextEditSelector : public QWidget
27{
28 Q_OBJECT
29public:
30 explicit EmoticonTextEditSelector(QWidget *parent = nullptr);
32
33 /**
34 * Focus the line edit for search.
35 */
36 void forceLineEditFocus();
37
38 /**
39 * Set whether the custom emoji category should be shown.
40 * @see customEmojiSupport()
41 */
42 void setCustomEmojiSupport(bool b);
43 /**
44 * Return whether the custom emoji category is enabled.
45 * @see setCustomEmojiSupport()
46 */
47 [[nodiscard]] bool customEmojiSupport() const;
48
49public Q_SLOTS:
50 /**
51 * Do all the magic of creating an TextEmoticonsCore::UnicodeEmoticonManager and loading the categories and emojis to the widget.
52 */
53 void loadEmoticons();
54
55Q_SIGNALS:
56 /**
57 * This signal is emitted each time the user selects an emoji.
58 *
59 * @param character The actual emoji character
60 * @see insertEmojiIdentifier
61 */
62 void insertEmoji(const QString &character);
63 /**
64 * This signal is emitted each time the user selects an emoji.
65 *
66 * @brief insertEmojiIdentifier
67 * @param identifier The identifier of the emoji like eg. ":face_with_raised_eyebrow:"
68 * @see insertEmoji
69 */
70 void insertEmojiIdentifier(const QString &identifier);
71
72private:
73 class EmoticonTextEditSelectorPrivate;
74 std::unique_ptr<EmoticonTextEditSelectorPrivate> const d;
75};
76}
void insertEmoji(const QString &character)
This signal is emitted each time the user selects an emoji.
void insertEmojiIdentifier(const QString &identifier)
This signal is emitted each time the user selects an emoji.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:29:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.