2020-04-08 15:09:29 +00:00
|
|
|
/*
|
|
|
|
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;
|
2020-04-08 15:09:29 +00:00
|
|
|
class DocumentData;
|
|
|
|
class PhotoData;
|
|
|
|
|
|
|
|
namespace Data {
|
|
|
|
|
2020-05-25 14:16:04 +00:00
|
|
|
class PhotoMedia;
|
2020-04-08 15:09:29 +00:00
|
|
|
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();
|
2020-04-08 15:09:29 +00:00
|
|
|
|
2021-12-03 10:59:08 +00:00
|
|
|
[[nodiscard]] Image *image(
|
|
|
|
Data::FileOrigin origin,
|
2022-12-30 09:37:34 +00:00
|
|
|
not_null<PeerData*> context,
|
|
|
|
bool spoiler);
|
|
|
|
[[nodiscard]] bool loaded(bool spoiler) const;
|
2020-04-08 15:09:29 +00:00
|
|
|
|
|
|
|
private:
|
2022-12-30 09:37:34 +00:00
|
|
|
void prepare(
|
|
|
|
not_null<Image*> image,
|
|
|
|
Images::Options options,
|
|
|
|
bool spoiler = false);
|
2020-04-08 15:09:29 +00:00
|
|
|
|
2022-12-30 09:37:34 +00:00
|
|
|
std::unique_ptr<Image> _regular;
|
|
|
|
std::unique_ptr<Image> _spoilered;
|
2020-04-08 15:09:29 +00:00
|
|
|
PhotoData *_photo = nullptr;
|
2020-05-25 14:16:04 +00:00
|
|
|
DocumentData *_document = nullptr;
|
|
|
|
std::shared_ptr<PhotoMedia> _photoMedia;
|
2020-04-08 15:09:29 +00:00
|
|
|
std::shared_ptr<DocumentMedia> _documentMedia;
|
2020-05-25 14:16:04 +00:00
|
|
|
bool _good = false;
|
2022-12-30 09:37:34 +00:00
|
|
|
bool _checkedRegular = false;
|
|
|
|
bool _checkedSpoilered = false;
|
2020-04-08 15:09:29 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Data
|