KTextAddons

emoticonlistview.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 "textemoticonswidgets_private_export.h"
9#include <QListView>
10namespace TextEmoticonsWidgets
11{
12class TEXTEMOTICONSWIDGETS_TESTS_EXPORT EmoticonListView : public QListView
13{
14 Q_OBJECT
15public:
16 explicit EmoticonListView(QWidget *parent = nullptr);
17 ~EmoticonListView() override;
18
19 void setFontSize(int newFontSize);
20
21 [[nodiscard]] bool isRecentView() const;
22 void setIsRecentView(bool newIsRecentView);
23
24Q_SIGNALS:
25 void emojiItemSelected(const QString &str, const QString &identifier);
26 void fontSizeChanged(int size);
27 void clearHistory();
28
29protected:
30 void keyPressEvent(QKeyEvent *event) override;
31 void wheelEvent(QWheelEvent *e) override;
32 void contextMenuEvent(QContextMenuEvent *event) override;
33
34private:
35 TEXTEMOTICONSWIDGETS_NO_EXPORT void applyFontSize();
36 TEXTEMOTICONSWIDGETS_NO_EXPORT void selectEmoji(const QModelIndex &index);
37 int mFontSize = 18;
38 int mRowSize = 0;
39 bool mIsRecentView = false;
40};
41}
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.