matrixion/src/dialogs/CreateRoom.h

49 lines
810 B
C
Raw Normal View History

2021-03-05 02:35:15 +03:00
// SPDX-FileCopyrightText: 2021 Nheko Contributors
//
// SPDX-License-Identifier: GPL-3.0-or-later
2017-12-12 00:00:37 +03:00
#pragma once
#include <QFrame>
2020-01-31 19:00:13 +03:00
#include <mtx/requests.hpp>
2017-12-12 00:00:37 +03:00
2018-09-19 22:42:26 +03:00
class QPushButton;
2017-12-12 00:00:37 +03:00
class TextField;
class QComboBox;
class Toggle;
namespace dialogs {
class CreateRoom : public QFrame
{
2021-09-18 01:22:33 +03:00
Q_OBJECT
2017-12-12 00:00:37 +03:00
public:
2021-09-18 01:22:33 +03:00
CreateRoom(QWidget *parent = nullptr);
2017-12-12 00:00:37 +03:00
signals:
2021-09-18 01:22:33 +03:00
void createRoom(const mtx::requests::CreateRoom &request);
2017-12-12 00:00:37 +03:00
protected:
2021-09-18 01:22:33 +03:00
void showEvent(QShowEvent *event) override;
2017-12-12 00:00:37 +03:00
private:
2021-09-18 01:22:33 +03:00
void clearFields();
2017-12-12 00:00:37 +03:00
2021-09-18 01:22:33 +03:00
QComboBox *visibilityCombo_;
QComboBox *presetCombo_;
2017-12-12 00:00:37 +03:00
2021-09-18 01:22:33 +03:00
Toggle *directToggle_;
2017-12-12 00:00:37 +03:00
2021-09-18 01:22:33 +03:00
QPushButton *confirmBtn_;
QPushButton *cancelBtn_;
2017-12-12 00:00:37 +03:00
2021-09-18 01:22:33 +03:00
TextField *nameInput_;
TextField *topicInput_;
TextField *aliasInput_;
2017-12-12 00:00:37 +03:00
2021-09-18 01:22:33 +03:00
mtx::requests::CreateRoom request_;
2017-12-12 00:00:37 +03:00
};
} // dialogs