KTextAddons

emojiproxymodel.h
1/*
2 SPDX-FileCopyrightText: 2021-2025 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{
20
21 Q_PROPERTY(QString category READ category WRITE setCategory NOTIFY categoryChanged)
22 Q_PROPERTY(QStringList recentEmoticons READ recentEmoticons WRITE setRecentEmoticons NOTIFY recentEmoticonsChanged)
23
24public:
25 explicit EmojiProxyModel(QObject *parent = nullptr);
26 ~EmojiProxyModel() override;
27 [[nodiscard]] QString category() const;
28 void setCategory(const QString &newCategories);
29
30 [[nodiscard]] QStringList recentEmoticons() const;
31 void setRecentEmoticons(const QStringList &newRecentEmoticons);
32
33 [[nodiscard]] QString searchIdentifier() const;
34 void setSearchIdentifier(const QString &newSearchIdentifier);
35
37 void categoryChanged();
38 void recentEmoticonsChanged();
39
40protected:
41 [[nodiscard]] bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
42 [[nodiscard]] bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
43
44private:
45 class EmojiProxyModelPrivate;
46 std::unique_ptr<EmojiProxyModelPrivate> const d;
47};
48}
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
QSortFilterProxyModel(QObject *parent)
virtual QModelIndex parent(const QModelIndex &child) const const override
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:49:24 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.