KTextAddons

emoticontexteditselector.h
1/*
2 SPDX-FileCopyrightText: 2012-2025 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>
12
13namespace TextEmoticonsWidgets
14{
15/**
16 * @brief The EmoticonTextEditSelector class
17 *
18 * @short A widget to select emojis.
19 *
20 * @image html emoticontexteditselector.png "EmoticonTextEditSelector"
21 *
22 * @author Laurent Montel <montel@kde.org>
23 */
24class TEXTEMOTICONSWIDGETS_EXPORT EmoticonTextEditSelector : public QWidget
25{
27public:
28 explicit EmoticonTextEditSelector(QWidget *parent = nullptr);
29 ~EmoticonTextEditSelector() override;
30
31 /**
32 * Focus the line edit for search.
33 */
34 void forceLineEditFocus();
35
36 /**
37 * Set whether the custom emoji category should be shown.
38 * @see customEmojiSupport()
39 */
40 void setCustomEmojiSupport(bool b);
41 /**
42 * Return whether the custom emoji category is enabled.
43 * @see setCustomEmojiSupport()
44 */
45 [[nodiscard]] bool customEmojiSupport() const;
46
47public Q_SLOTS:
48 /**
49 * Do all the magic of creating an TextEmoticonsCore::UnicodeEmoticonManager and loading the categories and emojis to the widget.
50 */
51 void loadEmoticons();
52
54 /**
55 * This signal is emitted each time the user selects an emoji.
56 *
57 * @param character The actual emoji character
58 * @see insertEmojiIdentifier
59 */
60 void insertEmoji(const QString &character);
61 /**
62 * This signal is emitted each time the user selects an emoji.
63 *
64 * @brief insertEmojiIdentifier
65 * @param identifier The identifier of the emoji like eg. ":face_with_raised_eyebrow:"
66 * @see insertEmoji
67 */
68 void insertEmojiIdentifier(const QString &identifier);
69
70private:
71 class EmoticonTextEditSelectorPrivate;
72 std::unique_ptr<EmoticonTextEditSelectorPrivate> const d;
73};
74}
void forceLineEditFocus()
Focus the line edit for search.
bool customEmojiSupport() const
Return whether the custom emoji category is enabled.
void loadEmoticons()
Do all the magic of creating an TextEmoticonsCore::UnicodeEmoticonManager and loading the categories ...
void setCustomEmojiSupport(bool b)
Set whether the custom emoji category should be shown.
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.
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
Q_SLOTSQ_SLOTS
QObject * parent() const const
QWidget(QWidget *parent, Qt::WindowFlags f)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 28 2025 11:51:55 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.