File indexing completed on 2024-12-22 04:45:37
0001 /* 0002 SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.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 ModerationReportInfoDelegate; 0011 class RocketChatAccount; 0012 0013 class LIBRUQOLAWIDGETS_TESTS_EXPORT ModerationReportInfoListView : public MessageListViewBase 0014 { 0015 Q_OBJECT 0016 public: 0017 explicit ModerationReportInfoListView(RocketChatAccount *account, QWidget *parent = nullptr); 0018 ~ModerationReportInfoListView() override; 0019 0020 void clearCache(); 0021 0022 void slotSelectAll(const QModelIndex &index); 0023 0024 [[nodiscard]] const QString &searchText() const; 0025 void setSearchText(const QString &newSearchText); 0026 0027 [[nodiscard]] QString selectedText() const; 0028 0029 protected: 0030 [[nodiscard]] bool maybeStartDrag(QMouseEvent *event, const QStyleOptionViewItem &option, const QModelIndex &index) override; 0031 [[nodiscard]] bool mouseEvent(QMouseEvent *event, const QStyleOptionViewItem &option, const QModelIndex &index) override; 0032 0033 private: 0034 [[nodiscard]] LIBRUQOLAWIDGETS_NO_EXPORT QString selectedText(const QModelIndex &index) override; 0035 LIBRUQOLAWIDGETS_NO_EXPORT void slotTextToSpeech(const QModelIndex &index); 0036 LIBRUQOLAWIDGETS_NO_EXPORT void slotCustomContextMenuRequested(const QPoint &pos); 0037 ModerationReportInfoDelegate *const mModerationReportInfoDelegate; 0038 };