/* 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/effects/round_checkbox.h" namespace style { struct PremiumLimits; } // namespace style namespace tr { template struct phrase; } // namespace tr enum lngtag_count : int; namespace Data { struct SubscriptionOption; } // namespace Data namespace style { struct RoundImageCheckbox; struct PremiumOption; struct TextStyle; struct PremiumBubble; } // namespace style namespace Ui { class GenericBox; class RadiobuttonGroup; class VerticalLayout; namespace Premium { inline constexpr auto kLimitRowRatio = 0.5; [[nodiscard]] QString Svg(); [[nodiscard]] QByteArray ColorizedSvg(const QGradientStops &gradientStops); [[nodiscard]] QImage GenerateStarForLightTopBar(QRectF rect); void AddBubbleRow( not_null parent, const style::PremiumBubble &st, rpl::producer<> showFinishes, int min, int current, int max, bool premiumPossible, std::optional> phrase, const style::icon *icon); struct BubbleRowState { int counter = 0; float64 ratio = 0.; bool animateFromZero = false; bool dynamic = false; }; void AddBubbleRow( not_null parent, const style::PremiumBubble &st, rpl::producer<> showFinishes, rpl::producer state, bool premiumPossible, Fn text, const style::icon *icon, const style::margins &outerPadding); void AddLimitRow( not_null parent, const style::PremiumLimits &st, QString max, QString min = {}, float64 ratio = kLimitRowRatio); void AddLimitRow( not_null parent, const style::PremiumLimits &st, int max, std::optional> phrase, int min = 0, float64 ratio = kLimitRowRatio); struct LimitRowLabels { rpl::producer leftLabel; rpl::producer leftCount; rpl::producer rightLabel; rpl::producer rightCount; }; struct LimitRowState { float64 ratio = 0.; bool animateFromZero = false; bool dynamic = false; }; void AddLimitRow( not_null parent, const style::PremiumLimits &st, LimitRowLabels labels, rpl::producer state, const style::margins &padding); struct AccountsRowArgs final { std::shared_ptr group; const style::RoundImageCheckbox &st; const style::TextStyle &stName; const style::color &stNameFg; struct Entry final { QString name; Ui::RoundImageCheckbox::PaintRoundImage paintRoundImage; }; std::vector entries; }; void AddAccountsRow( not_null parent, AccountsRowArgs &&args); [[nodiscard]] QGradientStops LimitGradientStops(); [[nodiscard]] QGradientStops ButtonGradientStops(); [[nodiscard]] QGradientStops LockGradientStops(); [[nodiscard]] QGradientStops FullHeightGradientStops(); [[nodiscard]] QGradientStops GiftGradientStops(); [[nodiscard]] QGradientStops CreditsIconGradientStops(); struct ListEntry final { rpl::producer title; rpl::producer about; int leftNumber = 0; int rightNumber = 0; std::optional customRightText; const style::icon *icon = nullptr; }; void ShowListBox( not_null box, const style::PremiumLimits &st, std::vector entries); void AddGiftOptions( not_null parent, std::shared_ptr group, std::vector gifts, const style::PremiumOption &st, bool topBadges = false); } // namespace Premium } // namespace Ui