File indexing completed on 2024-06-23 04:40:22
0001 /* 0002 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include "textemoticonswidgets_private_export.h" 0010 #include <QWidget> 0011 class QHBoxLayout; 0012 class QButtonGroup; 0013 namespace TextEmoticonsCore 0014 { 0015 class EmoticonCategory; 0016 } 0017 namespace TextEmoticonsWidgets 0018 { 0019 class TEXTEMOTICONSWIDGETS_TESTS_EXPORT EmoticonCategoryButtons : public QWidget 0020 { 0021 Q_OBJECT 0022 public: 0023 explicit EmoticonCategoryButtons(QWidget *parent = nullptr); 0024 ~EmoticonCategoryButtons() override; 0025 0026 void setCategories(const QList<TextEmoticonsCore::EmoticonCategory> &categories, bool hasCustomSupport); 0027 0028 [[nodiscard]] bool wasLoaded() const; 0029 0030 Q_SIGNALS: 0031 void categorySelected(const QString &category); 0032 0033 protected: 0034 void wheelEvent(QWheelEvent *e) override; 0035 0036 private: 0037 void addButton(const QString &name, const QString &category, const QString &toolTip); 0038 QHBoxLayout *const mMainLayout; 0039 QButtonGroup *const mButtonGroup; 0040 bool mWasLoaded = false; 0041 }; 0042 }