File indexing completed on 2024-12-22 04:45:36
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 "customusers/customuserstatus.h" 0010 #include <QTreeWidget> 0011 0012 #include "libruqolawidgets_private_export.h" 0013 class RocketChatAccount; 0014 class CustomUserStatusTreeWidgetItem : public QTreeWidgetItem 0015 { 0016 public: 0017 explicit CustomUserStatusTreeWidgetItem(QTreeWidget *parent = nullptr); 0018 ~CustomUserStatusTreeWidgetItem() override; 0019 0020 [[nodiscard]] CustomUserStatus userStatus() const; 0021 void setUserStatus(const CustomUserStatus &userStatus); 0022 0023 private: 0024 CustomUserStatus mUserStatus; 0025 }; 0026 0027 class LIBRUQOLAWIDGETS_TESTS_EXPORT CustomUserStatusTreeWidget : public QTreeWidget 0028 { 0029 Q_OBJECT 0030 public: 0031 enum UserStatusColumn { 0032 Name = 0, 0033 Presence, 0034 Identifier, 0035 }; 0036 explicit CustomUserStatusTreeWidget(RocketChatAccount *account, QWidget *parent = nullptr); 0037 ~CustomUserStatusTreeWidget() override; 0038 void initialize(); 0039 0040 private: 0041 LIBRUQOLAWIDGETS_NO_EXPORT void slotCustomContextMenuRequested(const QPoint &pos); 0042 LIBRUQOLAWIDGETS_NO_EXPORT void addClicked(); 0043 LIBRUQOLAWIDGETS_NO_EXPORT void editClicked(); 0044 LIBRUQOLAWIDGETS_NO_EXPORT void removeClicked(); 0045 RocketChatAccount *const mRocketChatAccount; 0046 };