/* 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 "base/object_ptr.h" #include "dialogs/ui/top_peers_strip.h" #include "ui/rp_widget.h" namespace Main { class Session; } // namespace Main namespace Ui { class ElasticScroll; class VerticalLayout; template class SlideWrap; } // namespace Ui namespace Window { class SessionController; } // namespace Window namespace Dialogs { struct RecentPeersList { std::vector> list; }; class Suggestions final : public Ui::RpWidget { public: Suggestions( not_null parent, not_null controller, rpl::producer topPeers, RecentPeersList recentPeers); ~Suggestions(); void selectSkip(int delta); void selectSkipPage(int height, int direction); void selectLeft(); void selectRight(); void chooseRow(); [[nodiscard]] rpl::producer> topPeerChosen() const { return _topPeerChosen.events(); } [[nodiscard]] rpl::producer> recentPeerChosen() const { return _recentPeerChosen.events(); } private: void paintEvent(QPaintEvent *e) override; void resizeEvent(QResizeEvent *e) override; [[nodiscard]] object_ptr> setupRecentPeers( not_null window, RecentPeersList recentPeers); [[nodiscard]] object_ptr> setupEmptyRecent( not_null window); const std::unique_ptr _scroll; const not_null _content; const not_null*> _topPeersWrap; const not_null _topPeers; rpl::variable _recentCount; const not_null*> _recentPeers; const not_null*> _emptyRecent; rpl::event_stream> _topPeerChosen; rpl::event_stream> _recentPeerChosen; }; [[nodiscard]] rpl::producer TopPeersContent( not_null session); [[nodiscard]] RecentPeersList RecentPeersContent( not_null session); } // namespace Dialogs