ZaStoGram_desktop/Telegram/SourceFiles/chat_helpers/stickers_emoji_image_loader.h
John Preston 7b7593dd57 Draw widget text emoji from the app's own emoji set
Task: 2026/10/26/draw-emoji-in-widget-text-from-the-apps-own-emoji-set
2026-11-05 17:12:55 +04:00

36 lines
935 B
C++

/*
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 <crl/crl_object_on_queue.h>
#include "ui/emoji_config.h"
namespace Stickers {
class EmojiImageLoader {
public:
using UniversalImages = Ui::Emoji::UniversalImages;
explicit EmojiImageLoader(crl::weak_on_queue<EmojiImageLoader> weak);
void init(
std::shared_ptr<UniversalImages> images,
bool largeEnabled);
[[nodiscard]] QImage prepare(EmojiPtr emoji) const;
[[nodiscard]] QImage prepareWithoutOutline(EmojiPtr emoji) const;
void switchTo(std::shared_ptr<UniversalImages> images);
std::shared_ptr<UniversalImages> releaseImages();
private:
crl::weak_on_queue<EmojiImageLoader> _weak;
std::shared_ptr<UniversalImages> _images;
};
} // namespace Stickers