/* 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/wrap/padding_wrap.h" #include "ui/abstract_button.h" #include "base/timer.h" namespace Window { class SessionController; } // namespace Window namespace Ui { class UserpicButton; class FlatLabel; template class SlideWrap; } // namespace Ui namespace HistoryView { class StickerPlayer; } // namespace HistoryView namespace Data { class ForumTopic; } // namespace Data namespace Info { class Controller; class Section; } // namespace Info namespace style { struct InfoProfileCover; } // namespace style namespace Info::Profile { class EmojiStatusPanel; class Badge; class TopicIconView final { public: TopicIconView( not_null topic, Fn paused, Fn update); void paintInRect(QPainter &p, QRect rect); private: using StickerPlayer = HistoryView::StickerPlayer; void setup(not_null topic); void setupPlayer(not_null topic); void setupImage(not_null topic); const not_null _topic; Fn _paused; Fn _update; std::shared_ptr _player; QImage _image; rpl::lifetime _lifetime; }; class TopicIconButton final : public Ui::AbstractButton { public: TopicIconButton( QWidget *parent, not_null controller, not_null topic); private: TopicIconView _view; }; class Cover final : public Ui::FixedHeightWidget { public: Cover( QWidget *parent, not_null peer, not_null controller); Cover( QWidget *parent, not_null topic, not_null controller); Cover( QWidget *parent, not_null peer, not_null controller, rpl::producer title); ~Cover(); Cover *setOnlineCount(rpl::producer &&count); [[nodiscard]] rpl::producer
showSection() const { return _showSection.events(); } private: Cover( QWidget *parent, not_null peer, Data::ForumTopic *topic, not_null controller, rpl::producer title); void setupChildGeometry(); void initViewers(rpl::producer title); void refreshStatusText(); void refreshNameGeometry(int newWidth); void refreshStatusGeometry(int newWidth); void refreshUploadPhotoOverlay(); const style::InfoProfileCover &_st; const not_null _controller; const not_null _peer; const std::unique_ptr _emojiStatusPanel; const std::unique_ptr _badge; int _onlineCount = 0; object_ptr _userpic; object_ptr _iconButton; object_ptr _name = { nullptr }; object_ptr _status = { nullptr }; //object_ptr _dropArea = { nullptr }; base::Timer _refreshStatusTimer; rpl::event_stream
_showSection; }; } // namespace Info::Profile