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

0001 /*
0002    SPDX-FileCopyrightText: 2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include <QItemDelegate>
0010 class RocketChatAccount;
0011 class AvatarCacheManager;
0012 class SwitchChannelDelegate : public QItemDelegate
0013 {
0014     Q_OBJECT
0015 public:
0016     explicit SwitchChannelDelegate(QObject *parent = nullptr);
0017     ~SwitchChannelDelegate() override;
0018 
0019     void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
0020     QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
0021 
0022     void setCurrentRocketChatAccount(RocketChatAccount *currentRocketChatAccount);
0023 
0024 private:
0025     RocketChatAccount *mRocketChatAccount = nullptr;
0026     AvatarCacheManager *const mAvatarCacheManager;
0027 };