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

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 <QTreeView>
0010 class SwitchChannelDelegate;
0011 class RocketChatAccount;
0012 class LIBRUQOLAWIDGETS_TESTS_EXPORT SwitchChannelTreeView : public QTreeView
0013 {
0014     Q_OBJECT
0015 public:
0016     explicit SwitchChannelTreeView(QWidget *parent = nullptr);
0017     ~SwitchChannelTreeView() override;
0018 
0019     [[nodiscard]] int sizeHintWidth() const;
0020     void resizeColumnsToContents();
0021 
0022     void setCurrentRocketChatAccount(RocketChatAccount *newCurrentRocketChatAccount);
0023 
0024 Q_SIGNALS:
0025     void channelSelected(const QModelIndex &index);
0026 
0027 protected:
0028     void keyPressEvent(QKeyEvent *event) override;
0029     void showEvent(QShowEvent *event) override;
0030     void keyReleaseEvent(QKeyEvent *event) override;
0031 
0032 private:
0033     SwitchChannelDelegate *const mSwitchChannelDelegate;
0034 };