2022-05-17 00:04:44 +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
|
|
|
|
|
2022-05-31 10:32:07 +00:00
|
|
|
#include "ui/effects/round_checkbox.h"
|
2022-05-20 14:57:01 +00:00
|
|
|
|
2022-05-17 00:04:44 +00:00
|
|
|
namespace tr {
|
|
|
|
template <typename ...>
|
|
|
|
struct phrase;
|
|
|
|
} // namespace tr
|
|
|
|
|
|
|
|
enum lngtag_count : int;
|
|
|
|
|
2022-08-25 02:14:33 +00:00
|
|
|
namespace Data {
|
|
|
|
struct SubscriptionOption;
|
|
|
|
} // namespace Data
|
|
|
|
|
2022-05-31 10:32:07 +00:00
|
|
|
namespace style {
|
|
|
|
struct RoundImageCheckbox;
|
|
|
|
struct TextStyle;
|
|
|
|
} // namespace style
|
|
|
|
|
2022-05-17 00:04:44 +00:00
|
|
|
namespace Ui {
|
|
|
|
|
2022-06-13 11:27:20 +00:00
|
|
|
class GenericBox;
|
2022-05-31 10:32:07 +00:00
|
|
|
class RadiobuttonGroup;
|
2022-05-17 00:04:44 +00:00
|
|
|
class VerticalLayout;
|
|
|
|
|
|
|
|
namespace Premium {
|
|
|
|
|
|
|
|
void AddBubbleRow(
|
|
|
|
not_null<Ui::VerticalLayout*> parent,
|
|
|
|
rpl::producer<> showFinishes,
|
|
|
|
int min,
|
|
|
|
int current,
|
|
|
|
int max,
|
2022-06-07 05:48:33 +00:00
|
|
|
bool premiumPossible,
|
2022-05-17 00:04:44 +00:00
|
|
|
std::optional<tr::phrase<lngtag_count>> phrase,
|
|
|
|
const style::icon *icon);
|
|
|
|
|
2022-06-14 10:54:30 +00:00
|
|
|
void AddLimitRow(
|
|
|
|
not_null<Ui::VerticalLayout*> parent,
|
|
|
|
QString max,
|
|
|
|
QString min = {});
|
|
|
|
|
2022-05-24 04:20:22 +00:00
|
|
|
void AddLimitRow(
|
|
|
|
not_null<Ui::VerticalLayout*> parent,
|
|
|
|
int max,
|
2022-05-31 10:32:07 +00:00
|
|
|
std::optional<tr::phrase<lngtag_count>> phrase,
|
|
|
|
int min = 0);
|
|
|
|
|
|
|
|
struct AccountsRowArgs final {
|
|
|
|
std::shared_ptr<Ui::RadiobuttonGroup> group;
|
|
|
|
const style::RoundImageCheckbox &st;
|
|
|
|
const style::TextStyle &stName;
|
|
|
|
const style::color &stNameFg;
|
|
|
|
struct Entry final {
|
|
|
|
QString name;
|
|
|
|
Ui::RoundImageCheckbox::PaintRoundImage paintRoundImage;
|
|
|
|
};
|
|
|
|
std::vector<Entry> entries;
|
|
|
|
};
|
|
|
|
|
|
|
|
void AddAccountsRow(
|
|
|
|
not_null<Ui::VerticalLayout*> parent,
|
|
|
|
AccountsRowArgs &&args);
|
2022-05-18 04:28:35 +00:00
|
|
|
|
2022-05-20 14:57:01 +00:00
|
|
|
[[nodiscard]] QGradientStops LimitGradientStops();
|
|
|
|
[[nodiscard]] QGradientStops ButtonGradientStops();
|
|
|
|
[[nodiscard]] QGradientStops LockGradientStops();
|
2022-06-13 11:27:20 +00:00
|
|
|
[[nodiscard]] QGradientStops FullHeightGradientStops();
|
2022-07-05 19:29:46 +00:00
|
|
|
[[nodiscard]] QGradientStops GiftGradientStops();
|
2022-06-13 11:27:20 +00:00
|
|
|
|
|
|
|
struct ListEntry final {
|
|
|
|
rpl::producer<QString> subtitle;
|
|
|
|
rpl::producer<TextWithEntities> description;
|
|
|
|
int leftNumber = 0;
|
|
|
|
int rightNumber = 0;
|
|
|
|
std::optional<QString> customRightText;
|
|
|
|
};
|
|
|
|
void ShowListBox(
|
|
|
|
not_null<Ui::GenericBox*> box,
|
|
|
|
std::vector<ListEntry> entries);
|
2022-05-20 14:57:01 +00:00
|
|
|
|
2022-07-05 19:29:46 +00:00
|
|
|
void AddGiftOptions(
|
|
|
|
not_null<Ui::VerticalLayout*> parent,
|
|
|
|
std::shared_ptr<Ui::RadiobuttonGroup> group,
|
2022-08-25 02:14:33 +00:00
|
|
|
std::vector<Data::SubscriptionOption> gifts);
|
2022-07-05 19:29:46 +00:00
|
|
|
|
2022-05-17 00:04:44 +00:00
|
|
|
} // namespace Premium
|
|
|
|
} // namespace Ui
|