/* 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" namespace Ui { void StartFireworks(not_null parent); class Show; class RpWidget; class GenericBox; class VerticalLayout; struct BoostCounters { int level = 0; int boosts = 0; int thisLevelBoosts = 0; int nextLevelBoosts = 0; // Zero means no next level is available. int mine = 0; friend inline constexpr bool operator==( BoostCounters, BoostCounters) = default; }; struct BoostFeatures { base::flat_map nameColorsByLevel; base::flat_map linkStylesByLevel; int linkLogoLevel = 0; int transcribeLevel = 0; int emojiPackLevel = 0; int emojiStatusLevel = 0; int wallpaperLevel = 0; int wallpapersCount = 0; int customWallpaperLevel = 0; int sponsoredLevel = 0; }; struct BoostBoxData { QString name; BoostCounters boost; BoostFeatures features; bool allowMulti = false; bool group = false; }; void BoostBox( not_null box, BoostBoxData data, Fn)> boost); void BoostBoxAlready(not_null box, bool group); void GiftForBoostsBox( not_null box, QString channel, int receive, bool again); void GiftedNoBoostsBox(not_null box, bool group); void PremiumForBoostsBox( not_null box, bool group, Fn buyPremium); struct AskBoostChannelColor { int requiredLevel = 0; }; struct AskBoostWallpaper { int requiredLevel = 0; bool group = false; }; struct AskBoostEmojiStatus { int requiredLevel = 0; bool group = false; }; struct AskBoostEmojiPack { int requiredLevel = 0; }; struct AskBoostCustomReactions { int count = 0; }; struct AskBoostCpm { int requiredLevel = 0; }; struct AskBoostReason { std::variant< AskBoostChannelColor, AskBoostWallpaper, AskBoostEmojiStatus, AskBoostEmojiPack, AskBoostCustomReactions, AskBoostCpm> data; }; struct AskBoostBoxData { QString link; BoostCounters boost; AskBoostReason reason; }; void AskBoostBox( not_null box, AskBoostBoxData data, Fn openStatistics, Fn startGiveaway); [[nodiscard]] object_ptr MakeLinkLabel( not_null parent, rpl::producer text, rpl::producer link, std::shared_ptr show, object_ptr right); void FillBoostLimit( rpl::producer<> showFinished, not_null container, rpl::producer data, style::margins limitLinePadding); } // namespace Ui