2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-26 12:18:01 +00:00
tdesktop/Telegram/SourceFiles/payments/ui/payments_reaction_box.h

51 lines
1007 B
C
Raw Normal View History

2024-08-06 12:48:06 +02:00
/*
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 {
class BoxContent;
class GenericBox;
class DynamicImage;
2024-08-06 12:48:06 +02:00
struct TextWithContext {
TextWithEntities text;
std::any context;
};
struct PaidReactionTop {
QString name;
std::shared_ptr<DynamicImage> photo;
int count = 0;
2024-08-12 17:51:31 +02:00
Fn<void()> click;
bool my = false;
};
2024-08-06 12:48:06 +02:00
struct PaidReactionBoxArgs {
int chosen = 0;
2024-08-07 18:09:32 +02:00
int max = 0;
2024-08-06 12:48:06 +02:00
std::vector<PaidReactionTop> top;
2024-08-06 12:48:06 +02:00
QString channel;
Fn<rpl::producer<TextWithContext>(rpl::producer<int> amount)> submit;
rpl::producer<uint64> balanceValue;
2024-08-12 17:51:31 +02:00
Fn<void(int, bool)> send;
2024-08-06 12:48:06 +02:00
};
void PaidReactionsBox(
not_null<GenericBox*> box,
PaidReactionBoxArgs &&args);
[[nodiscard]] object_ptr<BoxContent> MakePaidReactionBox(
PaidReactionBoxArgs &&args);
} // namespace Ui