2021-01-19 11:14:50 +04: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
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
2024-08-06 15:54:19 +03:00
|
|
|
class GenericBox;
|
2024-08-08 14:17:55 +03:00
|
|
|
class NumberInput;
|
2024-08-06 15:54:19 +03:00
|
|
|
class SettingsButton;
|
|
|
|
|
2021-01-19 11:14:50 +04:00
|
|
|
struct InviteLinkFields {
|
|
|
|
QString link;
|
2021-10-28 16:18:49 +04:00
|
|
|
QString label;
|
2021-01-19 11:14:50 +04:00
|
|
|
TimeId expireDate = 0;
|
|
|
|
int usageLimit = 0;
|
2024-08-08 14:17:55 +03:00
|
|
|
int subscriptionCredits = 0;
|
2021-10-12 12:39:07 +04:00
|
|
|
bool requestApproval = false;
|
|
|
|
bool isGroup = false;
|
2021-11-03 16:01:25 +04:00
|
|
|
bool isPublic = false;
|
2021-01-19 11:14:50 +04:00
|
|
|
};
|
|
|
|
|
2024-08-08 14:17:55 +03:00
|
|
|
struct InviteLinkSubscriptionToggle final {
|
|
|
|
not_null<Ui::SettingsButton*> button;
|
|
|
|
not_null<Ui::NumberInput*> amount;
|
|
|
|
};
|
|
|
|
|
2021-01-19 11:14:50 +04:00
|
|
|
void EditInviteLinkBox(
|
|
|
|
not_null<Ui::GenericBox*> box,
|
2024-08-08 14:17:55 +03:00
|
|
|
Fn<InviteLinkSubscriptionToggle()> fillSubscription,
|
2021-01-19 11:14:50 +04:00
|
|
|
const InviteLinkFields &data,
|
|
|
|
Fn<void(InviteLinkFields)> done);
|
|
|
|
|
|
|
|
void CreateInviteLinkBox(
|
|
|
|
not_null<Ui::GenericBox*> box,
|
2024-08-08 14:17:55 +03:00
|
|
|
Fn<InviteLinkSubscriptionToggle()> fillSubscription,
|
2021-10-12 12:39:07 +04:00
|
|
|
bool isGroup,
|
2021-11-03 16:01:25 +04:00
|
|
|
bool isPublic,
|
2021-01-19 11:14:50 +04:00
|
|
|
Fn<void(InviteLinkFields)> done);
|
|
|
|
|
|
|
|
} // namespace Ui
|