File indexing completed on 2024-12-01 04:36:54
0001 /* 0002 SPDX-FileCopyrightText: 2022-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 #pragma once 0007 0008 #include "libruqolawidgets_private_export.h" 0009 #include "misc/messagelistviewbase.h" 0010 class NotificationHistoryDelegate; 0011 0012 class LIBRUQOLAWIDGETS_TESTS_EXPORT NotificationHistoryListView : public MessageListViewBase 0013 { 0014 Q_OBJECT 0015 public: 0016 explicit NotificationHistoryListView(QWidget *parent = nullptr); 0017 ~NotificationHistoryListView() override; 0018 0019 void clearCache(); 0020 0021 void slotSelectAll(const QModelIndex &index); 0022 0023 [[nodiscard]] const QString &searchText() const; 0024 void setSearchText(const QString &newSearchText); 0025 0026 [[nodiscard]] QString selectedText() const; 0027 0028 protected: 0029 [[nodiscard]] bool maybeStartDrag(QMouseEvent *event, const QStyleOptionViewItem &option, const QModelIndex &index) override; 0030 [[nodiscard]] bool mouseEvent(QMouseEvent *event, const QStyleOptionViewItem &option, const QModelIndex &index) override; 0031 0032 Q_SIGNALS: 0033 void showMessage(const QModelIndex &index); 0034 0035 private: 0036 [[nodiscard]] LIBRUQOLAWIDGETS_NO_EXPORT QString selectedText(const QModelIndex &index) override; 0037 LIBRUQOLAWIDGETS_NO_EXPORT void slotTextToSpeech(const QModelIndex &index); 0038 LIBRUQOLAWIDGETS_NO_EXPORT void slotCustomContextMenuRequested(const QPoint &pos); 0039 LIBRUQOLAWIDGETS_NO_EXPORT void slotClearList(); 0040 NotificationHistoryDelegate *const mListNotificationsDelegate; 0041 };