2018-12-20 16:02:44 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "boxes/abstract_box.h"
|
|
|
|
|
2019-08-02 10:40:35 +00:00
|
|
|
struct PollData;
|
|
|
|
|
2018-12-20 16:02:44 +00:00
|
|
|
namespace Ui {
|
|
|
|
class VerticalLayout;
|
|
|
|
} // namespace Ui
|
|
|
|
|
2019-08-02 10:40:35 +00:00
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
} // namespace Main
|
2018-12-20 16:02:44 +00:00
|
|
|
|
|
|
|
class CreatePollBox : public BoxContent {
|
|
|
|
public:
|
2019-08-02 10:40:35 +00:00
|
|
|
CreatePollBox(QWidget*, not_null<Main::Session*> session);
|
2018-12-20 16:02:44 +00:00
|
|
|
|
|
|
|
rpl::producer<PollData> submitRequests() const;
|
|
|
|
void submitFailed(const QString &error);
|
|
|
|
|
|
|
|
void setInnerFocus() override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void prepare() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
object_ptr<Ui::RpWidget> setupContent();
|
|
|
|
not_null<Ui::InputField*> setupQuestion(
|
|
|
|
not_null<Ui::VerticalLayout*> container);
|
|
|
|
|
2019-08-02 10:40:35 +00:00
|
|
|
const not_null<Main::Session*> _session;
|
2018-12-20 16:02:44 +00:00
|
|
|
Fn<void()> _setInnerFocus;
|
|
|
|
Fn<rpl::producer<bool>()> _dataIsValidValue;
|
|
|
|
rpl::event_stream<PollData> _submitRequests;
|
|
|
|
|
|
|
|
};
|