File indexing completed on 2024-12-22 04:45:39
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 "administratorroomseditbasewidget.h" 0010 #include "administratorroomsselectroomtypewidget.h" 0011 #include "libruqolawidgets_private_export.h" 0012 #include "misc/searchtreebasewidget.h" 0013 #include "model/adminroomsfilterproxymodel.h" 0014 #include "room.h" 0015 #include "rooms/saveroomsettingsjob.h" 0016 class QWidget; 0017 class LIBRUQOLAWIDGETS_TESTS_EXPORT AdministratorRoomsWidget : public SearchTreeBaseWidget 0018 { 0019 Q_OBJECT 0020 public: 0021 explicit AdministratorRoomsWidget(RocketChatAccount *account, QWidget *parent = nullptr); 0022 ~AdministratorRoomsWidget() override; 0023 0024 protected: 0025 void slotLoadElements(int offset = -1, int count = -1, const QString &searchName = {}) override; 0026 void slotCustomContextMenuRequested(const QPoint &pos) override; 0027 void updateLabel() override; 0028 0029 private: 0030 [[nodiscard]] LIBRUQOLAWIDGETS_NO_EXPORT QString displayShowMessageInRoom() const; 0031 LIBRUQOLAWIDGETS_NO_EXPORT void slotDeleteGroupsDone(const QString &identifier); 0032 LIBRUQOLAWIDGETS_NO_EXPORT void slotDeletechannelDone(const QString &identifier); 0033 LIBRUQOLAWIDGETS_NO_EXPORT void slotDeleteDirectMessageDone(const QString &identifier); 0034 LIBRUQOLAWIDGETS_NO_EXPORT void slotFilterChanged(AdminRoomsFilterProxyModel::FilterRooms filters); 0035 LIBRUQOLAWIDGETS_NO_EXPORT void slotModifyRoom(const QModelIndex &index); 0036 LIBRUQOLAWIDGETS_NO_EXPORT void slotRemoveRoom(const QModelIndex &parentIndex); 0037 LIBRUQOLAWIDGETS_NO_EXPORT void slotSaveRoomSettingsDone(const QString &roomId); 0038 LIBRUQOLAWIDGETS_NO_EXPORT void slotGetRoomSettingsDone(const QJsonObject &obj); 0039 LIBRUQOLAWIDGETS_NO_EXPORT void slotGetRoomSettingsModifyDone(const QJsonObject &obj, Room::RoomType roomType); 0040 [[nodiscard]] LIBRUQOLAWIDGETS_NO_EXPORT RocketChatRestApi::SaveRoomSettingsJob::SaveRoomSettingsInfo 0041 convertToSaveRoomSettingsInfo(const AdministratorRoomsEditBaseWidget::RoomEditInfo &info, const Room::RoomType roomType, const QString &roomIdentifier); 0042 0043 AdministratorRoomsSelectRoomTypeWidget *const mSelectRoomType; 0044 };