/* 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 "ui/rp_widget.h" #include "ui/widgets/scroll_area.h" #include "base/object_ptr.h" namespace Ui { class VerticalLayout; } // namespace Ui namespace Info { class Controller; namespace Polls { class Memento; class ListController; class InnerWidget final : public Ui::RpWidget { public: InnerWidget( QWidget *parent, not_null controller, not_null poll, FullMsgId contextId); [[nodiscard]] not_null poll() const { return _poll; } [[nodiscard]] FullMsgId contextId() const { return _contextId; } [[nodiscard]] auto scrollToRequests() const -> rpl::producer; [[nodiscard]] auto showPeerInfoRequests() const -> rpl::producer>; [[nodiscard]] int desiredHeight() const; void saveState(not_null memento); void restoreState(not_null memento); protected: void visibleTopBottomUpdated( int visibleTop, int visibleBottom) override; private: void setupContent(); not_null _controller; not_null _poll; FullMsgId _contextId; object_ptr _content; base::flat_map> _sections; rpl::event_stream _scrollToRequests; rpl::event_stream> _showPeerInfoRequests; rpl::variable _visibleTop = 0; }; } // namespace Polls } // namespace Info