Twitch SDK (Internal)
java_chatchannellistenerproxy.h
Go to the documentation of this file.
1 /********************************************************************************************
2 * Twitch Broadcasting SDK
3 *
4 * This software is supplied under the terms of a license agreement with Twitch Interactive, Inc. and
5 * may not be copied or used except in accordance with the terms of that agreement
6 * Copyright (c) 2012-2016 Twitch Interactive, Inc.
7 *********************************************************************************************/
8 
9 #pragma once
10 
14 
15 
16 namespace ttv
17 {
18  using namespace ttv::chat;
19 
20  namespace chat
21  {
22  class ChatAPI;
23  }
24 
25  namespace binding
26  {
27  namespace java
28  {
29  class JavaChatChannelListenerProxy;
30  }
31  }
32 }
33 
34 
36 {
37 public:
38  typedef std::function<void(UserId userId, ChannelId channelId)> ChannelDisconnectedFunc;
39 
40 public:
42 
43  void SetChatApi(std::shared_ptr<ChatAPI> api) { mChatApi = api; }
44  void SetChannelDisconnectedFunc(ChannelDisconnectedFunc func) { mChannelDisconnectedCallback = func; }
45 
46 public:
47  virtual void ChatChannelStateChanged(UserId userId, ChannelId channelId, ChatChannelState state, TTV_ErrorCode ec) override;
48  virtual void ChatChannelInfoChanged(UserId userId, ChannelId channelId, const ChatChannelInfo& channelInfo) override;
49  virtual void ChatChannelRestrictionsChanged(UserId userId, ChannelId channelId, const ChatChannelRestrictions& restrictions) override;
50  virtual void ChatChannelLocalUserChanged(UserId userId, ChannelId channelId, const ChatUserInfo& userInfo) override;
51  virtual void ChatChannelMessagesReceived(UserId userId, ChannelId channelId, const std::vector<LiveChatMessage>& messageList) override;
52  virtual void ChatChannelSubscriptionNoticeReceived(UserId userId, ChannelId channelId, const SubscriptionNotice& notice) override;
53  virtual void ChatChannelFirstTimeChatterNoticeReceived(UserId userId, ChannelId channelId, const FirstTimeChatterNotice& notice) override;
54  virtual void ChatChannelRaidNoticeReceived(UserId userId, ChannelId channelId, const RaidNotice& notice) override;
55  virtual void ChatChannelUnraidNoticeReceived(UserId userId, ChannelId channelId, const UnraidNotice& notice) override;
56  virtual void ChatChannelMessagesCleared(UserId userId, ChannelId channelId) override;
57  virtual void ChatChannelUserMessagesCleared(UserId userId, ChannelId channelId, UserId clearUserId) override;
58  virtual void ChatChannelHostTargetChanged(UserId userId, ChannelId channelId, const std::string& targetChannel, uint32_t numViewers) override;
59  virtual void ChatChannelNoticeReceived(UserId userId, ChannelId channelId, const std::string& id, const std::map<std::string, std::string>& params) override;
60 
61 private:
62  std::weak_ptr<ChatAPI> mChatApi;
63  ChannelDisconnectedFunc mChannelDisconnectedCallback;
64 };
uint32_t UserId
Definition: coretypes.h:22
Definition: chattypes.h:161
Definition: java_nativelistener.h:23
Definition: chattypes.h:369
Definition: chatapi.h:33
Definition: chattypes.h:169
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
std::function< void(UserId userId, ChannelId channelId)> ChannelDisconnectedFunc
Definition: java_chatchannellistenerproxy.h:38
ChannelDisconnectedFunc mChannelDisconnectedCallback
Definition: java_chatchannellistenerproxy.h:63
uint32_t TTV_ErrorCode
Definition: errortypes.h:30
ChatChannelState
Definition: chattypes.h:60
Definition: java_chatchannellistenerproxy.h:35
void SetChannelDisconnectedFunc(ChannelDisconnectedFunc func)
Definition: java_chatchannellistenerproxy.h:44
std::weak_ptr< ChatAPI > mChatApi
Definition: java_chatchannellistenerproxy.h:62
uint32_t ChannelId
Definition: coretypes.h:23
void SetChatApi(std::shared_ptr< ChatAPI > api)
Definition: java_chatchannellistenerproxy.h:43
Definition: chattypes.h:447
Definition: chattypes.h:126
Definition: chatapi.h:74
Definition: chattypes.h:434
Definition: chattypes.h:423