/* 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 "settings/settings_type.h" enum class PremiumFeature; namespace style { struct RoundButton; } // namespace style namespace ChatHelpers { class Show; enum class WindowUsage; } // namespace ChatHelpers namespace Ui { class RpWidget; class RoundButton; class GradientButton; class VerticalLayout; } // namespace Ui namespace Main { class Session; class SessionShow; } // namespace Main namespace Window { class SessionController; } // namespace Window namespace Settings { [[nodiscard]] Type PremiumId(); void ShowPremium(not_null<::Main::Session*> session, const QString &ref); void ShowPremium( not_null controller, const QString &ref); void ShowGiftPremium( not_null controller, not_null peer, int months, bool me); void ShowEmojiStatusPremium( not_null controller, not_null peer); void StartPremiumPayment( not_null controller, const QString &ref); [[nodiscard]] QString LookupPremiumRef(PremiumFeature section); void ShowPremiumPromoToast( std::shared_ptr show, TextWithEntities textWithLink, const QString &ref); void ShowPremiumPromoToast( std::shared_ptr<::Main::SessionShow> show, Fn, ChatHelpers::WindowUsage)> resolveWindow, TextWithEntities textWithLink, const QString &ref); struct SubscribeButtonArgs final { Window::SessionController *controller = nullptr; not_null parent; Fn computeRef; std::optional> text; std::optional gradientStops; Fn computeBotUrl; // nullable std::shared_ptr show; }; [[nodiscard]] not_null CreateLockedButton( not_null parent, rpl::producer text, const style::RoundButton &st, rpl::producer locked); [[nodiscard]] not_null CreateSubscribeButton( SubscribeButtonArgs &&args); [[nodiscard]] std::vector PremiumFeaturesOrder( not_null<::Main::Session*> session); void AddSummaryPremium( not_null content, not_null controller, const QString &ref, Fn buttonCallback); } // namespace Settings