2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-24 19:27:17 +00:00
tdesktop/Telegram/SourceFiles/boxes/premium_preview_box.h

111 lines
2.2 KiB
C
Raw Permalink Normal View History

/*
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
#include "base/object_ptr.h"
class DocumentData;
namespace ChatHelpers {
class Show;
} // namespace ChatHelpers
2022-08-16 14:28:17 +03:00
namespace Data {
struct ReactionId;
} // namespace Data
namespace Ui {
class BoxContent;
class GenericBox;
class GradientButton;
} // namespace Ui
namespace Window {
class SessionController;
} // namespace Window
namespace Main {
class Session;
} // namespace Main
void ShowStickerPreviewBox(
std::shared_ptr<ChatHelpers::Show> show,
not_null<DocumentData*> document);
void DoubledLimitsPreviewBox(
not_null<Ui::GenericBox*> box,
not_null<Main::Session*> session);
2023-08-04 08:07:37 +02:00
void UpgradedStoriesPreviewBox(
not_null<Ui::GenericBox*> box,
not_null<Main::Session*> session);
void TelegramBusinessPreviewBox(
not_null<Ui::GenericBox*> box,
not_null<Main::Session*> session);
enum class PremiumFeature {
// Premium features.
2023-08-04 08:07:37 +02:00
Stories,
DoubleLimits,
2022-06-10 12:03:47 +04:00
MoreUpload,
FasterDownload,
VoiceToText,
NoAds,
EmojiStatus,
InfiniteReactions,
Stickers,
2022-07-15 12:45:44 +03:00
AnimatedEmoji,
2022-06-10 12:03:47 +04:00
AdvancedChatManagement,
ProfileBadge,
AnimatedUserpics,
2023-01-30 14:10:42 +04:00
RealTimeTranslation,
Wallpapers,
2024-01-26 17:19:28 +04:00
TagsForMessages,
2024-02-02 17:37:41 +04:00
LastSeen,
MessagePrivacy,
Business,
2024-06-29 11:29:09 +04:00
Effects,
FilterTags,
2025-06-10 20:25:24 +04:00
TodoLists,
2022-06-10 12:03:47 +04:00
// Business features.
BusinessLocation,
BusinessHours,
QuickReplies,
GreetingMessage,
AwayMessage,
BusinessBots,
ChatIntro,
ChatLinks,
2022-06-10 12:03:47 +04:00
kCount,
};
2022-08-16 14:28:17 +03:00
void ShowPremiumPreviewBox(
not_null<Window::SessionController*> controller,
PremiumFeature section,
Fn<void(not_null<Ui::BoxContent*>)> shown = nullptr);
void ShowPremiumPreviewBox(
std::shared_ptr<ChatHelpers::Show> show,
PremiumFeature section,
Fn<void(not_null<Ui::BoxContent*>)> shown = nullptr,
bool hideSubscriptionButton = false);
2022-06-14 13:42:43 +04:00
void ShowPremiumPreviewToBuy(
not_null<Window::SessionController*> controller,
PremiumFeature section,
Fn<void()> hiddenCallback = nullptr);
2022-06-14 13:42:43 +04:00
void PremiumUnavailableBox(not_null<Ui::GenericBox*> box);
[[nodiscard]] object_ptr<Ui::GradientButton> CreateUnlockButton(
QWidget *parent,
rpl::producer<QString> text);