tdesktop/Telegram/SourceFiles/data/data_reply_preview.h

51 lines
1.1 KiB
C
Raw 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
2020-05-29 14:08:18 +00:00
class Image;
class DocumentData;
class PhotoData;
namespace Data {
2020-05-25 14:16:04 +00:00
class PhotoMedia;
class DocumentMedia;
struct FileOrigin;
class ReplyPreview {
public:
explicit ReplyPreview(not_null<DocumentData*> document);
explicit ReplyPreview(not_null<PhotoData*> photo);
2020-05-29 14:08:18 +00:00
~ReplyPreview();
[[nodiscard]] Image *image(
Data::FileOrigin origin,
not_null<PeerData*> context,
bool spoiler);
[[nodiscard]] bool loaded(bool spoiler) const;
private:
void prepare(
not_null<Image*> image,
Images::Options options,
bool spoiler = false);
std::unique_ptr<Image> _regular;
std::unique_ptr<Image> _spoilered;
PhotoData *_photo = nullptr;
2020-05-25 14:16:04 +00:00
DocumentData *_document = nullptr;
std::shared_ptr<PhotoMedia> _photoMedia;
std::shared_ptr<DocumentMedia> _documentMedia;
2020-05-25 14:16:04 +00:00
bool _good = false;
bool _checkedRegular = false;
bool _checkedSpoilered = false;
};
} // namespace Data