gift_premium_box.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. #include "mtproto/sender.h"
  9. namespace Api {
  10. struct GiftCode;
  11. } // namespace Api
  12. namespace ChatHelpers {
  13. class Show;
  14. } // namespace ChatHelpers
  15. namespace Data {
  16. struct Boost;
  17. struct CreditsHistoryEntry;
  18. struct GiveawayStart;
  19. struct GiveawayResults;
  20. struct SubscriptionEntry;
  21. } // namespace Data
  22. namespace Main {
  23. class Session;
  24. } // namespace Main
  25. namespace Settings {
  26. struct CreditsEntryBoxStyleOverrides;
  27. } // namespace Settings
  28. namespace Ui {
  29. class GenericBox;
  30. class VerticalLayout;
  31. } // namespace Ui
  32. namespace Window {
  33. class SessionNavigation;
  34. } // namespace Window
  35. [[nodiscard]] rpl::producer<QString> GiftDurationValue(int months);
  36. [[nodiscard]] QString GiftDuration(int months);
  37. void GiftCodeBox(
  38. not_null<Ui::GenericBox*> box,
  39. not_null<Window::SessionNavigation*> controller,
  40. const QString &slug);
  41. void GiftCodePendingBox(
  42. not_null<Ui::GenericBox*> box,
  43. not_null<Window::SessionNavigation*> controller,
  44. const Api::GiftCode &data);
  45. void ResolveGiftCode(
  46. not_null<Window::SessionNavigation*> controller,
  47. const QString &slug,
  48. PeerId fromId = 0,
  49. PeerId toId = 0);
  50. void ResolveGiveawayInfo(
  51. not_null<Window::SessionNavigation*> controller,
  52. not_null<PeerData*> peer,
  53. MsgId messageId,
  54. std::optional<Data::GiveawayStart> start,
  55. std::optional<Data::GiveawayResults> results);
  56. [[nodiscard]] QString TonAddressUrl(
  57. not_null<Main::Session*> session,
  58. const QString &address);
  59. void AddStarGiftTable(
  60. std::shared_ptr<ChatHelpers::Show> show,
  61. not_null<Ui::VerticalLayout*> container,
  62. Settings::CreditsEntryBoxStyleOverrides st,
  63. const Data::CreditsHistoryEntry &entry,
  64. Fn<void()> convertToStars,
  65. Fn<void()> startUpgrade);
  66. void AddCreditsHistoryEntryTable(
  67. std::shared_ptr<ChatHelpers::Show> show,
  68. not_null<Ui::VerticalLayout*> container,
  69. Settings::CreditsEntryBoxStyleOverrides st,
  70. const Data::CreditsHistoryEntry &entry);
  71. void AddSubscriptionEntryTable(
  72. std::shared_ptr<ChatHelpers::Show> show,
  73. not_null<Ui::VerticalLayout*> container,
  74. Settings::CreditsEntryBoxStyleOverrides st,
  75. const Data::SubscriptionEntry &s);
  76. void AddSubscriberEntryTable(
  77. std::shared_ptr<ChatHelpers::Show> show,
  78. not_null<Ui::VerticalLayout*> container,
  79. Settings::CreditsEntryBoxStyleOverrides st,
  80. not_null<PeerData*> peer,
  81. TimeId date);
  82. void AddCreditsBoostTable(
  83. std::shared_ptr<ChatHelpers::Show> show,
  84. not_null<Ui::VerticalLayout*> container,
  85. Settings::CreditsEntryBoxStyleOverrides st,
  86. const Data::Boost &boost);