File indexing completed on 2024-12-01 04:37:05

0001 /*
0002    SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "createchannelteaminfo.h"
0010 #include <QPointer>
0011 #include <QWidget>
0012 
0013 #include "libruqolawidgets_private_export.h"
0014 class QListView;
0015 class QLineEdit;
0016 class TeamRoomsModel;
0017 class TeamRoomsFilterProxyModel;
0018 class TeamChannelsComboBox;
0019 class Room;
0020 class RocketChatAccount;
0021 class LIBRUQOLAWIDGETS_TESTS_EXPORT TeamChannelsWidget : public QWidget
0022 {
0023     Q_OBJECT
0024 public:
0025     explicit TeamChannelsWidget(RocketChatAccount *account, QWidget *parent = nullptr);
0026     ~TeamChannelsWidget() override;
0027 
0028     void setRoom(Room *room);
0029 
0030 private:
0031     LIBRUQOLAWIDGETS_NO_EXPORT void slotTeamListRoomsDone(const QJsonObject &obj);
0032     LIBRUQOLAWIDGETS_NO_EXPORT void initializeTeamRoomsList();
0033     LIBRUQOLAWIDGETS_NO_EXPORT void slotTypeTeamListChanged(int index);
0034     LIBRUQOLAWIDGETS_NO_EXPORT void slotTextChanged(const QString &str);
0035     LIBRUQOLAWIDGETS_NO_EXPORT void slotCustomContextMenuRequested(const QPoint &pos);
0036     LIBRUQOLAWIDGETS_NO_EXPORT void slotAddExistingRoom();
0037     LIBRUQOLAWIDGETS_NO_EXPORT void slotCreateRoom();
0038     LIBRUQOLAWIDGETS_NO_EXPORT void slotRemoveTeamRoomDone();
0039     LIBRUQOLAWIDGETS_NO_EXPORT void slotTeamUpdateRoomDone(const QJsonObject &replyObject);
0040     LIBRUQOLAWIDGETS_NO_EXPORT void removeRoomFromTeam(const QString &roomId);
0041     LIBRUQOLAWIDGETS_NO_EXPORT void updateAutojoin(const QString &roomId, bool autojoin);
0042     LIBRUQOLAWIDGETS_NO_EXPORT void slotTeamAddRoomsDone(const QJsonObject &obj);
0043     LIBRUQOLAWIDGETS_NO_EXPORT void createChannels(const RocketChatRestApi::CreateChannelTeamInfo &info);
0044     LIBRUQOLAWIDGETS_NO_EXPORT void createGroups(const RocketChatRestApi::CreateChannelTeamInfo &info);
0045     QListView *const mListView;
0046     QLineEdit *const mSearchLineEdit;
0047     TeamChannelsComboBox *const mTeamChannelsCombobox;
0048     TeamRoomsModel *const mTeamRoomsModel;
0049     TeamRoomsFilterProxyModel *const mTeamRoomFilterProxyModel;
0050     QPointer<Room> mRoom;
0051     RocketChatAccount *const mRocketChatAccount;
0052     QString mTeamId;
0053 };