tdlight/td/telegram/EmojiGroup.h

78 lines
1.8 KiB
C
Raw Normal View History

2023-01-24 16:11:02 +01:00
//
2024-01-01 01:07:21 +01:00
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
2023-01-24 16:11:02 +01:00
//
// 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/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/utils/common.h"
namespace td {
2023-02-09 20:47:44 +01:00
class StickersManager;
2023-01-24 16:11:02 +01:00
class EmojiGroup {
string title_;
CustomEmojiId icon_custom_emoji_id_;
vector<string> emojis_;
public:
EmojiGroup() = default;
2024-04-21 20:57:10 +02:00
explicit EmojiGroup(telegram_api::object_ptr<telegram_api::EmojiGroup> &&emoji_group);
2023-01-24 16:11:02 +01:00
2023-02-09 20:47:44 +01:00
td_api::object_ptr<td_api::emojiCategory> get_emoji_category_object(StickersManager *stickers_manager) const;
CustomEmojiId get_icon_custom_emoji_id() const {
return icon_custom_emoji_id_;
}
2023-01-24 16:11:02 +01:00
template <class StorerT>
void store(StorerT &storer) const;
template <class ParserT>
void parse(ParserT &parser);
};
class EmojiGroupList {
string used_language_codes_;
int32 hash_ = 0;
vector<EmojiGroup> emoji_groups_;
double next_reload_time_ = 0.0;
public:
EmojiGroupList() = default;
2023-01-25 14:23:34 +01:00
EmojiGroupList(string used_language_codes, int32 hash,
2024-04-21 20:57:10 +02:00
vector<telegram_api::object_ptr<telegram_api::EmojiGroup>> &&emoji_groups);
2023-01-24 16:11:02 +01:00
2023-02-09 20:47:44 +01:00
td_api::object_ptr<td_api::emojiCategories> get_emoji_categories_object(StickersManager *stickers_manager) const;
2023-01-24 16:11:02 +01:00
const string &get_used_language_codes() const {
return used_language_codes_;
}
int32 get_hash() const {
return hash_;
}
bool is_expired() const;
void update_next_reload_time();
2023-02-09 20:47:44 +01:00
vector<CustomEmojiId> get_icon_custom_emoji_ids() const;
2023-01-24 16:11:02 +01:00
template <class StorerT>
void store(StorerT &storer) const;
template <class ParserT>
void parse(ParserT &parser);
};
} // namespace td