File indexing completed on 2024-12-08 04:34:35

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 "libruqolawidgets_private_export.h"
0010 #include "misc/messagelistviewbase.h"
0011 class ServerErrorInfoHistoryDelegate;
0012 class LIBRUQOLAWIDGETS_TESTS_EXPORT ServerErrorInfoMessageHistoryListView : public MessageListViewBase
0013 {
0014     Q_OBJECT
0015 public:
0016     explicit ServerErrorInfoMessageHistoryListView(QWidget *parent = nullptr);
0017     ~ServerErrorInfoMessageHistoryListView() 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 private:
0033     LIBRUQOLAWIDGETS_NO_EXPORT void slotTextToSpeech(const QModelIndex &index);
0034     LIBRUQOLAWIDGETS_NO_EXPORT void slotCustomContextMenuRequested(const QPoint &pos);
0035     LIBRUQOLAWIDGETS_NO_EXPORT void slotClearList();
0036     [[nodiscard]] LIBRUQOLAWIDGETS_NO_EXPORT QString selectedText(const QModelIndex &index) override;
0037     ServerErrorInfoHistoryDelegate *const mListServerErrorInfosDelegate;
0038 };