premium_preview_box.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 "base/object_ptr.h"
  9. class DocumentData;
  10. namespace ChatHelpers {
  11. class Show;
  12. } // namespace ChatHelpers
  13. namespace Data {
  14. struct ReactionId;
  15. } // namespace Data
  16. namespace Ui {
  17. class BoxContent;
  18. class GenericBox;
  19. class GradientButton;
  20. } // namespace Ui
  21. namespace Window {
  22. class SessionController;
  23. } // namespace Window
  24. namespace Main {
  25. class Session;
  26. } // namespace Main
  27. void ShowStickerPreviewBox(
  28. std::shared_ptr<ChatHelpers::Show> show,
  29. not_null<DocumentData*> document);
  30. void DoubledLimitsPreviewBox(
  31. not_null<Ui::GenericBox*> box,
  32. not_null<Main::Session*> session);
  33. void UpgradedStoriesPreviewBox(
  34. not_null<Ui::GenericBox*> box,
  35. not_null<Main::Session*> session);
  36. void TelegramBusinessPreviewBox(
  37. not_null<Ui::GenericBox*> box,
  38. not_null<Main::Session*> session);
  39. enum class PremiumFeature {
  40. // Premium features.
  41. Stories,
  42. DoubleLimits,
  43. MoreUpload,
  44. FasterDownload,
  45. VoiceToText,
  46. NoAds,
  47. EmojiStatus,
  48. InfiniteReactions,
  49. Stickers,
  50. AnimatedEmoji,
  51. AdvancedChatManagement,
  52. ProfileBadge,
  53. AnimatedUserpics,
  54. RealTimeTranslation,
  55. Wallpapers,
  56. TagsForMessages,
  57. LastSeen,
  58. MessagePrivacy,
  59. Business,
  60. Effects,
  61. FilterTags,
  62. // Business features.
  63. BusinessLocation,
  64. BusinessHours,
  65. QuickReplies,
  66. GreetingMessage,
  67. AwayMessage,
  68. BusinessBots,
  69. ChatIntro,
  70. ChatLinks,
  71. kCount,
  72. };
  73. void ShowPremiumPreviewBox(
  74. not_null<Window::SessionController*> controller,
  75. PremiumFeature section,
  76. Fn<void(not_null<Ui::BoxContent*>)> shown = nullptr);
  77. void ShowPremiumPreviewBox(
  78. std::shared_ptr<ChatHelpers::Show> show,
  79. PremiumFeature section,
  80. Fn<void(not_null<Ui::BoxContent*>)> shown = nullptr,
  81. bool hideSubscriptionButton = false);
  82. void ShowPremiumPreviewToBuy(
  83. not_null<Window::SessionController*> controller,
  84. PremiumFeature section,
  85. Fn<void()> hiddenCallback = nullptr);
  86. void PremiumUnavailableBox(not_null<Ui::GenericBox*> box);
  87. [[nodiscard]] object_ptr<Ui::GradientButton> CreateUnlockButton(
  88. QWidget *parent,
  89. rpl::producer<QString> text);