2016-04-09 05:57:55 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2016-04-09 05:57:55 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2016-04-09 05:57:55 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2017-09-26 11:49:16 +00:00
|
|
|
#include "data/data_document.h"
|
2016-04-09 05:57:55 +00:00
|
|
|
|
|
|
|
namespace Serialize {
|
|
|
|
|
|
|
|
class Document {
|
|
|
|
public:
|
|
|
|
struct StickerSetInfo {
|
|
|
|
StickerSetInfo(uint64 setId, uint64 accessHash, QString shortName)
|
|
|
|
: setId(setId)
|
|
|
|
, accessHash(accessHash)
|
|
|
|
, shortName(shortName) {
|
|
|
|
}
|
|
|
|
uint64 setId;
|
|
|
|
uint64 accessHash;
|
|
|
|
QString shortName;
|
|
|
|
};
|
|
|
|
|
|
|
|
static void writeToStream(QDataStream &stream, DocumentData *document);
|
2020-06-10 10:49:10 +00:00
|
|
|
static DocumentData *readStickerFromStream(
|
|
|
|
not_null<Main::Session*> session,
|
|
|
|
int streamAppVersion,
|
|
|
|
QDataStream &stream,
|
|
|
|
const StickerSetInfo &info);
|
|
|
|
static DocumentData *readFromStream(
|
|
|
|
not_null<Main::Session*> session,
|
|
|
|
int streamAppVersion,
|
|
|
|
QDataStream &stream);
|
2016-04-09 05:57:55 +00:00
|
|
|
static int sizeInStream(DocumentData *document);
|
|
|
|
|
|
|
|
private:
|
2020-06-10 10:49:10 +00:00
|
|
|
static DocumentData *readFromStreamHelper(
|
|
|
|
not_null<Main::Session*> session,
|
|
|
|
int streamAppVersion,
|
|
|
|
QDataStream &stream,
|
|
|
|
const StickerSetInfo *info);
|
2016-04-09 05:57:55 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Serialize
|