2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-28 21:18:46 +00:00

73 lines
1.6 KiB
C
Raw Normal View History

/*
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
2024-12-26 10:10:44 +04:00
namespace Data {
struct UniqueGift;
2024-12-27 17:04:23 +04:00
struct GiftCode;
struct CreditsHistoryEntry;
2024-12-26 10:10:44 +04:00
} // namespace Data
2024-12-30 13:56:37 +04:00
namespace Payments {
enum class CheckoutResult;
} // namespace Payments
namespace Window {
class SessionController;
} // namespace Window
2024-12-27 12:30:29 +04:00
namespace Ui::Text {
class CustomEmoji;
} // namespace Ui::Text
namespace Ui {
2024-12-27 17:04:23 +04:00
class GenericBox;
2024-12-26 10:10:44 +04:00
class VerticalLayout;
void ChooseStarGiftRecipient(
not_null<Window::SessionController*> controller);
void ShowStarGiftBox(
not_null<Window::SessionController*> controller,
not_null<PeerData*> peer);
2024-12-26 10:10:44 +04:00
void AddUniqueGiftCover(
not_null<VerticalLayout*> container,
rpl::producer<Data::UniqueGift> data,
rpl::producer<QString> subtitleOverride = nullptr);
2024-12-27 12:30:29 +04:00
void PaintPoints(
QPainter &p,
base::flat_map<float64, QImage> &cache,
not_null<Text::CustomEmoji*> emoji,
const Data::UniqueGift &gift,
const QRect &rect,
float64 shown = 1.);
2024-12-27 21:32:25 +04:00
struct StarGiftUpgradeArgs {
not_null<Window::SessionController*> controller;
base::required<uint64> stargiftId;
Fn<void(bool)> ready;
not_null<UserData*> user;
MsgId itemId = 0;
int cost = 0;
bool canAddSender = false;
bool canAddComment = false;
};
void ShowStarGiftUpgradeBox(StarGiftUpgradeArgs &&args);
2024-12-26 10:10:44 +04:00
2024-12-27 17:04:23 +04:00
void AddUniqueCloseButton(not_null<GenericBox*> box);
2024-12-30 13:56:37 +04:00
void RequestStarsFormAndSubmit(
not_null<Window::SessionController*> window,
MTPInputInvoice invoice,
Fn<void(Payments::CheckoutResult)> done);
} // namespace Ui