Twitch SDK (Internal)
java_coreutil.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 
13 #include "twitchsdk/core/socket.h"
14 #include "twitchsdk/core/module.h"
15 
16 #include <unordered_map>
17 
18 namespace ttv
19 {
20  class CoreAPI;
21  class IChannelStatus;
22 
23  namespace binding
24  {
25  namespace java
26  {
27  class JavaCoreAPIListenerProxy;
28 
30  {
31  std::shared_ptr<ttv::CoreAPI> coreApi;
32  std::shared_ptr<JavaCoreAPIListenerProxy> nativeListener;
33  };
34 
37 
41  void LoadAllCoreJavaClassInfo(JNIEnv* jEnv);
42 
43  jobject GetJavaInstance_ErrorCode(JNIEnv* jEnv, TTV_ErrorCode err);
44  jobject GetJavaInstance_PubSubState(JNIEnv* jEnv, ttv::PubSubState state);
46  jobject GetJavaInstance_HttpParameter(JNIEnv* jEnv, const ttv::HttpParam& param);
47  jobject GetJavaInstance_HttpParameterArray(JNIEnv* jEnv, const std::vector<ttv::HttpParam>& params);
48  jobject GetJavaInstance_HttpRequestResult(JNIEnv* jEnv);
49  jobject GetJavaInstance_UserInfo(JNIEnv* jEnv, const ttv::UserInfo& userInfo);
50  jobject GetJavaInstance_UserInfoArray(JNIEnv* jEnv, const std::vector<ttv::UserInfo>& userInfoList);
51  jobject GetJavaInstance_StreamInfo(JNIEnv* jEnv, const ttv::StreamInfo& streamInfo);
52  jobject GetJavaInstance_ChannelInfo(JNIEnv* jEnv, const ttv::ChannelInfo& channelInfo);
53  jobject GetJavaInstance_WatchPartyUpdate(JNIEnv* jEnv, const ttv::WatchPartyUpdate& update);
54  jobject GetJavaInstance_ProfileImage(JNIEnv* jEnv, const ttv::ProfileImage& image);
55  jobject GetJavaInstance_ProfileImageArray(JNIEnv* jEnv, const std::vector<ttv::ProfileImage>& images);
56  jobject GetJavaInstance_TrackingValue(JNIEnv* jEnv, const TrackingValue& value);
57  jobject GetJavaInstance_PreviewImages(JNIEnv* jEnv, const PreviewImages& previewImages);
58 
59  void GetNativeInstance_HttpRequestResult(JNIEnv* jEnv, jobject jRequestResult, uint& statusCode, std::map<std::string, std::string>& resultHeaders, std::vector<char>& response);
60 
61  std::shared_ptr<ttv::CoreAPI> GetCoreApiInstance(jobject jCoreApi);
62  }
63  }
64 }
void GetNativeInstance_HttpRequestResult(JNIEnv *jEnv, jobject jRequestResult, uint &statusCode, std::map< std::string, std::string > &resultHeaders, std::vector< char > &response)
std::shared_ptr< ttv::CoreAPI > GetCoreApiInstance(jobject jCoreApi)
std::shared_ptr< JavaCoreAPIListenerProxy > nativeListener
Definition: java_coreutil.h:32
jobject GetJavaInstance_TrackingValue(JNIEnv *jEnv, const TrackingValue &value)
jobject GetJavaInstance_ProfileImageArray(JNIEnv *jEnv, const std::vector< ttv::ProfileImage > &images)
Definition: coretypes.h:32
jobject GetJavaInstance_WatchPartyUpdate(JNIEnv *jEnv, const ttv::WatchPartyUpdate &update)
jobject GetJavaInstance_StreamInfo(JNIEnv *jEnv, const ttv::StreamInfo &streamInfo)
Definition: coretypes.h:130
std::shared_ptr< ttv::CoreAPI > coreApi
Definition: java_coreutil.h:31
jobject GetJavaInstance_ErrorCode(JNIEnv *jEnv, TTV_ErrorCode err)
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
jobject GetJavaInstance_PreviewImages(JNIEnv *jEnv, const PreviewImages &previewImages)
jobject GetJavaInstance_HttpParameterArray(JNIEnv *jEnv, const std::vector< ttv::HttpParam > &params)
jobject GetJavaInstance_ChannelInfo(JNIEnv *jEnv, const ttv::ChannelInfo &channelInfo)
Definition: coretypes.h:89
JavaNativeProxyRegistry< ttv::IChannelStatus, CoreApiContext > gIChannelStatusInstanceRegistry
jobject GetJavaInstance_WebSocketMessageTypeEnum(JNIEnv *jEnv, ttv::IWebSocket::MessageType type)
jobject GetJavaInstance_UserInfoArray(JNIEnv *jEnv, const std::vector< ttv::UserInfo > &userInfoList)
Definition: coretypes.h:200
uint32_t TTV_ErrorCode
Definition: errortypes.h:30
PubSubState
Definition: coretypes.h:152
unsigned int uint
Definition: coretypes.h:18
Definition: coretypes.h:211
Definition: java_utility.h:57
jobject GetJavaInstance_UserInfo(JNIEnv *jEnv, const ttv::UserInfo &userInfo)
Definition: java_coreutil.h:29
JavaNativeProxyRegistry< ttv::CoreAPI, CoreApiContext > gCoreApiNativeProxyRegistry
Definition: coretypes.h:185
jobject GetJavaInstance_HttpParameter(JNIEnv *jEnv, const ttv::HttpParam &param)
jobject GetJavaInstance_ProfileImage(JNIEnv *jEnv, const ttv::ProfileImage &image)
jobject GetJavaInstance_PubSubState(JNIEnv *jEnv, ttv::PubSubState state)
Definition: coretypes.h:58
jobject GetJavaInstance_HttpRequestResult(JNIEnv *jEnv)
void LoadAllCoreJavaClassInfo(JNIEnv *jEnv)
MessageType
Definition: socket.h:296
Definition: httprequest.h:42