KTextAddons

emojiproxymodel.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 <QSortFilterProxyModel>
10#include <memory>
11namespace TextEmoticonsCore
12{
13/**
14 * @brief The EmojiProxyModel class
15 * @author Laurent Montel <montel@kde.org>
16 */
17class TEXTEMOTICONSCORE_EXPORT EmojiProxyModel : public QSortFilterProxyModel
18{
19 Q_OBJECT
20
21 Q_PROPERTY(QString category READ category WRITE setCategory NOTIFY categoryChanged)
22
23public:
24 explicit EmojiProxyModel(QObject *parent = nullptr);
25 ~EmojiProxyModel() override;
26 [[nodiscard]] QString category() const;
27 void setCategory(const QString &newCategories);
28
29 [[nodiscard]] QStringList recentEmoticons() const;
30 void setRecentEmoticons(const QStringList &newRecentEmoticons);
31
32 [[nodiscard]] QString searchIdentifier() const;
33 void setSearchIdentifier(const QString &newSearchIdentifier);
34
35Q_SIGNALS:
36 void categoryChanged();
37
38protected:
39 [[nodiscard]] bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
40 [[nodiscard]] bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
41
42private:
43 class EmojiProxyModelPrivate;
44 std::unique_ptr<EmojiProxyModelPrivate> const d;
45};
46}
The EmojiProxyModel 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.