/* 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/widgets/buttons.h" namespace Ui { class DynamicImage; class GenericBox; class IconButton; class VerticalLayout; template class SlideWrap; } // namespace Ui namespace Ui::Text { struct MarkedContext; } // namespace Ui::Text namespace Data { struct UnreviewedAuth; } // namespace Data namespace Dialogs { not_null*> CreateUnconfirmedAuthContent( not_null parent, const std::vector &list, Fn callback); void ShowAuthDeniedBox( not_null box, float64 count, const QString &messageText); class TopBarSuggestionContent : public Ui::RippleButton { public: enum class RightIcon { None, Close, Arrow, }; TopBarSuggestionContent( not_null parent, Fn emojiPaused = nullptr); void setContent( TextWithEntities title, TextWithEntities description, std::optional context = std::nullopt, std::optional descriptionColorOverride = std::nullopt); [[nodiscard]] rpl::producer desiredHeightValue() const override; void setHideCallback(Fn); void setRightIcon(RightIcon); void setRightButton( rpl::producer text, Fn callback); void setLeftPadding(rpl::producer); [[nodiscard]] const style::TextStyle &contentTitleSt() const; protected: void paintEvent(QPaintEvent *) override; private: void draw(QPainter &p); const style::TextStyle &_titleSt; const style::TextStyle &_contentTitleSt; const style::TextStyle &_contentTextSt; Ui::Text::String _contentTitle; Ui::Text::String _contentText; rpl::variable _lastPaintedContentLineAmount = 0; rpl::variable _lastPaintedContentTop = 0; std::optional _descriptionColorOverride; base::unique_qptr _rightHide; base::unique_qptr _rightArrow; base::unique_qptr _rightButton; Fn _hideCallback; Fn _emojiPaused; int _leftPadding = 0; RightIcon _rightIcon = RightIcon::None; std::shared_ptr _rightPhoto; QImage _rightPhotoImage; }; } // namespace Dialogs