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

113 lines
2.7 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
2025-01-15 14:26:22 +04:00
#include "data/data_star_gift.h"
2025-01-09 18:38:40 +04:00
namespace ChatHelpers {
class Show;
} // namespace ChatHelpers
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 Settings {
2025-01-13 15:16:01 +04:00
struct GiftWearBoxStyleOverride;
struct CreditsEntryBoxStyleOverrides;
} // namespace Settings
namespace Window {
class SessionController;
} // namespace Window
2024-12-27 12:30:29 +04:00
namespace Ui::Text {
class CustomEmoji;
} // namespace Ui::Text
namespace Ui {
2025-01-07 10:38:14 +04:00
class PopupMenu;
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);
2025-01-09 18:38:40 +04:00
void AddWearGiftCover(
not_null<VerticalLayout*> container,
const Data::UniqueGift &data,
not_null<PeerData*> peer);
void ShowUniqueGiftWearBox(
std::shared_ptr<ChatHelpers::Show> show,
const Data::UniqueGift &gift,
2025-01-13 15:16:01 +04:00
Settings::GiftWearBoxStyleOverride st);
2024-12-26 10:10:44 +04:00
2025-01-08 17:36:25 +04:00
struct PatternPoint {
QPointF position;
float64 scale = 1.;
float64 opacity = 1.;
};
[[nodiscard]] const std::vector<PatternPoint> &PatternPoints();
[[nodiscard]] const std::vector<PatternPoint> &PatternPointsSmall();
2024-12-27 12:30:29 +04:00
void PaintPoints(
QPainter &p,
2025-01-08 17:36:25 +04:00
const std::vector<PatternPoint> &points,
2024-12-27 12:30:29 +04:00
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<PeerData*> peer;
2025-01-15 14:26:22 +04:00
Data::SavedStarGiftId savedId;
2024-12-27 21:32:25 +04:00
int cost = 0;
bool canAddSender = false;
bool canAddComment = false;
2024-12-31 21:40:18 +04:00
bool canAddMyComment = false;
bool addDetailsDefault = false;
2024-12-27 21:32:25 +04:00
};
void ShowStarGiftUpgradeBox(StarGiftUpgradeArgs &&args);
2024-12-26 10:10:44 +04:00
2025-01-07 10:38:14 +04:00
void AddUniqueCloseButton(
not_null<GenericBox*> box,
Settings::CreditsEntryBoxStyleOverrides st,
2025-01-07 10:38:14 +04:00
Fn<void(not_null<PopupMenu*>)> fillMenu = nullptr);
2024-12-27 17:04:23 +04:00
2024-12-30 13:56:37 +04:00
void RequestStarsFormAndSubmit(
not_null<Window::SessionController*> window,
MTPInputInvoice invoice,
2024-12-30 18:39:42 +04:00
Fn<void(Payments::CheckoutResult, const MTPUpdates *)> done);
void ShowGiftTransferredToast(
base::weak_ptr<Window::SessionController> weak,
not_null<PeerData*> to,
const MTPUpdates &result);
2024-12-30 13:56:37 +04:00
} // namespace Ui