/* 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 "mtproto/sender.h" class DocumentData; namespace Data { class DocumentMedia; } // namespace Data namespace Main { class Session; } // namespace Main namespace Storage { namespace Cache { struct Key; } // namespace Cache } // namespace Storage namespace Lottie { class SinglePlayer; class MultiPlayer; class FrameRenderer; class Animation; enum class Quality : char; struct ColorReplacements; } // namespace Lottie namespace Stickers { constexpr auto DefaultSetId = 0; // for backward compatibility constexpr auto CustomSetId = 0xFFFFFFFFFFFFFFFFULL; constexpr auto RecentSetId = 0xFFFFFFFFFFFFFFFEULL; // for emoji/stickers panel, should not appear in Sets constexpr auto NoneSetId = 0xFFFFFFFFFFFFFFFDULL; // for emoji/stickers panel, should not appear in Sets constexpr auto CloudRecentSetId = 0xFFFFFFFFFFFFFFFCULL; // for cloud-stored recent stickers constexpr auto FeaturedSetId = 0xFFFFFFFFFFFFFFFBULL; // for emoji/stickers panel, should not appear in Sets constexpr auto FavedSetId = 0xFFFFFFFFFFFFFFFAULL; // for cloud-stored faved stickers constexpr auto MegagroupSetId = 0xFFFFFFFFFFFFFFEFULL; // for setting up megagroup sticker set class Set; void ApplyArchivedResult(const MTPDmessages_stickerSetInstallResultArchive &d); bool ApplyArchivedResultFake(); // For testing. void InstallLocally(uint64 setId); void UndoInstallLocally(uint64 setId); bool IsFaved(not_null document); void SetFaved(not_null document, bool faved); void SetsReceived(const QVector &data, int32 hash); void SpecialSetReceived( uint64 setId, const QString &setTitle, const QVector &items, int32 hash, const QVector &packs = QVector(), const QVector &usageDates = QVector()); void FeaturedSetsReceived( const QVector &list, const QVector &unread, int32 hash); void GifsReceived(const QVector &items, int32 hash); std::vector> GetListByEmoji( not_null session, not_null emoji, uint64 seed); std::optional>> GetEmojiListFromSet( not_null document); Set *FeedSet(const MTPDstickerSet &data); Set *FeedSetFull(const MTPmessages_StickerSet &data); void NewSetReceived(const MTPmessages_StickerSet &data); QString GetSetTitle(const MTPDstickerSet &s); RecentStickerPack &GetRecentPack(); enum class LottieSize : uchar { MessageHistory, StickerSet, StickersPanel, StickersFooter, SetsListThumbnail, InlineResults, }; [[nodiscard]] std::unique_ptr LottiePlayerFromDocument( not_null media, LottieSize sizeTag, QSize box, Lottie::Quality quality = Lottie::Quality(), std::shared_ptr renderer = nullptr); [[nodiscard]] std::unique_ptr LottiePlayerFromDocument( not_null media, const Lottie::ColorReplacements *replacements, LottieSize sizeTag, QSize box, Lottie::Quality quality = Lottie::Quality(), std::shared_ptr renderer = nullptr); [[nodiscard]] not_null LottieAnimationFromDocument( not_null player, not_null media, LottieSize sizeTag, QSize box); [[nodiscard]] bool HasLottieThumbnail( ImagePtr thumbnail, not_null media); [[nodiscard]] std::unique_ptr LottieThumbnail( ImagePtr thumbnail, not_null media, LottieSize sizeTag, QSize box, std::shared_ptr renderer = nullptr); } // namespace Stickers