tdlight/td/telegram/StickerPhotoSize.h

58 lines
1.8 KiB
C
Raw Normal View History

//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/telegram/CustomEmojiId.h"
#include "td/telegram/StickerSetId.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/utils/common.h"
2023-01-21 00:07:42 +01:00
#include "td/utils/Status.h"
#include "td/utils/StringBuilder.h"
namespace td {
class Td;
2023-01-23 11:02:10 +01:00
class StickerPhotoSize {
enum class Type : int32 { Sticker, CustomEmoji };
2023-01-23 10:05:08 +01:00
Type type_ = Type::CustomEmoji;
CustomEmojiId custom_emoji_id_;
StickerSetId sticker_set_id_;
int64 sticker_id_ = 0;
vector<int32> background_colors_;
2023-01-23 11:02:10 +01:00
friend bool operator==(const StickerPhotoSize &lhs, const StickerPhotoSize &rhs);
friend StringBuilder &operator<<(StringBuilder &string_builder, const StickerPhotoSize &sticker_photo_size);
public:
static Result<unique_ptr<StickerPhotoSize>> get_sticker_photo_size(
Td *td, const td_api::object_ptr<td_api::chatPhotoSticker> &chat_photo_sticker);
2023-01-23 11:02:10 +01:00
static unique_ptr<StickerPhotoSize> get_sticker_photo_size(
Td *td, telegram_api::object_ptr<telegram_api::VideoSize> &&size_ptr);
2023-01-23 11:02:10 +01:00
telegram_api::object_ptr<telegram_api::VideoSize> get_input_video_size_object(Td *td) const;
2023-01-23 11:02:10 +01:00
td_api::object_ptr<td_api::chatPhotoSticker> get_chat_photo_sticker_object() const;
template <class StorerT>
void store(StorerT &storer) const;
template <class ParserT>
void parse(ParserT &parser);
};
2023-01-23 09:51:00 +01:00
bool operator==(const StickerPhotoSize &lhs, const StickerPhotoSize &rhs);
bool operator!=(const StickerPhotoSize &lhs, const StickerPhotoSize &rhs);
StringBuilder &operator<<(StringBuilder &string_builder, const StickerPhotoSize &sticker_photo_size);
} // namespace td