KTextAddons

emojimodelmanager.h
1/*
2 SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6#pragma once
7
8#include "textemoticonscore_export.h"
9#include <QObject>
10#include <memory>
11namespace TextEmoticonsCore
12{
13class EmojiModel;
14class CustomEmojiIconManager;
15/**
16 * @brief The EmojiModelManager class
17 * @author Laurent Montel <montel@kde.org>
18 */
19class TEXTEMOTICONSCORE_EXPORT EmojiModelManager : public QObject
20{
21 Q_OBJECT
22
23 Q_PROPERTY(TextEmoticonsCore::EmojiModel *emojiModel READ emojiModel CONSTANT)
24 Q_PROPERTY(QStringList recentIdentifier READ recentIdentifier NOTIFY usedIdentifierChanged)
25
26public:
27 static EmojiModelManager *self();
28 [[nodiscard]] TextEmoticonsCore::EmojiModel *emojiModel() const;
29
30 /**
31 * @brief Set the settings group name used to store the recent identifiers.
32 * @note If not set, the group name is "EmoticonRecentUsed".
33 */
34 void setRecentSettingsGroupName(const QString &key);
35
36 [[nodiscard]] const QStringList &recentIdentifier() const;
37 void setRecentIdentifier(const QStringList &newRecentIdentifier);
38 Q_INVOKABLE void addIdentifier(const QString &identifier);
39
40 [[nodiscard]] TextEmoticonsCore::CustomEmojiIconManager *customEmojiIconManager() const;
41 void setCustomEmojiIconManager(TextEmoticonsCore::CustomEmojiIconManager *newCustomEmojiIconManager);
42
43 [[nodiscard]] QStringList excludeEmoticons() const;
44 void setExcludeEmoticons(const QStringList &emoticons);
45
46Q_SIGNALS:
47 void usedIdentifierChanged(const QStringList &lst);
48 void excludeEmoticonsChanged();
49
50protected:
51 explicit EmojiModelManager(QObject *parent = nullptr);
52 ~EmojiModelManager() override;
53
54private:
55 class EmojiModelManagerPrivate;
56 std::unique_ptr<EmojiModelManagerPrivate> const d;
57};
58}
The EmojiModelManager class.
The EmojiModel class.
Definition emojimodel.h:21
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:48:29 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.