1 /*
2    SPDX-FileCopyrightText: 2020-2021 Laurent Montel <montel@kde.org>
3 
4    SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "createnewchannelwidget.h"
10 #include "createroominfo.h"
11 #include "libruqolawidgets_private_export.h"
12 #include <QDialog>
13 class CreateNewChannelWidget;
14 class QPushButton;
15 class RocketChatAccount;
16 class LIBRUQOLAWIDGETS_TESTS_EXPORT CreateNewChannelDialog : public QDialog
17 {
18     Q_OBJECT
19 public:
20     explicit CreateNewChannelDialog(RocketChatAccount *account, QWidget *parent = nullptr);
21     ~CreateNewChannelDialog() override;
22     struct NewChannelInfo {
23         RocketChatRestApi::CreateRoomInfo info;
24         bool privateChannel = false;
25     };
26     Q_REQUIRED_RESULT NewChannelInfo channelInfo() const;
27 
28     void setFeatures(CreateNewChannelWidget::Features features);
29 
30 private:
31     void writeConfig();
32     void readConfig();
33     CreateNewChannelWidget *const mCreateNewChannelWidget;
34     QPushButton *mOkButton = nullptr;
35 };
36 
37