Chatterino
BttvEmotes.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include "boost/optional.hpp"
5 #include "common/Aliases.hpp"
6 #include "common/Atomic.hpp"
8 
9 namespace chatterino {
10 
11 struct Emote;
12 using EmotePtr = std::shared_ptr<const Emote>;
13 class EmoteMap;
14 
15 class BttvEmotes final
16 {
17  static constexpr const char *globalEmoteApiUrl =
18  "https://api.betterttv.net/3/cached/emotes/global";
19  static constexpr const char *bttvChannelEmoteApiUrl =
20  "https://api.betterttv.net/3/cached/users/twitch/";
21 
22 public:
23  BttvEmotes();
24 
25  std::shared_ptr<const EmoteMap> emotes() const;
26  boost::optional<EmotePtr> emote(const EmoteName &name) const;
27  void loadEmotes();
28  static void loadChannel(std::weak_ptr<Channel> channel,
29  const QString &channelId,
30  const QString &channelDisplayName,
31  std::function<void(EmoteMap &&)> callback,
32  bool manualRefresh);
33 
34 private:
36 };
37 
38 } // namespace chatterino
static void loadChannel(std::weak_ptr< Channel > channel, const QString &channelId, const QString &channelDisplayName, std::function< void(EmoteMap &&)> callback, bool manualRefresh)
Definition: BttvEmotes.cpp:164
Definition: BttvEmotes.hpp:15
Definition: Application.cpp:48
std::shared_ptr< const EmoteMap > emotes() const
Definition: BttvEmotes.cpp:128
std::shared_ptr< const Emote > EmotePtr
Definition: Emote.hpp:38
Definition: Emote.hpp:40
BttvEmotes()
Definition: BttvEmotes.cpp:123
boost::optional< EmotePtr > emote(const EmoteName &name) const
Definition: BttvEmotes.cpp:133
QString name
Definition: Credentials.cpp:94
void loadEmotes()
Definition: BttvEmotes.cpp:143
Definition: Atomic.hpp:9