2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-23 18:57:12 +00:00
tdesktop/Telegram/SourceFiles/boxes/gift_premium_box.h

109 lines
2.8 KiB
C
Raw Permalink Normal View History

2022-07-03 17:56:12 +03: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 "mtproto/sender.h"
namespace Api {
struct GiftCode;
} // namespace Api
2025-01-07 14:52:25 +04:00
namespace ChatHelpers {
class Show;
} // namespace ChatHelpers
2023-10-11 13:29:02 +04:00
namespace Data {
2024-09-04 01:55:57 +03:00
struct Boost;
struct CreditsHistoryEntry;
2023-12-13 08:14:41 +00:00
struct GiveawayStart;
struct GiveawayResults;
struct SubscriptionEntry;
2023-10-11 13:29:02 +04:00
} // namespace Data
2025-01-22 22:12:50 +04:00
namespace Main {
class Session;
} // namespace Main
namespace Settings {
struct CreditsEntryBoxStyleOverrides;
} // namespace Settings
namespace Ui {
class Show;
class GenericBox;
class VerticalLayout;
} // namespace Ui
2022-07-03 17:56:12 +03:00
namespace Window {
class SessionNavigation;
2022-07-03 17:56:12 +03:00
} // namespace Window
2023-10-11 13:29:02 +04:00
[[nodiscard]] rpl::producer<QString> GiftDurationValue(int months);
[[nodiscard]] QString GiftDuration(int months);
void GiftCodeBox(
not_null<Ui::GenericBox*> box,
not_null<Window::SessionNavigation*> controller,
const QString &slug);
2023-11-07 05:35:28 +03:00
void GiftCodePendingBox(
not_null<Ui::GenericBox*> box,
not_null<Window::SessionNavigation*> controller,
const Api::GiftCode &data);
void ResolveGiftCode(
not_null<Window::SessionNavigation*> controller,
const QString &slug,
PeerId fromId = 0,
PeerId toId = 0);
2023-10-11 13:29:02 +04:00
void ResolveGiveawayInfo(
not_null<Window::SessionNavigation*> controller,
2023-10-11 13:29:02 +04:00
not_null<PeerData*> peer,
MsgId messageId,
2023-12-13 08:14:41 +00:00
std::optional<Data::GiveawayStart> start,
std::optional<Data::GiveawayResults> results);
2025-01-22 22:12:50 +04:00
[[nodiscard]] QString TonAddressUrl(
not_null<Main::Session*> session,
const QString &address);
2024-09-20 12:03:44 +04:00
void AddStarGiftTable(
2025-01-07 14:52:25 +04:00
std::shared_ptr<ChatHelpers::Show> show,
2024-09-20 12:03:44 +04:00
not_null<Ui::VerticalLayout*> container,
Settings::CreditsEntryBoxStyleOverrides st,
2024-10-11 15:05:41 +04:00
const Data::CreditsHistoryEntry &entry,
2024-12-26 10:10:44 +04:00
Fn<void()> convertToStars,
Fn<void()> startUpgrade);
void AddCreditsHistoryEntryTable(
2025-01-07 14:52:25 +04:00
std::shared_ptr<ChatHelpers::Show> show,
not_null<Ui::VerticalLayout*> container,
Settings::CreditsEntryBoxStyleOverrides st,
const Data::CreditsHistoryEntry &entry);
void AddSubscriptionEntryTable(
2025-01-07 14:52:25 +04:00
std::shared_ptr<ChatHelpers::Show> show,
not_null<Ui::VerticalLayout*> container,
Settings::CreditsEntryBoxStyleOverrides st,
const Data::SubscriptionEntry &s);
2024-08-10 21:21:07 +03:00
void AddSubscriberEntryTable(
2025-01-07 14:52:25 +04:00
std::shared_ptr<ChatHelpers::Show> show,
2024-08-10 21:21:07 +03:00
not_null<Ui::VerticalLayout*> container,
Settings::CreditsEntryBoxStyleOverrides st,
2024-08-10 21:21:07 +03:00
not_null<PeerData*> peer,
TimeId date);
2024-09-04 01:55:57 +03:00
void AddCreditsBoostTable(
2025-01-07 14:52:25 +04:00
std::shared_ptr<ChatHelpers::Show> show,
2024-09-04 01:55:57 +03:00
not_null<Ui::VerticalLayout*> container,
Settings::CreditsEntryBoxStyleOverrides st,
2024-09-04 01:55:57 +03:00
const Data::Boost &boost);
void AddChannelEarnTable(
std::shared_ptr<Ui::Show> show,
not_null<Ui::VerticalLayout*> container,
const Data::CreditsHistoryEntry &entry);