/* 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 "styles/style_widgets.h" namespace Ui { class Show; class RpWidget; } // namespace Ui namespace Ui::Toast { class Instance; } // namespace Ui::Toast namespace Window { class SessionController; } // namespace Window namespace HistoryView { class StickerToast final { public: StickerToast( not_null controller, not_null parent, Fn destroy); ~StickerToast(); enum class Section { Message, TopicIcon, }; void showFor( not_null document, Section section = Section::Message); private: void requestSet(); void cancelRequest(); void showWithTitle(const QString &title); [[nodiscard]] QString lookupTitle() const; void setupEmojiPreview(not_null widget, int size); void setupLottiePreview(not_null widget, int size); void clearHiddenHiding(); const not_null _controller; const not_null _parent; Section _section = {}; style::Toast _st; base::weak_ptr _weak; std::vector> _hiding; DocumentData *_for = nullptr; Fn _destroy; mtpRequestId _setRequestId = 0; }; } // namespace HistoryView