edit_invite_link.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. namespace Ui {
  9. class GenericBox;
  10. class NumberInput;
  11. class SettingsButton;
  12. struct InviteLinkFields {
  13. QString link;
  14. QString label;
  15. TimeId expireDate = 0;
  16. int usageLimit = 0;
  17. int subscriptionCredits = 0;
  18. bool requestApproval = false;
  19. bool isGroup = false;
  20. bool isPublic = false;
  21. };
  22. struct InviteLinkSubscriptionToggle final {
  23. not_null<Ui::SettingsButton*> button;
  24. not_null<Ui::NumberInput*> amount;
  25. };
  26. void EditInviteLinkBox(
  27. not_null<Ui::GenericBox*> box,
  28. Fn<InviteLinkSubscriptionToggle()> fillSubscription,
  29. const InviteLinkFields &data,
  30. Fn<void(InviteLinkFields)> done);
  31. void CreateInviteLinkBox(
  32. not_null<Ui::GenericBox*> box,
  33. Fn<InviteLinkSubscriptionToggle()> fillSubscription,
  34. bool isGroup,
  35. bool isPublic,
  36. Fn<void(InviteLinkFields)> done);
  37. } // namespace Ui