/* 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" #include "api/api_common.h" #include "data/data_poll.h" struct PollData; namespace Ui { class VerticalLayout; } // namespace Ui namespace Main { class Session; } // namespace Main class CreatePollBox : public Ui::BoxContent { public: struct Result { PollData poll; Api::SendOptions options; }; CreatePollBox( QWidget*, not_null session, Api::SendType sendType); rpl::producer submitRequests() const; void submitFailed(const QString &error); void setInnerFocus() override; protected: void prepare() override; private: object_ptr setupContent(); not_null setupQuestion( not_null container); const not_null _session; const Api::SendType _sendType = Api::SendType(); Fn _setInnerFocus; Fn()> _dataIsValidValue; rpl::event_stream _submitRequests; };