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

0001 /*
0002    SPDX-FileCopyrightText: 2020-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "channellistview.h"
0010 #include "libruqolawidgets_private_export.h"
0011 #include "parsemessageurlutils.h"
0012 #include "room.h"
0013 #include <QPointer>
0014 #include <QWidget>
0015 class ChannelListView;
0016 class QLineEdit;
0017 class RocketChatAccount;
0018 class LIBRUQOLAWIDGETS_TESTS_EXPORT ChannelListWidget : public QWidget
0019 {
0020     Q_OBJECT
0021 public:
0022     explicit ChannelListWidget(QWidget *parent = nullptr);
0023     ~ChannelListWidget() override;
0024 
0025     ChannelListView *channelListView() const;
0026 
0027     void setCurrentRocketChatAccount(RocketChatAccount *account);
0028 
0029     void setLayoutSpacing(int spacing);
0030 
0031 Q_SIGNALS:
0032     void roomSelected(const ChannelListView::ChannelSelectedInfo &roomInfo);
0033     void roomPressed(const QString &roomId);
0034     void selectMessageIdRequested(const QString &messageId);
0035 
0036 protected:
0037     bool eventFilter(QObject *object, QEvent *event) override;
0038 
0039 private:
0040     LIBRUQOLAWIDGETS_NO_EXPORT void slotAccountInitialized();
0041     LIBRUQOLAWIDGETS_NO_EXPORT void slotSearchRoomTextChanged();
0042     LIBRUQOLAWIDGETS_NO_EXPORT void clearFilterChannel();
0043     LIBRUQOLAWIDGETS_NO_EXPORT void slotOpenLinkRequested(const QString &link);
0044     LIBRUQOLAWIDGETS_NO_EXPORT void slotOpenTeamRequested(const QString &identifier);
0045     LIBRUQOLAWIDGETS_NO_EXPORT void applyChannelSelection();
0046     LIBRUQOLAWIDGETS_NO_EXPORT void slotSelectMessageRequested(const QString &messageId,
0047                                                                const QString &roomId,
0048                                                                ParseMessageUrlUtils::RoomIdType roomType,
0049                                                                ParseMessageUrlUtils::ChannelType channelType);
0050 
0051     ChannelListView *const mChannelView;
0052     QLineEdit *const mSearchRoomLineEdit;
0053     QPointer<RocketChatAccount> mCurrentRocketChatAccount;
0054 };