2022-05-18 18:53:25 +00: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 "settings/settings_type.h"
|
|
|
|
|
2022-06-14 09:42:43 +00:00
|
|
|
enum class PremiumPreview;
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class RpWidget;
|
|
|
|
class GradientButton;
|
|
|
|
} // namespace Ui
|
|
|
|
|
2022-05-20 13:12:56 +00:00
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
} // namespace Main
|
|
|
|
|
2022-05-23 08:04:31 +00:00
|
|
|
namespace Window {
|
|
|
|
class SessionController;
|
|
|
|
} // namespace Window
|
|
|
|
|
2022-05-18 18:53:25 +00:00
|
|
|
namespace Settings {
|
|
|
|
|
2022-05-20 13:12:56 +00:00
|
|
|
[[nodiscard]] Type PremiumId();
|
|
|
|
|
2022-05-23 14:46:15 +00:00
|
|
|
void ShowPremium(not_null<::Main::Session*> session, const QString &ref);
|
|
|
|
void ShowPremium(
|
|
|
|
not_null<Window::SessionController*> controller,
|
|
|
|
const QString &ref);
|
2022-07-26 22:02:30 +00:00
|
|
|
void ShowGiftPremium(
|
|
|
|
not_null<Window::SessionController*> controller,
|
|
|
|
not_null<PeerData*> peer,
|
|
|
|
int months,
|
|
|
|
bool me);
|
2022-05-23 14:46:15 +00:00
|
|
|
|
2022-05-23 08:04:31 +00:00
|
|
|
void StartPremiumPayment(
|
|
|
|
not_null<Window::SessionController*> controller,
|
|
|
|
const QString &ref);
|
2022-05-18 18:53:25 +00:00
|
|
|
|
2022-06-14 09:42:43 +00:00
|
|
|
[[nodiscard]] QString LookupPremiumRef(PremiumPreview section);
|
|
|
|
|
2022-07-06 15:14:32 +00:00
|
|
|
struct SubscribeButtonArgs final {
|
|
|
|
not_null<Window::SessionController*> controller;
|
|
|
|
not_null<Ui::RpWidget*> parent;
|
|
|
|
Fn<QString()> computeRef;
|
|
|
|
std::optional<rpl::producer<QString>> text;
|
|
|
|
std::optional<QGradientStops> gradientStops;
|
|
|
|
};
|
|
|
|
|
2022-06-14 09:42:43 +00:00
|
|
|
[[nodiscard]] not_null<Ui::GradientButton*> CreateSubscribeButton(
|
2022-07-06 15:14:32 +00:00
|
|
|
SubscribeButtonArgs &&args);
|
2022-06-14 09:42:43 +00:00
|
|
|
|
|
|
|
|
2022-05-18 18:53:25 +00:00
|
|
|
} // namespace Settings
|
|
|
|
|