/* 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 "data/data_star_gift.h" namespace Api { class PremiumGiftCodeOptions; } // namespace Api namespace ChatHelpers { class Show; } // namespace ChatHelpers namespace Data { struct UniqueGift; struct GiftCode; struct CreditsHistoryEntry; class SavedStarGiftId; struct GiftAuctionState; } // namespace Data namespace Info::PeerGifts { struct GiftDescriptor; } // namespace Info::PeerGifts namespace Main { class Session; class SessionShow; } // namespace Main namespace Payments { enum class CheckoutResult; } // namespace Payments namespace Settings { struct GiftWearBoxStyleOverride; struct CreditsEntryBoxStyleOverrides; } // namespace Settings namespace Window { class SessionController; } // namespace Window namespace Ui::Text { class CustomEmoji; } // namespace Ui::Text namespace Ui { class RpWidget; class PopupMenu; class GenericBox; class VerticalLayout; void ChooseStarGiftRecipient( not_null controller); void ShowStarGiftBox( not_null controller, not_null peer); struct UniqueGiftCoverArgs { rpl::producer pretitle; rpl::producer subtitle; Fn subtitleClick; bool subtitleLinkColored = false; rpl::producer resalePrice; Fn resaleClick; bool attributesInfo = false; Fn now, std::optional next, float64 progress)> repaintedHook; std::shared_ptr upgradeSpinner; }; struct UniqueGiftCover { Data::UniqueGift values; bool spinner = false; bool force = false; }; void AddUniqueGiftCover( not_null container, rpl::producer data, UniqueGiftCoverArgs &&args); void AddWearGiftCover( not_null container, const Data::UniqueGift &data, not_null peer); void AttachGiftSenderBadge( not_null box, std::shared_ptr show, not_null from, const QDateTime &date); void ShowUniqueGiftWearBox( std::shared_ptr show, not_null peer, const Data::UniqueGift &gift, Settings::GiftWearBoxStyleOverride st); void PreloadUniqueGiftResellPrices(not_null session); void UpdateGiftSellPrice( std::shared_ptr show, std::shared_ptr unique, Data::SavedStarGiftId savedId, CreditsAmount price); void ShowUniqueGiftSellBox( std::shared_ptr show, std::shared_ptr unique, Data::SavedStarGiftId savedId, Settings::GiftWearBoxStyleOverride st); void ShowOfferBuyBox( std::shared_ptr show, std::shared_ptr unique); void GiftReleasedByHandler(not_null peer); struct StarGiftUpgradeArgs { not_null controller; Data::StarGift stargift; Fn ready; Fn upgraded; not_null peer; Data::SavedStarGiftId savedId; QString giftPrepayUpgradeHash; int cost = 0; bool canAddSender = false; bool canAddComment = false; bool canAddMyComment = false; bool addDetailsDefault = false; }; void ShowStarGiftUpgradeBox(StarGiftUpgradeArgs &&args); void AddUniqueCloseButton( not_null box, Settings::CreditsEntryBoxStyleOverrides st, Fn)> fillMenu = nullptr); void SubmitStarsForm( std::shared_ptr show, MTPInputInvoice invoice, uint64 formId, uint64 price, Fn done); void SubmitTonForm( std::shared_ptr show, MTPInputInvoice invoice, uint64 formId, CreditsAmount ton, Fn done); void RequestOurForm( std::shared_ptr show, MTPInputInvoice invoice, Fn failure)> done); void RequestStarsFormAndSubmit( std::shared_ptr show, MTPInputInvoice invoice, Fn done); void ShowGiftTransferredToast( std::shared_ptr show, not_null to, const Data::UniqueGift &gift); [[nodiscard]] CreditsAmount StarsFromTon( not_null session, CreditsAmount ton); [[nodiscard]] CreditsAmount TonFromStars( not_null session, CreditsAmount stars); struct GiftsDescriptor { std::vector list; std::shared_ptr api; }; [[nodiscard]] object_ptr MakeGiftsSendList( not_null window, not_null peer, rpl::producer gifts, Fn loadMore); void SendGiftBox( not_null box, not_null window, not_null peer, std::shared_ptr api, const Info::PeerGifts::GiftDescriptor &descriptor, rpl::producer auctionState); } // namespace Ui