File indexing completed on 2024-12-08 04:34:20
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 RocketChatAccount; 0011 class ListDiscussionDelegate; 0012 class LIBRUQOLAWIDGETS_TESTS_EXPORT DiscussionListView : public MessageListViewBase 0013 { 0014 Q_OBJECT 0015 public: 0016 explicit DiscussionListView(RocketChatAccount *account, QWidget *parent = nullptr); 0017 ~DiscussionListView() override; 0018 0019 void setSearchText(const QString &str); 0020 0021 protected: 0022 [[nodiscard]] bool maybeStartDrag(QMouseEvent *event, const QStyleOptionViewItem &option, const QModelIndex &index) override; 0023 [[nodiscard]] bool mouseEvent(QMouseEvent *event, const QStyleOptionViewItem &option, const QModelIndex &index) override; 0024 0025 private: 0026 LIBRUQOLAWIDGETS_NO_EXPORT void slotOpenDiscussion(const QString &roomDiscussionId); 0027 LIBRUQOLAWIDGETS_NO_EXPORT void slotCustomContextMenuRequested(const QPoint &pos); 0028 LIBRUQOLAWIDGETS_NO_EXPORT void slotTextToSpeech(const QModelIndex &index); 0029 LIBRUQOLAWIDGETS_NO_EXPORT void slotSelectAll(const QModelIndex &index); 0030 ListDiscussionDelegate *const mListDiscussionDelegate; 0031 RocketChatAccount *const mRocketChatAccount; 0032 };