remove AnySDK and Cocos Analytics
This commit is contained in:
parent
e6dfefd51e
commit
b2fe89a30d
|
|
@ -128,16 +128,5 @@ LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libuv.a
|
||||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/$(TARGET_ARCH_ABI)/include/uv
|
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/$(TARGET_ARCH_ABI)/include/uv
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
include $(PREBUILT_STATIC_LIBRARY)
|
||||||
|
|
||||||
#======================================
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
|
|
||||||
LOCAL_MODULE := PluginProtocolStatic
|
|
||||||
LOCAL_MODULE_FILENAME := libPluginProtocolStatic
|
|
||||||
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/libPluginProtocolStatic.a
|
|
||||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/$(TARGET_ARCH_ABI)/include/anysdk
|
|
||||||
LOCAL_EXPORT_LDLIBS += -llog
|
|
||||||
LOCAL_EXPORT_LDLIBS += -lz
|
|
||||||
|
|
||||||
include $(PREBUILT_STATIC_LIBRARY)
|
|
||||||
#======================================
|
#======================================
|
||||||
#$(call import-module,android/cpufeatures)
|
#$(call import-module,android/cpufeatures)
|
||||||
|
|
|
||||||
|
|
@ -1,245 +0,0 @@
|
||||||
/** @file AgentManager.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __CCX_AGENTMANAGER_H__
|
|
||||||
#define __CCX_AGENTMANAGER_H__
|
|
||||||
|
|
||||||
#include "PluginManager.h"
|
|
||||||
#include "ProtocolIAP.h"
|
|
||||||
#include "ProtocolAnalytics.h"
|
|
||||||
#include "ProtocolShare.h"
|
|
||||||
#include "ProtocolAds.h"
|
|
||||||
#include "ProtocolSocial.h"
|
|
||||||
#include "ProtocolUser.h"
|
|
||||||
#include "ProtocolPush.h"
|
|
||||||
#include "ProtocolCrash.h"
|
|
||||||
#include "ProtocolREC.h"
|
|
||||||
#include "ProtocolCustom.h"
|
|
||||||
#include "ProtocolAdTracking.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/** @brief Plugin_type enum, with inline docs */
|
|
||||||
typedef enum {
|
|
||||||
kPluginAds = 16,/**< enum value is the type of Ads. */
|
|
||||||
kPluginAnalytics = 1,/**< enum value is the type of Analytics. */
|
|
||||||
kPluginIAP = 8,/**< enum value is the type of IAP. */
|
|
||||||
kPluginShare = 2,/**< enum value is the type of Share. */
|
|
||||||
kPluginUser = 32,/**< enum value is the type of User. */
|
|
||||||
kPluginSocial = 4,/**< enum value is the type of Social. */
|
|
||||||
kPluginPush = 64,/**< enum value is the type of Push. */
|
|
||||||
kPluginCrash = 128,/**< enum value is the type of Crash. */
|
|
||||||
kPluginCustom = 256,/**< enum value is the type of Custom. */
|
|
||||||
kPluginREC = 512,/**< enum value is the type of REC. */
|
|
||||||
kPluginAdTracking = 1024,/**< enum value is the type of AdTracking. */
|
|
||||||
}Plugin_type;
|
|
||||||
/**
|
|
||||||
* @class AgentManager
|
|
||||||
*/
|
|
||||||
class AgentManager
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~AgentManager();
|
|
||||||
/**
|
|
||||||
@brief Get singleton of AgentManager
|
|
||||||
*/
|
|
||||||
|
|
||||||
static AgentManager* getInstance();
|
|
||||||
/**
|
|
||||||
@brief Destory the instance of AgentManager
|
|
||||||
*/
|
|
||||||
static void end();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@breif the init of AgentManager
|
|
||||||
@param the appKey of anysdk
|
|
||||||
@param the appSecret of anysdk
|
|
||||||
@param the privateKey of anysdk
|
|
||||||
@param the url of oauthLoginServer
|
|
||||||
@warning Must invoke this interface before loadAllPlugins
|
|
||||||
*/
|
|
||||||
void init(std::string appKey,std::string appSecret,std::string privateKey,std::string oauthLoginServer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief load the plugins
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE void loadALLPlugin();
|
|
||||||
/**
|
|
||||||
@brief unload the plugins
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE void unloadALLPlugin();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief load the plugins
|
|
||||||
*/
|
|
||||||
void loadAllPlugins();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief unload the plugins
|
|
||||||
*/
|
|
||||||
void unloadAllPlugins();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Analytics plugin
|
|
||||||
@return if Analytics plugin exist ,return value is Analytics plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolAnalytics* getAnalyticsPlugin(){return _pAnalytics;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get User plugin
|
|
||||||
@return if User plugin exist ,return value is User plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolUser* getUserPlugin(){return _pUser;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get IAP plugin
|
|
||||||
@return if IAP plugin exist ,return value is IAP plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
std::map<std::string , ProtocolIAP*>* getIAPPlugin(){return &_pluginsIAPMap;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Share plugin
|
|
||||||
@return if Share plugin exist ,return value is Share plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolShare* getSharePlugin(){return _pShare;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Social plugin
|
|
||||||
@return if Social plugin exist ,return value is Social plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolSocial* getSocialPlugin(){return _pSocial;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Ads plugin
|
|
||||||
@return if Ads plugin exist ,return value is Ads plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolAds* getAdsPlugin(){return _pAds;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Push plugin
|
|
||||||
@return if Push plugin exist ,return value is Push plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolPush* getPushPlugin(){return _pPush;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Crash plugin
|
|
||||||
@return if Crash plugin exist ,return value is Crash plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolCrash* getCrashPlugin(){return _pCrash;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Custom plugin
|
|
||||||
@return if Crash plugin exist ,return value is Custom plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolCustom* getCustomPlugin(){return _pCustom;};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get REC plugin
|
|
||||||
@return if REC plugin exist ,return value is REC plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolREC* getRECPlugin(){return _pREC;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get AdTracking plugin
|
|
||||||
@return if AdTracking plugin exist ,return value is AdTracking plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolAdTracking* getAdTrackingPlugin(){return _pAdTracking;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get channel ID
|
|
||||||
@return return value is channel ID.
|
|
||||||
*/
|
|
||||||
std::string getChannelId();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get custom param
|
|
||||||
@return return value is custom param for channel.
|
|
||||||
*/
|
|
||||||
std::string getCustomParam();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get framework version
|
|
||||||
@return return value is the version of AnySDKFramework.
|
|
||||||
*/
|
|
||||||
std::string getFrameworkVersion();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@Title: setIsAnaylticsEnabled
|
|
||||||
@Description: choose to open or close
|
|
||||||
@param @param enabled true or false
|
|
||||||
@return void
|
|
||||||
*/
|
|
||||||
void setIsAnaylticsEnabled(bool value){bIsAnaylticsEnabled = value;};
|
|
||||||
/**
|
|
||||||
@Title: isAnaylticsEnabled
|
|
||||||
@Description: the status of Anayltics
|
|
||||||
@param @return true or false
|
|
||||||
@return boolean
|
|
||||||
*/
|
|
||||||
bool isAnaylticsEnabled(){return bIsAnaylticsEnabled;};
|
|
||||||
|
|
||||||
|
|
||||||
void loadPlugin(const char* nodeName,int type);
|
|
||||||
protected:
|
|
||||||
void setDebugMode(bool flag);
|
|
||||||
std::string getSupportPlugin();
|
|
||||||
void release();
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
AgentManager(void);
|
|
||||||
|
|
||||||
// Analytics plugin
|
|
||||||
ProtocolAnalytics* _pAnalytics;
|
|
||||||
|
|
||||||
// user plugin
|
|
||||||
ProtocolUser* _pUser;
|
|
||||||
|
|
||||||
// IAP plugins
|
|
||||||
// ProtocolIAP* _pIAP;
|
|
||||||
std::map<std::string , ProtocolIAP*> _pluginsIAPMap;
|
|
||||||
|
|
||||||
// Share plugin
|
|
||||||
ProtocolShare* _pShare;
|
|
||||||
|
|
||||||
// Social plugin
|
|
||||||
ProtocolSocial* _pSocial;
|
|
||||||
|
|
||||||
// Ads plugin
|
|
||||||
ProtocolAds* _pAds;
|
|
||||||
|
|
||||||
// Push plugin
|
|
||||||
ProtocolPush* _pPush;
|
|
||||||
|
|
||||||
// Crash plugin
|
|
||||||
ProtocolCrash* _pCrash;
|
|
||||||
|
|
||||||
// Custom plugin
|
|
||||||
ProtocolCustom* _pCustom;
|
|
||||||
|
|
||||||
// REC plugin
|
|
||||||
ProtocolREC* _pREC;
|
|
||||||
|
|
||||||
// AdTracking plugin
|
|
||||||
ProtocolAdTracking* _pAdTracking;
|
|
||||||
|
|
||||||
bool bIsAnaylticsEnabled;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_AGENTMANAGER_H__ */
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
/** @file JSBRelation.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_JSBRELATION_H__
|
|
||||||
#define __CCX_JSBRELATION_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @class JSBRelation
|
|
||||||
*/
|
|
||||||
class JSBRelation
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static string getMethodsOfPlugin(PluginProtocol* plugin);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_JSBRELATION_H__ */
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
/** @file PluginFactory.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PLUGIN_FACTORY_H__
|
|
||||||
#define __CCX_PLUGIN_FACTORY_H__
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class PluginProtocol;
|
|
||||||
class PluginManager;
|
|
||||||
/**
|
|
||||||
* @class PluginFactory
|
|
||||||
*/
|
|
||||||
class PluginFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~PluginFactory();
|
|
||||||
/**
|
|
||||||
@brief Get singleton of PluginFactory
|
|
||||||
*/
|
|
||||||
static PluginFactory* getInstance();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Destory the instance of PluginFactory
|
|
||||||
*/
|
|
||||||
static void purgeFactory();
|
|
||||||
|
|
||||||
private:
|
|
||||||
friend class PluginManager;
|
|
||||||
PluginFactory(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief create the plugin by name and type
|
|
||||||
@param the name of plugin
|
|
||||||
@param the type of plugin
|
|
||||||
*/
|
|
||||||
PluginProtocol* createPlugin(const char* name, int pluginType);
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PLUGIN_FACTORY_H__ */
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
#ifndef __PLUGIN_JAVA_DATA_H__
|
|
||||||
#define __PLUGIN_JAVA_DATA_H__
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <jni.h>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
typedef struct _PluginJavaData_
|
|
||||||
{
|
|
||||||
jobject jobj;
|
|
||||||
std::string jclassName;
|
|
||||||
} PluginJavaData;
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif // __PLUGIN_JAVA_DATA_H__
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
#ifndef __PLUGIN_JNI_HELPER_H__
|
|
||||||
#define __PLUGIN_JNI_HELPER_H__
|
|
||||||
|
|
||||||
#include <jni.h>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk {namespace framework{
|
|
||||||
|
|
||||||
typedef struct PluginJniMethodInfo_
|
|
||||||
{
|
|
||||||
JNIEnv * env;
|
|
||||||
jclass classID;
|
|
||||||
jmethodID methodID;
|
|
||||||
} PluginJniMethodInfo;
|
|
||||||
|
|
||||||
class PluginJniHelper
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static JavaVM* getJavaVM();
|
|
||||||
static void setJavaVM(JavaVM *javaVM);
|
|
||||||
static JNIEnv* getEnv();
|
|
||||||
|
|
||||||
static bool getStaticMethodInfo(PluginJniMethodInfo &methodinfo, const char *className, const char *methodName, const char *paramCode);
|
|
||||||
static bool getMethodInfo(PluginJniMethodInfo &methodinfo, const char *className, const char *methodName, const char *paramCode);
|
|
||||||
static std::string jstring2string(jstring jstr);
|
|
||||||
static jstring newStringUTF(JNIEnv* env, const std::string& utf8Str);
|
|
||||||
|
|
||||||
static bool setClassLoaderFrom(jobject nativeActivityInstance);
|
|
||||||
|
|
||||||
static jmethodID loadclassMethod_methodID;
|
|
||||||
static jobject classloader;
|
|
||||||
|
|
||||||
private:
|
|
||||||
static JavaVM *_psJavaVM;
|
|
||||||
static bool getMethodInfo_DefaultClassLoader(PluginJniMethodInfo &methodinfo,
|
|
||||||
const char *className,
|
|
||||||
const char *methodName,
|
|
||||||
const char *paramCode);
|
|
||||||
};
|
|
||||||
|
|
||||||
}}
|
|
||||||
|
|
||||||
#endif // __PLUGIN_JNI_HELPER_H__
|
|
||||||
|
|
@ -1,156 +0,0 @@
|
||||||
#ifndef __PLUGIN_JNI_MACROS_H__
|
|
||||||
#define __PLUGIN_JNI_MACROS_H__
|
|
||||||
|
|
||||||
#define return_if_fails(cond) if (!(cond)) return;
|
|
||||||
#define return_val_if_fails(cond, ret) if(!(cond)) return (ret);
|
|
||||||
|
|
||||||
#define CALL_BASERET_JAVA_FUNC_WITH_PARAM(retType, paramCode, param, retCode, defaultRet) \
|
|
||||||
retType ret = defaultRet; \
|
|
||||||
return_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret); \
|
|
||||||
return_val_if_fails(paramCode != NULL && strlen(paramCode) > 0, ret); \
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz); \
|
|
||||||
return_val_if_fails(pData != NULL, ret); \
|
|
||||||
\
|
|
||||||
PluginJniMethodInfo t; \
|
|
||||||
if (PluginJniHelper::getMethodInfo(t \
|
|
||||||
, pData->jclassName.c_str() \
|
|
||||||
, funcName \
|
|
||||||
, paramCode)) \
|
|
||||||
{ \
|
|
||||||
ret = t.env->Call##retCode##Method(pData->jobj, t.methodID, param); \
|
|
||||||
t.env->DeleteLocalRef(t.classID); \
|
|
||||||
} \
|
|
||||||
return ret; \
|
|
||||||
|
|
||||||
|
|
||||||
#define CALL_BASERET_JAVA_FUNC(retType, paramCode, retCode, defaultRet) \
|
|
||||||
retType ret = defaultRet; \
|
|
||||||
return_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret); \
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz); \
|
|
||||||
return_val_if_fails(pData != NULL, ret); \
|
|
||||||
\
|
|
||||||
PluginJniMethodInfo t; \
|
|
||||||
if (PluginJniHelper::getMethodInfo(t \
|
|
||||||
, pData->jclassName.c_str() \
|
|
||||||
, funcName \
|
|
||||||
, paramCode)) \
|
|
||||||
{ \
|
|
||||||
ret = t.env->Call##retCode##Method(pData->jobj, t.methodID); \
|
|
||||||
t.env->DeleteLocalRef(t.classID); \
|
|
||||||
} \
|
|
||||||
return ret; \
|
|
||||||
|
|
||||||
|
|
||||||
#define CALL_JAVA_FUNC_WITH_VALIST(retCode) \
|
|
||||||
std::vector<PluginParam*> allParams; \
|
|
||||||
if (NULL != param) \
|
|
||||||
{ \
|
|
||||||
allParams.push_back(param); \
|
|
||||||
\
|
|
||||||
va_list argp; \
|
|
||||||
PluginParam* pArg = NULL; \
|
|
||||||
va_start( argp, param ); \
|
|
||||||
while (1) \
|
|
||||||
{ \
|
|
||||||
pArg = va_arg(argp, PluginParam*); \
|
|
||||||
if (pArg == NULL) \
|
|
||||||
break; \
|
|
||||||
\
|
|
||||||
allParams.push_back(pArg); \
|
|
||||||
} \
|
|
||||||
va_end(argp); \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
return call##retCode##FuncWithParam(funcName, allParams); \
|
|
||||||
|
|
||||||
|
|
||||||
#define CALL_JAVA_FUNC(retType, retCode, defaultRet, jRetCode) \
|
|
||||||
retType ret = defaultRet; \
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(this); \
|
|
||||||
if (NULL == pData) { \
|
|
||||||
PluginUtils::outputLog(ANDROID_LOG_ERROR, "PluginProtocol", "Can't find java data for plugin : %s", this->getPluginName()); \
|
|
||||||
return ret; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
std::string paramCode; \
|
|
||||||
int nParamNum = params.size(); \
|
|
||||||
if (0 == nParamNum) \
|
|
||||||
{ \
|
|
||||||
paramCode = "()"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName(this, funcName); \
|
|
||||||
} else \
|
|
||||||
{ \
|
|
||||||
PluginParam* pRetParam = NULL; \
|
|
||||||
bool needDel = false; \
|
|
||||||
if (nParamNum == 1) { \
|
|
||||||
pRetParam = params[0]; \
|
|
||||||
} else { \
|
|
||||||
std::map<std::string, PluginParam*> allParams; \
|
|
||||||
for (int i = 0; i < nParamNum; i++) \
|
|
||||||
{ \
|
|
||||||
PluginParam* pArg = params[i]; \
|
|
||||||
if (pArg == NULL) \
|
|
||||||
{ \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
char strKey[8] = { 0 }; \
|
|
||||||
sprintf(strKey, "Param%d", i + 1); \
|
|
||||||
allParams[strKey] = pArg; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
pRetParam = new PluginParam(allParams); \
|
|
||||||
needDel = true; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
switch(pRetParam->getCurrentType()) \
|
|
||||||
{ \
|
|
||||||
case PluginParam::kParamTypeInt: \
|
|
||||||
paramCode = "(I)"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), pRetParam->getIntValue()); \
|
|
||||||
break; \
|
|
||||||
case PluginParam::kParamTypeFloat: \
|
|
||||||
paramCode = "(F)"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), pRetParam->getFloatValue()); \
|
|
||||||
break; \
|
|
||||||
case PluginParam::kParamTypeBool: \
|
|
||||||
paramCode = "(Z)"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), pRetParam->getBoolValue()); \
|
|
||||||
break; \
|
|
||||||
case PluginParam::kParamTypeString: \
|
|
||||||
{ \
|
|
||||||
jstring jstr = PluginJniHelper::newStringUTF(PluginUtils::getEnv(), pRetParam->getStringValue()); \
|
|
||||||
paramCode = "(Ljava/lang/String;)"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), jstr); \
|
|
||||||
PluginUtils::getEnv()->DeleteLocalRef(jstr); \
|
|
||||||
} \
|
|
||||||
break; \
|
|
||||||
case PluginParam::kParamTypeStringMap: \
|
|
||||||
case PluginParam::kParamTypeMap: \
|
|
||||||
{ \
|
|
||||||
jobject jMap = PluginUtils::getJObjFromParam(pRetParam); \
|
|
||||||
paramCode = "(Lorg/json/JSONObject;)"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), jMap); \
|
|
||||||
PluginUtils::getEnv()->DeleteLocalRef(jMap); \
|
|
||||||
} \
|
|
||||||
break; \
|
|
||||||
default: \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
if (needDel && pRetParam != NULL) \
|
|
||||||
{ \
|
|
||||||
delete pRetParam; \
|
|
||||||
pRetParam = NULL; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
return ret; \
|
|
||||||
|
|
||||||
|
|
||||||
#endif // __PLUGIN_JNI_MACROS_H__
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
/** @file PluginFactory.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PLUGINMANAGER_H__
|
|
||||||
#define __CCX_PLUGINMANAGER_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include "PluginFactory.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @class PluginManager
|
|
||||||
*/
|
|
||||||
class PluginManager
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~PluginManager();
|
|
||||||
/**
|
|
||||||
@brief Get singleton of PluginManager
|
|
||||||
*/
|
|
||||||
static PluginManager* getInstance();
|
|
||||||
/**
|
|
||||||
@brief Destory the instance of PluginManager
|
|
||||||
*/
|
|
||||||
static void end();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief load the plugin by name and type
|
|
||||||
@param the name of plugin
|
|
||||||
@param the type of plugin
|
|
||||||
*/
|
|
||||||
PluginProtocol* loadPlugin(const char* name, int pluginType);
|
|
||||||
/**
|
|
||||||
@brief unload the plugin by name and type
|
|
||||||
@param the name of plugin
|
|
||||||
@param the type of plugin
|
|
||||||
*/
|
|
||||||
void unloadPlugin(const char* name, int pluginType = 0);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
PluginManager(void);
|
|
||||||
std::map<std::string, PluginProtocol*> _pluginsMap;
|
|
||||||
// bool _isDebug;
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PLUGINMANAGER_H__ */
|
|
||||||
|
|
@ -1,126 +0,0 @@
|
||||||
/** @file PluginParam.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PLUGIN_PARAM_H__
|
|
||||||
#define __CCX_PLUGIN_PARAM_H__
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
/// \typedef std::map<std::string, std::string> StringMap
|
|
||||||
/// typedef YString.
|
|
||||||
typedef std::map<std::string, std::string> StringMap;
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class PluginProtocol;
|
|
||||||
/**
|
|
||||||
* @class PluginParam
|
|
||||||
*/
|
|
||||||
class PluginParam
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
@brief the default constructor of PluginParam
|
|
||||||
*/
|
|
||||||
PluginParam();
|
|
||||||
|
|
||||||
virtual ~PluginParam();
|
|
||||||
/**
|
|
||||||
@brief the constructor of PluginParam
|
|
||||||
@param the value is Integer
|
|
||||||
*/
|
|
||||||
PluginParam(int nValue);
|
|
||||||
/**
|
|
||||||
@brief the constructor of PluginParam
|
|
||||||
@param the value is float
|
|
||||||
*/
|
|
||||||
PluginParam(float fValue);
|
|
||||||
/**
|
|
||||||
@brief the constructor of PluginParam
|
|
||||||
@param the value is boolean
|
|
||||||
*/
|
|
||||||
PluginParam(bool bValue);
|
|
||||||
/**
|
|
||||||
@brief the default constructor of PluginParam
|
|
||||||
@param the value is char
|
|
||||||
*/
|
|
||||||
PluginParam(const char* strValue);
|
|
||||||
/**
|
|
||||||
@brief the default constructor of PluginParam
|
|
||||||
@param the value is StringMap
|
|
||||||
*/
|
|
||||||
PluginParam(StringMap strMapValue);
|
|
||||||
|
|
||||||
typedef enum{
|
|
||||||
kParamTypeNull = 0,
|
|
||||||
kParamTypeInt,
|
|
||||||
kParamTypeFloat,
|
|
||||||
kParamTypeBool,
|
|
||||||
kParamTypeString,
|
|
||||||
kParamTypeStringMap,
|
|
||||||
kParamTypeMap,
|
|
||||||
} ParamType;
|
|
||||||
/**
|
|
||||||
@brief get the ParamType of value
|
|
||||||
*/
|
|
||||||
inline ParamType getCurrentType() {
|
|
||||||
return _type;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the int value
|
|
||||||
*/
|
|
||||||
inline int getIntValue() {
|
|
||||||
return _intValue;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the float value
|
|
||||||
*/
|
|
||||||
inline float getFloatValue() {
|
|
||||||
return _floatValue;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the boolean value
|
|
||||||
*/
|
|
||||||
inline bool getBoolValue() {
|
|
||||||
return _boolValue;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the char value
|
|
||||||
*/
|
|
||||||
inline const char* getStringValue() {
|
|
||||||
return _strValue.c_str();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the map of value
|
|
||||||
*/
|
|
||||||
inline std::map<std::string, PluginParam*> getMapValue() {
|
|
||||||
return _mapValue;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the StringMap value
|
|
||||||
*/
|
|
||||||
inline StringMap getStrMapValue() {
|
|
||||||
return _strMapValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
friend class PluginProtocol;
|
|
||||||
/**
|
|
||||||
@brief the constructor of PluginParam
|
|
||||||
@param the map of value
|
|
||||||
*/
|
|
||||||
PluginParam(std::map<std::string, PluginParam*> mapValue);
|
|
||||||
|
|
||||||
private:
|
|
||||||
ParamType _type;
|
|
||||||
|
|
||||||
int _intValue;
|
|
||||||
float _floatValue;
|
|
||||||
bool _boolValue;
|
|
||||||
std::string _strValue;
|
|
||||||
std::map<std::string, PluginParam*> _mapValue;
|
|
||||||
StringMap _strMapValue;
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PLUGIN_PARAM_H__ */
|
|
||||||
|
|
@ -1,144 +0,0 @@
|
||||||
/** @file PluginProtocol.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_IPLUGIN_H__
|
|
||||||
#define __CCX_IPLUGIN_H__
|
|
||||||
|
|
||||||
#include "PluginParam.h"
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
|
|
||||||
#define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
|
|
||||||
#elif _MSC_VER >= 1400 //vs 2005 or higher
|
|
||||||
#define CC_DEPRECATED_ATTRIBUTE __declspec(deprecated)
|
|
||||||
#else
|
|
||||||
#define CC_DEPRECATED_ATTRIBUTE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @class PluginProtocol
|
|
||||||
* @brief The super class for all plugins.
|
|
||||||
*/
|
|
||||||
class PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~PluginProtocol() {};
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief set plugin name
|
|
||||||
*@param the name of plugin
|
|
||||||
*/
|
|
||||||
virtual void setPluginName(const char* name) = 0 ;
|
|
||||||
/**
|
|
||||||
*@brief get plugin name
|
|
||||||
*@return the name of plugin
|
|
||||||
*/
|
|
||||||
virtual const char* getPluginName() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief get the version of plugin
|
|
||||||
*@return the version of plugin
|
|
||||||
*/
|
|
||||||
virtual std::string getPluginVersion();
|
|
||||||
/**
|
|
||||||
*@brief get the version of sdk
|
|
||||||
*@return the version of sdk
|
|
||||||
*/
|
|
||||||
virtual std::string getSDKVersion();
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief switch debug plug-in on/off
|
|
||||||
*@param the value of on/off
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE virtual void setDebugMode(bool bDebug);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void callFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void callFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return string
|
|
||||||
*/
|
|
||||||
virtual std::string callStringFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return string
|
|
||||||
*/
|
|
||||||
virtual std::string callStringFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return int
|
|
||||||
*/
|
|
||||||
virtual int callIntFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return int
|
|
||||||
*/
|
|
||||||
virtual int callIntFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return bool
|
|
||||||
*/
|
|
||||||
virtual bool callBoolFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return bool
|
|
||||||
*/
|
|
||||||
virtual bool callBoolFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return float
|
|
||||||
*/
|
|
||||||
virtual float callFloatFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return float
|
|
||||||
*/
|
|
||||||
virtual float callFloatFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Check function the plugin support or not
|
|
||||||
@param the name of plugin
|
|
||||||
@return if the function support ,return true
|
|
||||||
else retur false
|
|
||||||
*/
|
|
||||||
virtual bool isFunctionSupported(std::string functionName);
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_IPLUGIN_H__ */
|
|
||||||
|
|
@ -1,157 +0,0 @@
|
||||||
#ifndef __PLUGIN_UTILS_H__
|
|
||||||
#define __PLUGIN_UTILS_H__
|
|
||||||
|
|
||||||
#include "PluginJniHelper.h"
|
|
||||||
#include "PluginJavaData.h"
|
|
||||||
#include <map>
|
|
||||||
#include <list>
|
|
||||||
#include "PluginParam.h"
|
|
||||||
#include "PluginJniMacros.h"
|
|
||||||
#include <android/log.h>
|
|
||||||
//#include <android_native_app_glue.h>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class PluginProtocol;
|
|
||||||
class PluginUtils
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
//cjh static void initPluginWrapper(android_app* app);
|
|
||||||
static jobject createJavaMapObject(std::map<std::string, std::string>* paramMap);
|
|
||||||
static jobject createJavaListObject(std::list<std::string>* paramList);
|
|
||||||
static void initJavaPlugin(PluginProtocol* pPlugin, jobject jObj, const char* className, int type);
|
|
||||||
static JNIEnv* getEnv();
|
|
||||||
|
|
||||||
static PluginJavaData* getPluginJavaData(PluginProtocol* pKeyObj);
|
|
||||||
static void setPluginJavaData(PluginProtocol* pKeyObj, PluginJavaData* pData, int type);
|
|
||||||
static void erasePluginJavaData(PluginProtocol* pKeyObj,int type);
|
|
||||||
static void erasePluginJavaData(std::string key);
|
|
||||||
|
|
||||||
static PluginProtocol* getPluginPtr(std::string className);
|
|
||||||
|
|
||||||
static jobject getJObjFromParam(PluginParam* param);
|
|
||||||
|
|
||||||
// methods have no return value
|
|
||||||
template <typename T>
|
|
||||||
static void callJavaFunctionWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)
|
|
||||||
{
|
|
||||||
return_if_fails(funcName != NULL && strlen(funcName) > 0);
|
|
||||||
return_if_fails(paramCode != NULL && strlen(paramCode) > 0);
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);
|
|
||||||
return_if_fails(pData != NULL);
|
|
||||||
|
|
||||||
PluginJniMethodInfo t;
|
|
||||||
if (PluginJniHelper::getMethodInfo(t
|
|
||||||
, pData->jclassName.c_str()
|
|
||||||
, funcName
|
|
||||||
, paramCode))
|
|
||||||
{
|
|
||||||
t.env->CallVoidMethod(pData->jobj, t.methodID, param);
|
|
||||||
t.env->DeleteLocalRef(t.classID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static void callJavaFunctionWithName(PluginProtocol* thiz, const char* funcName)
|
|
||||||
{
|
|
||||||
return_if_fails(funcName != NULL && strlen(funcName) > 0);
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);
|
|
||||||
return_if_fails(pData != NULL);
|
|
||||||
|
|
||||||
PluginJniMethodInfo t;
|
|
||||||
if (PluginJniHelper::getMethodInfo(t
|
|
||||||
, pData->jclassName.c_str()
|
|
||||||
, funcName
|
|
||||||
, "()V"))
|
|
||||||
{
|
|
||||||
t.env->CallVoidMethod(pData->jobj, t.methodID);
|
|
||||||
t.env->DeleteLocalRef(t.classID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// methods return value is string
|
|
||||||
template <typename T>
|
|
||||||
static std::string callJavaStringFuncWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)
|
|
||||||
{
|
|
||||||
std::string ret = "";
|
|
||||||
return_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret);
|
|
||||||
return_val_if_fails(paramCode != NULL && strlen(paramCode) > 0, ret);
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);
|
|
||||||
return_val_if_fails(pData != NULL, ret);
|
|
||||||
|
|
||||||
PluginJniMethodInfo t;
|
|
||||||
if (PluginJniHelper::getMethodInfo(t
|
|
||||||
, pData->jclassName.c_str()
|
|
||||||
, funcName
|
|
||||||
, paramCode))
|
|
||||||
{
|
|
||||||
jstring strRet = (jstring)t.env->CallObjectMethod(pData->jobj, t.methodID, param);
|
|
||||||
ret = PluginJniHelper::jstring2string(strRet);
|
|
||||||
t.env->DeleteLocalRef(t.classID);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
static std::string callJavaStringFuncWithName(PluginProtocol* thiz, const char* funcName)
|
|
||||||
{
|
|
||||||
std::string ret = "";
|
|
||||||
return_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret);
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);
|
|
||||||
return_val_if_fails(pData != NULL, ret);
|
|
||||||
|
|
||||||
PluginJniMethodInfo t;
|
|
||||||
if (PluginJniHelper::getMethodInfo(t
|
|
||||||
, pData->jclassName.c_str()
|
|
||||||
, funcName
|
|
||||||
, "()Ljava/lang/String;"))
|
|
||||||
{
|
|
||||||
jstring strRet = (jstring) t.env->CallObjectMethod(pData->jobj, t.methodID);
|
|
||||||
ret = PluginJniHelper::jstring2string(strRet);
|
|
||||||
t.env->DeleteLocalRef(t.classID);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
// methods return value is int
|
|
||||||
template <typename T>
|
|
||||||
static int callJavaIntFuncWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC_WITH_PARAM(int, paramCode, param, Int, 0)
|
|
||||||
}
|
|
||||||
static int callJavaIntFuncWithName(PluginProtocol* thiz, const char* funcName)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC(int, "()I", Int, 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
// methods return value is float
|
|
||||||
template <typename T>
|
|
||||||
static float callJavaFloatFuncWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC_WITH_PARAM(float, paramCode, param, Float, 0.0f)
|
|
||||||
}
|
|
||||||
static float callJavaFloatFuncWithName(PluginProtocol* thiz, const char* funcName)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC(float, "()F", Float, 0.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
// methods return value is bool
|
|
||||||
template <typename T>
|
|
||||||
static bool callJavaBoolFuncWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC_WITH_PARAM(bool, paramCode, param, Boolean, false)
|
|
||||||
}
|
|
||||||
static bool callJavaBoolFuncWithName(PluginProtocol* thiz, const char* funcName)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC(bool, "()Z", Boolean, false)
|
|
||||||
}
|
|
||||||
|
|
||||||
static void callJavaFunctionWithName_string_map(PluginProtocol* thiz, const char* funcName, const char* keyParam, std::map<std::string, std::string>* paramMap);
|
|
||||||
|
|
||||||
static void outputLog(int type, const char* logTag, const char* pFormat, ...);
|
|
||||||
static void output(int type, const char* logTag, const char* contents);
|
|
||||||
|
|
||||||
static void resetLogLevel();
|
|
||||||
private:
|
|
||||||
static std::string _logLevel;
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif //__PLUGIN_UTILS_H__
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
/** @file ProtocolAdTracking.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_ADTRACKING_H__
|
|
||||||
#define __CCX_PROTOCOL_ADTRACKING_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/**
|
|
||||||
*@class ProtocolAdTracking
|
|
||||||
*@brief the interface of AdTracking
|
|
||||||
*/
|
|
||||||
class ProtocolAdTracking : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: onRegister
|
|
||||||
* @Description: Call this method if you want to track register events as happening during a section.
|
|
||||||
* @param userId user identifier
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
virtual void onRegister(const char* userId) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: onLogin
|
|
||||||
* @Description:Call this method if you want to track login events as happening during a section.
|
|
||||||
* @param userInfo The details of this parameters are already covered by document.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
virtual void onLogin(std::map<std::string, std::string> userInfo) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: onPay
|
|
||||||
* @Description: Call this method if you want to track pay events as happening during a section.
|
|
||||||
* @param productInfo The details of this parameters are already covered by document.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
virtual void onPay(std::map<std::string, std::string> productInfo) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: trackEvent
|
|
||||||
* @Description: Call this method if you want to track custom events with parameters as happening during a section.
|
|
||||||
* @param eventId The custom event name.
|
|
||||||
* @param paramMap The details of this parameters are already covered by document.
|
|
||||||
*/
|
|
||||||
virtual void trackEvent(const char* eventId, std::map<std::string, std::string>* paramMap = NULL) = 0;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* ----- #ifndef __CCX_PROTOCOL_ADTRACKING_H__ ----- */
|
|
||||||
|
|
@ -1,133 +0,0 @@
|
||||||
/** @file ProtocolAds.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_ADS_H__
|
|
||||||
#define __CCX_PROTOCOL_ADS_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> TAdsDeveloperInfo
|
|
||||||
/// typedef TAdsDeveloperInfo.
|
|
||||||
typedef std::map<std::string, std::string> TAdsDeveloperInfo;
|
|
||||||
/// \typedef std::map<std::string, std::string> TAdsInfo
|
|
||||||
/// typedef TAdsInfo.
|
|
||||||
typedef std::map<std::string, std::string> TAdsInfo;
|
|
||||||
/** @brief AdsResultCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kAdsReceived = 0, /**< enum the callback: the ad is received is at center. */
|
|
||||||
|
|
||||||
kAdsShown, /**< enum the callback: the advertisement dismissed. */
|
|
||||||
kAdsDismissed, /**< enum the callback: the advertisement dismissed. */
|
|
||||||
|
|
||||||
kPointsSpendSucceed, /**< enum the callback: the points spend succeed. */
|
|
||||||
kPointsSpendFailed, /**< enum the callback: the points spend failed. */
|
|
||||||
|
|
||||||
kNetworkError, /**< enum the callback of Network error at center. */
|
|
||||||
kUnknownError, /**< enum the callback of Unknown error. */
|
|
||||||
kOfferWallOnPointsChanged, /**< enum the callback of Changing the point of offerwall. */
|
|
||||||
kRewardedVideoWithReward,/**< enum the callback of receiving the reward of rewardedvideo. */
|
|
||||||
kInAppPurchaseFinished,/**< enum the callback of finishing IAP ad. */
|
|
||||||
kAdsClicked,/**< enum the callback of the advertisement clicked. */
|
|
||||||
kAdsExtension = 40000 /**< enum value is extension code . */
|
|
||||||
} AdsResultCode;
|
|
||||||
/** @brief AdsPos enum, with inline docs */
|
|
||||||
typedef enum {
|
|
||||||
kPosCenter = 0,/**< enum the toolbar is at center. */
|
|
||||||
kPosTop,/**< enum the toolbar is at top. */
|
|
||||||
kPosTopLeft,/**< enum the toolbar is at topleft. */
|
|
||||||
kPosTopRight,/**< enum the toolbar is at topright. */
|
|
||||||
kPosBottom,/**< enum the toolbar is at bottom. */
|
|
||||||
kPosBottomLeft,/**< enum the toolbar is at bottomleft. */
|
|
||||||
kPosBottomRight,/**< enum the toolbar is at bottomright. */
|
|
||||||
} AdsPos;
|
|
||||||
/** @brief AdsType enum, with inline docs */
|
|
||||||
typedef enum {
|
|
||||||
AD_TYPE_BANNER = 0,/**< enum value is banner ads . */
|
|
||||||
AD_TYPE_FULLSCREEN,/**< enum value is fullscreen ads . */
|
|
||||||
AD_TYPE_MOREAPP,/**< enum value is moreapp ads . */
|
|
||||||
AD_TYPE_OFFERWALL,/**< enum value is offerwall ads . */
|
|
||||||
AD_TYPE_REWARDEDVIDEO,/**< enum value is rewarded video ads . */
|
|
||||||
AD_TYPE_NATIVEEXPRESS,/**< enum value is Native express ads . */
|
|
||||||
AD_TYPE_NATIVEADVANCED,/**< enum value is Native advanced ads . */
|
|
||||||
} AdsType;
|
|
||||||
|
|
||||||
class ProtocolAds;
|
|
||||||
class AdsListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief The advertisement request result
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onAdsResult(AdsResultCode code, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ProtocolAds : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief show adview
|
|
||||||
@param the type of ads
|
|
||||||
@param the idx of ads
|
|
||||||
*/
|
|
||||||
virtual void showAds(AdsType adsType, int idx = 1) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Hide the adview
|
|
||||||
@param the type of ads
|
|
||||||
@param the idx of ads
|
|
||||||
*/
|
|
||||||
virtual void hideAds(AdsType adsType, int idx = 1) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief preload the adview
|
|
||||||
@param the type of ads
|
|
||||||
@param the idx of ads
|
|
||||||
*/
|
|
||||||
virtual void preloadAds(AdsType adsType, int idx = 1)= 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief Query the points of player
|
|
||||||
*@return the point
|
|
||||||
*/
|
|
||||||
virtual float queryPoints() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief Spend the points.
|
|
||||||
Use this method to notify server spend points.
|
|
||||||
*@param points Need spend number of points
|
|
||||||
*/
|
|
||||||
virtual void spendPoints(int points) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief set the Ads listener
|
|
||||||
@param pListener The callback object for Ads result
|
|
||||||
*/
|
|
||||||
virtual void setAdsListener(AdsListener* listener) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief get pListener The callback object for Ads result
|
|
||||||
@return the listener
|
|
||||||
*/
|
|
||||||
virtual AdsListener* getAdsListener() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Is it supportive of this type of ads
|
|
||||||
@param the type of ads
|
|
||||||
@return if it is supportive ,return true
|
|
||||||
else retur false
|
|
||||||
*/
|
|
||||||
virtual bool isAdTypeSupported(AdsType adType) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_ADS_H__ */
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
/** @file ProtocolAnalytics.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_ANALYTICS_H__
|
|
||||||
#define __CCX_PROTOCOL_ANALYTICS_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> LogEventParamPair
|
|
||||||
/// typedef LogEventParamPair.
|
|
||||||
typedef std::pair< std::string, std::string > LogEventParamPair;
|
|
||||||
/// \typedef std::map<std::string, std::string> LogEventParamMap
|
|
||||||
/// typedef LogEventParamMap.
|
|
||||||
typedef std::map< std::string, std::string > LogEventParamMap;
|
|
||||||
typedef enum {
|
|
||||||
ANONYMOUS,/**< enum value is anonymous typek. */
|
|
||||||
REGISTED,/**< enum value is registed type. */
|
|
||||||
SINA_WEIBO,/**< enum value is sineweibo type. */
|
|
||||||
TENCENT_WEIBO,/**< enum value is tecentweibo type */
|
|
||||||
QQ,/**< enum value is qq type */
|
|
||||||
ND91,/**< enum value is nd91 type. */
|
|
||||||
} AccountType;
|
|
||||||
typedef enum {
|
|
||||||
LOGIN,/**< enum value is the login operate. */
|
|
||||||
LOGOUT,/**< enum value is the logout operate. */
|
|
||||||
REGISTER,/**< enum value is the register operate. */
|
|
||||||
} AccountOperate;
|
|
||||||
typedef enum {
|
|
||||||
MALE,/**< enum value is male. */
|
|
||||||
FEMALE,/**< enum value is female. */
|
|
||||||
UNKNOWN,/**< enum value is unknow. */
|
|
||||||
|
|
||||||
} AccountGender;
|
|
||||||
typedef enum {
|
|
||||||
GUIDE_LINE,/**< enum value is the guideline type.. */
|
|
||||||
MAIN_LINE,/**< enum value is the mainline type.. */
|
|
||||||
BRANCH_LINE,/**<enum value is the branchline type.. */
|
|
||||||
DAILY,/**< enum value is the daily type.. */
|
|
||||||
ACTIVITY,/**< enum value is the activity type. */
|
|
||||||
OTHER,/**< enum value is other type. */
|
|
||||||
} TaskType;
|
|
||||||
/**
|
|
||||||
*@class ProtocolAnalytics
|
|
||||||
*@brief the interface of Analytics
|
|
||||||
*/
|
|
||||||
class ProtocolAnalytics : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Start a new session.
|
|
||||||
*/
|
|
||||||
virtual void startSession() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Stop a session.
|
|
||||||
@warning This interface only worked on android
|
|
||||||
*/
|
|
||||||
virtual void stopSession() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Set the timeout for expiring a session.
|
|
||||||
@param millis In milliseconds as the unit of time.
|
|
||||||
@note It must be invoked before calling startSession.
|
|
||||||
*/
|
|
||||||
virtual void setSessionContinueMillis(long millis) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief log an error
|
|
||||||
@param errorId The identity of error
|
|
||||||
@param message Extern message for the error
|
|
||||||
*/
|
|
||||||
virtual void logError(const char* errorId, const char* message) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief log an event.
|
|
||||||
@param eventId The identity of event
|
|
||||||
@param paramMap Extern parameters of the event, use NULL if not needed.
|
|
||||||
*/
|
|
||||||
virtual void logEvent(const char* eventId, LogEventParamMap* paramMap = NULL) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Track an event begin.
|
|
||||||
@param eventId The identity of event
|
|
||||||
*/
|
|
||||||
virtual void logTimedEventBegin(const char* eventId) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Track an event end.
|
|
||||||
@param eventId The identity of event
|
|
||||||
*/
|
|
||||||
virtual void logTimedEventEnd(const char* eventId) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Whether to catch uncaught exceptions to server.
|
|
||||||
@warning This interface only worked on android.
|
|
||||||
*/
|
|
||||||
virtual void setCaptureUncaughtException(bool enabled) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_ANALYTICS_H__ */
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
/** @file ProtocolCrash.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_CRASH_H__
|
|
||||||
#define __CCX_PROTOCOL_CRASH_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class ProtocolCrash : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* set user identifier
|
|
||||||
*
|
|
||||||
* @param userInfo
|
|
||||||
*/
|
|
||||||
virtual void setUserIdentifier(const char* identifier) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The uploader captured in exception information
|
|
||||||
*
|
|
||||||
* @param message Set the custom information
|
|
||||||
* @param exception The exception
|
|
||||||
*/
|
|
||||||
virtual void reportException(const char* message, const char* exception) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* customize logging
|
|
||||||
*
|
|
||||||
* @param string Custom log
|
|
||||||
*/
|
|
||||||
virtual void leaveBreadcrumb(const char* breadcrumb) = 0;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_CRASH_H__ */
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
/** @file ProtocolCustom.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_CUSTOM_H__
|
|
||||||
#define __CCX_PROTOCOL_CUSTOM_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kCustomExtension = 80000 /**< enum value is extension code . */
|
|
||||||
} CustomResultCode;
|
|
||||||
/**
|
|
||||||
*@class CustomResultListener
|
|
||||||
*@brief the interface of share callback
|
|
||||||
*/
|
|
||||||
class CustomResultListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of share callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onCustomResult(CustomResultCode ret, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
*@class ProtocolCustom
|
|
||||||
*@brief the interface of custom
|
|
||||||
*/
|
|
||||||
class ProtocolCustom : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
@breif set the result listener
|
|
||||||
@param pListener The callback object for custom result
|
|
||||||
@wraning Must invoke this interface before custom
|
|
||||||
*/
|
|
||||||
virtual void setResultListener(CustomResultListener* pListener) = 0;
|
|
||||||
|
|
||||||
virtual CustomResultListener* getCustomListener() = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* ----- #ifndef __CCX_PROTOCOL_Custom_H__ ----- */
|
|
||||||
|
|
@ -1,119 +0,0 @@
|
||||||
/** @file ProtocolIAP.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_IAP_H__
|
|
||||||
#define __CCX_PROTOCOL_IAP_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> TIAPDeveloperInfo
|
|
||||||
/// typedef TIAPDeveloperInfo.
|
|
||||||
typedef std::map<std::string, std::string> TIAPDeveloperInfo;
|
|
||||||
/// \typedef std::map<std::string, std::string> TProductInfo
|
|
||||||
/// typedef TProductInfo.
|
|
||||||
typedef std::map<std::string, std::string> TProductInfo;
|
|
||||||
/// typedef TProductsInfo.
|
|
||||||
typedef std::map<std::string, TProductInfo> AllProductsInfo;
|
|
||||||
/** @brief PayResultCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kPaySuccess = 0,/**< enum value is callback of succeeding in paying . */
|
|
||||||
kPayFail,/**< enum value is callback of failing to pay . */
|
|
||||||
kPayCancel,/**< enum value is callback of canceling to pay . */
|
|
||||||
kPayNetworkError,/**< enum value is callback of network error . */
|
|
||||||
kPayProductionInforIncomplete,/**< enum value is callback of incompleting info . */
|
|
||||||
kPayInitSuccess,/**< enum value is callback of succeeding in initing sdk . */
|
|
||||||
kPayInitFail,/**< enum value is callback of failing to init sdk . */
|
|
||||||
kPayNowPaying,/**< enum value is callback of paying now . */
|
|
||||||
kPayRechargeSuccess,/**< enum value is callback of succeeding in recharging. */
|
|
||||||
kPayExtension = 30000 /**< enum value is extension code . */
|
|
||||||
} PayResultCode;
|
|
||||||
/** @brief RequestResultCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kRequestSuccess = 31000,/**< enum value is callback of succeeding in paying . */
|
|
||||||
kRequestFail/**< enum value is callback of failing to pay . */
|
|
||||||
} RequestResultCode;
|
|
||||||
/**
|
|
||||||
*@class PayResultListener
|
|
||||||
*@brief the interface of pay callback
|
|
||||||
*/
|
|
||||||
class PayResultListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of pay callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*@param the info of pay
|
|
||||||
*/
|
|
||||||
virtual void onPayResult(PayResultCode ret, const char* msg, TProductInfo info) = 0;
|
|
||||||
/**
|
|
||||||
*@brief the interface of request callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*@param the info of request product
|
|
||||||
*/
|
|
||||||
virtual void onRequestResult(RequestResultCode ret, const char* msg, AllProductsInfo info) {}
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
*@class ProtocolIAP
|
|
||||||
*@brief the interface of pay
|
|
||||||
*/
|
|
||||||
|
|
||||||
class ProtocolIAP : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief pay for product
|
|
||||||
@param info The info of product, must contains key:
|
|
||||||
productName The name of product
|
|
||||||
productPrice The price of product(must can be parse to float)
|
|
||||||
productDesc The description of product
|
|
||||||
@warning For different plugin, the parameter should have other keys to pay.
|
|
||||||
Look at the manual of plugins.
|
|
||||||
*/
|
|
||||||
virtual void payForProduct(TProductInfo info) = 0;
|
|
||||||
/**
|
|
||||||
@brief get order id
|
|
||||||
@return the order id
|
|
||||||
*/
|
|
||||||
virtual std::string getOrderId() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@breif set the result listener
|
|
||||||
@param pListener The callback object for pay result
|
|
||||||
@wraning Must invoke this interface before payForProduct.
|
|
||||||
*/
|
|
||||||
virtual void setResultListener(PayResultListener* pListener) = 0;
|
|
||||||
|
|
||||||
virtual PayResultListener* getPayListener() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief get plugin id
|
|
||||||
@return the plugin id
|
|
||||||
*/
|
|
||||||
virtual std::string getPluginId() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief change the state of paying
|
|
||||||
@param the state
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void resetPayState()
|
|
||||||
{
|
|
||||||
_paying = false;
|
|
||||||
}
|
|
||||||
static bool _paying;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_IAP_H__ */
|
|
||||||
|
|
@ -1,104 +0,0 @@
|
||||||
/** @file PluginFactory.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_PUSH_H__
|
|
||||||
#define __CCX_PROTOCOL_PUSH_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <list>
|
|
||||||
#include <string>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/** @brief Plugin_type enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kPushReceiveMessage = 0,/**value is callback of Receiving Message . */
|
|
||||||
kPushExtensionCode = 60000 /**< enum value is extension code . */
|
|
||||||
|
|
||||||
|
|
||||||
} PushActionResultCode;
|
|
||||||
class ProtocolPush;
|
|
||||||
/**
|
|
||||||
*@class PushActionListener
|
|
||||||
*@brief the interface of Push callback
|
|
||||||
*/
|
|
||||||
class PushActionListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of Push callback
|
|
||||||
*@param the adatper of plugin
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onActionResult(ProtocolPush* pPlugin, PushActionResultCode code, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* @class ProtocolPush
|
|
||||||
*/
|
|
||||||
class ProtocolPush : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief start/register Push services
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void startPush() = 0 ;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief close Push services
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void closePush() = 0 ;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief set alias
|
|
||||||
*@param tags
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void setAlias(string alias) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief del alias
|
|
||||||
*@param tags
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void delAlias(string alias) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief set tag
|
|
||||||
*@param tags
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void setTags(list<string> tags) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief delete tag
|
|
||||||
*@param tags
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void delTags(list<string> tags) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief set the result listener
|
|
||||||
@param pListener The callback object for push result
|
|
||||||
*/
|
|
||||||
virtual void setActionListener(PushActionListener* listener) = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief get pListener The callback object for Push result
|
|
||||||
@return the listener
|
|
||||||
*/
|
|
||||||
virtual PushActionListener* getActionListener() = 0 ;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_PUSH_H__ */
|
|
||||||
|
|
@ -1,83 +0,0 @@
|
||||||
/** @file ProtocolREC.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_REC_H__
|
|
||||||
#define __CCX_PROTOCOL_REC_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
typedef std::map<std::string, std::string> TVideoInfo;
|
|
||||||
|
|
||||||
/** @brief RECResultCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kRECInitSuccess = 0,/**< enum value is callback of succeeding in initing sdk . */
|
|
||||||
kRECInitFail,/**< enum value is callback of failing to init sdk. */
|
|
||||||
kRECStartRecording,/**< enum value is callback of starting to record. */
|
|
||||||
kRECStopRecording,/**< enum value is callback of stoping to record. */
|
|
||||||
kRECPauseRecording,/**< enum value is callback of pausing to record. */
|
|
||||||
kRECResumeRecording,/**< enum value is callback of resuming to record. */
|
|
||||||
kRECEnterSDKPage,/**< enum value is callback of entering SDK`s page. */
|
|
||||||
kRECQuitSDKPage,/**< enum value is callback of quiting SDK`s page. */
|
|
||||||
kRECShareSuccess,/**< enum value is callback of succeeding in sharing. */
|
|
||||||
kRECShareFail,/**< enum value is callback of failing to share. */
|
|
||||||
kRECExtension = 90000 /**< enum value is extension code . */
|
|
||||||
} RECResultCode;
|
|
||||||
/**
|
|
||||||
*@class RECResultListener
|
|
||||||
*@brief the interface of REC callback
|
|
||||||
*/
|
|
||||||
class RECResultListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of REC callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onRECResult(RECResultCode ret, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
*@class ProtocolREC
|
|
||||||
*@brief the interface of REC
|
|
||||||
*/
|
|
||||||
class ProtocolREC : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: Start to record video
|
|
||||||
*/
|
|
||||||
virtual void startRecording() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: Stop to record video
|
|
||||||
*/
|
|
||||||
virtual void stopRecording() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: share video
|
|
||||||
* @Param info The info of share
|
|
||||||
*/
|
|
||||||
virtual void share(TVideoInfo info) = 0;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@breif set the result listener
|
|
||||||
@param pListener The callback object for REC result
|
|
||||||
@wraning Must invoke this interface before REC
|
|
||||||
*/
|
|
||||||
virtual void setResultListener(RECResultListener* pListener) = 0;
|
|
||||||
|
|
||||||
virtual RECResultListener* getRECListener() = 0;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* ----- #ifndef __CCX_PROTOCOL_SHARE_H__ ----- */
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
/** @file ProtocolShare.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_SHARE_H__
|
|
||||||
#define __CCX_PROTOCOL_SHARE_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> TShareDeveloperInfo
|
|
||||||
/// typedef TShareDeveloperInfo.
|
|
||||||
typedef std::map<std::string, std::string> TShareDeveloperInfo;
|
|
||||||
/// \typedef std::map<std::string, std::string> TShareInfo
|
|
||||||
/// typedef TShareInfo.
|
|
||||||
typedef std::map<std::string, std::string> TShareInfo;
|
|
||||||
/** @brief ShareResultCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kShareSuccess = 0,/**< enum value is callback of failing to sharing . */
|
|
||||||
kShareFail,/**< enum value is callback of failing to share . */
|
|
||||||
kShareCancel,/**< enum value is callback of canceling to share . */
|
|
||||||
kShareNetworkError,/**< enum value is callback of network error . */
|
|
||||||
kShareExtension = 10000 /**< enum value is extension code . */
|
|
||||||
} ShareResultCode;
|
|
||||||
/**
|
|
||||||
*@class ShareResultListener
|
|
||||||
*@brief the interface of share callback
|
|
||||||
*/
|
|
||||||
class ShareResultListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of share callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onShareResult(ShareResultCode ret, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
*@class ProtocolShare
|
|
||||||
*@brief the interface of share
|
|
||||||
*/
|
|
||||||
class ProtocolShare : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief share information
|
|
||||||
@param info The info of share, contains key:
|
|
||||||
SharedText The text need to share
|
|
||||||
SharedImagePath The full path of image file need to share (optinal)
|
|
||||||
@warning For different plugin, the parameter should have other keys to share.
|
|
||||||
Look at the manual of plugins. */
|
|
||||||
virtual void share(TShareInfo info) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@breif set the result listener
|
|
||||||
@param pListener The callback object for share result
|
|
||||||
@wraning Must invoke this interface before share
|
|
||||||
*/
|
|
||||||
virtual void setResultListener(ShareResultListener* pListener) = 0;
|
|
||||||
|
|
||||||
virtual ShareResultListener* getShareListener() = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* ----- #ifndef __CCX_PROTOCOL_SHARE_H__ ----- */
|
|
||||||
|
|
@ -1,105 +0,0 @@
|
||||||
/** @file ProtocolSocial.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_SOCIAL_H__
|
|
||||||
#define __CCX_PROTOCOL_SOCIAL_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> TSocialDeveloperInfo
|
|
||||||
/// typedef TSocialDeveloperInfo.
|
|
||||||
typedef std::map<std::string, std::string> TSocialDeveloperInfo;
|
|
||||||
/// \typedef std::map<std::string, std::string> TAchievementInfo
|
|
||||||
/// typedef TAchievementInfo.
|
|
||||||
typedef std::map<std::string, std::string> TAchievementInfo;
|
|
||||||
/** @brief SocialRetCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
// code for leaderboard feature
|
|
||||||
kScoreSubmitSucceed =1,/**< enum value is callback of succeeding in submiting. */
|
|
||||||
kScoreSubmitfail,/**< enum value is callback of failing to submit . */
|
|
||||||
|
|
||||||
// code for achievement feature
|
|
||||||
kAchUnlockSucceed,/**< enum value is callback of succeeding in unlocking. */
|
|
||||||
kAchUnlockFail,/**< enum value is callback of failing to unlock. */
|
|
||||||
|
|
||||||
kSocialSignInSucceed,/**< enum value is callback of succeeding to login. */
|
|
||||||
kSocialSignInFail,/**< enum value is callback of failing to login. */
|
|
||||||
|
|
||||||
kSocialSignOutSucceed,/**< enum value is callback of succeeding to login. */
|
|
||||||
kSocialSignOutFail,/**< enum value is callback of failing to login. */
|
|
||||||
kSocialGetGameFriends,/**< enum value is callback of getGameFriends. */
|
|
||||||
kSocialExtensionCode = 20000 /**< enum value is extension code . */
|
|
||||||
|
|
||||||
} SocialRetCode;
|
|
||||||
/**
|
|
||||||
*@class SocialListener
|
|
||||||
*@brief the interface of social callback
|
|
||||||
*/
|
|
||||||
class SocialListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of social callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onSocialResult(SocialRetCode code, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@class ProtocolSocial
|
|
||||||
*@brief the interface of social
|
|
||||||
*/
|
|
||||||
class ProtocolSocial : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief user signIn
|
|
||||||
*/
|
|
||||||
virtual void signIn() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief user signOut
|
|
||||||
*/
|
|
||||||
virtual void signOut() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief submit the score
|
|
||||||
@param leaderboardID
|
|
||||||
@param the score
|
|
||||||
*/
|
|
||||||
virtual void submitScore(const char* leadboardID, long score) = 0;
|
|
||||||
/**
|
|
||||||
@brief show the id of Leaderboard page
|
|
||||||
@param leaderboardID
|
|
||||||
*/
|
|
||||||
virtual void showLeaderboard(const char* leaderboardID) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief methods of achievement feature
|
|
||||||
@param the info of achievement
|
|
||||||
*/
|
|
||||||
virtual void unlockAchievement(TAchievementInfo achInfo) = 0;
|
|
||||||
/**
|
|
||||||
@brief show the page of achievements
|
|
||||||
*/
|
|
||||||
virtual void showAchievements() = 0;
|
|
||||||
/**
|
|
||||||
@brief set pListener The callback object for social result
|
|
||||||
@param the listener
|
|
||||||
*/
|
|
||||||
virtual void setListener(SocialListener* listener) = 0;
|
|
||||||
/**
|
|
||||||
@brief get pListener The callback object for social result
|
|
||||||
@return the listener
|
|
||||||
*/
|
|
||||||
virtual SocialListener* getListener() = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* ----- #ifndef __CCX_PROTOCOL_SOCIAL_H__ ----- */
|
|
||||||
|
|
@ -1,135 +0,0 @@
|
||||||
/** @file ProtocolUser.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_USER_H__
|
|
||||||
#define __CCX_PROTOCOL_USER_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> TUserDeveloperInfo
|
|
||||||
/// typedef TUserDeveloperInfo.
|
|
||||||
typedef std::map<std::string, std::string> TUserDeveloperInfo;
|
|
||||||
/** @brief Plugin_type enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kInitSuccess = 0,/**< enum value is callback of succeeding in initing sdk. */
|
|
||||||
kInitFail,/**< enum value is callback of failing to init sdk. */
|
|
||||||
kLoginSuccess,/**< enum value is callback of succeeding in login.*/
|
|
||||||
kLoginNetworkError,/**< enum value is callback of network error*/
|
|
||||||
kLoginNoNeed,/**< enum value is callback of no need login.*/
|
|
||||||
kLoginFail,/**< enum value is callback of failing to login. */
|
|
||||||
kLoginCancel,/**< enum value is callback of canceling to login. */
|
|
||||||
kLogoutSuccess,/**< enum value is callback of succeeding in logout. */
|
|
||||||
kLogoutFail,/**< enum value is callback of failing to logout. */
|
|
||||||
kPlatformEnter,/**< enum value is callback after enter platform. */
|
|
||||||
kPlatformBack,/**< enum value is callback after exit antiAddiction. */
|
|
||||||
kPausePage,/**< enum value is callback after exit pause page. */
|
|
||||||
kExitPage,/**< enum value is callback after exit exit page. */
|
|
||||||
kAntiAddictionQuery,/**< enum value is callback after querying antiAddiction. */
|
|
||||||
kRealNameRegister,/**< enum value is callback after registering realname. */
|
|
||||||
kAccountSwitchSuccess,/**< enum value is callback of succeeding in switching account. */
|
|
||||||
kAccountSwitchFail,/**< enum value is callback of failing to switch account. */
|
|
||||||
kOpenShop,/**< enum value is callback of open the shop. */
|
|
||||||
kAccountSwitchCancel,/**< enum value is callback of canceling to switch account. */
|
|
||||||
kGameExitPage,/**< enum value is callback of no channel exit page. */
|
|
||||||
kUserExtension = 50000 /**< enum value is extension code . */
|
|
||||||
|
|
||||||
|
|
||||||
} UserActionResultCode;
|
|
||||||
/** @brief ToolBarPlace enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kToolBarTopLeft = 1,/**< enum the toolbar is at topleft. */
|
|
||||||
kToolBarTopRight,/**< enum the toolbar is at topright. */
|
|
||||||
kToolBarMidLeft,/**< enum the toolbar is at midleft. */
|
|
||||||
kToolBarMidRight,/**< enum the toolbar is at midright. */
|
|
||||||
kToolBarBottomLeft,/**< enum the toolbar is at bottomleft. */
|
|
||||||
kToolBarBottomRight,/**< enum the toolbar is at bottomright. */
|
|
||||||
} ToolBarPlace;
|
|
||||||
|
|
||||||
class ProtocolUser;
|
|
||||||
/**
|
|
||||||
*@class UserActionListener
|
|
||||||
*@brief the interface of user callback
|
|
||||||
*/
|
|
||||||
class UserActionListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of user callback
|
|
||||||
*@param the adatper of plugin
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onActionResult(ProtocolUser* pPlugin, UserActionResultCode code, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* @class ProtocolUser
|
|
||||||
*/
|
|
||||||
class ProtocolUser : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief User login
|
|
||||||
*/
|
|
||||||
virtual void login() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief User login
|
|
||||||
if the process of logining need to know the param of server_id ,
|
|
||||||
you can use the function
|
|
||||||
and if you must change oauthloginserver, you can add the param of oauthLoginServer
|
|
||||||
@param server_id
|
|
||||||
@param oauthLoginServer
|
|
||||||
*/
|
|
||||||
|
|
||||||
CC_DEPRECATED_ATTRIBUTE virtual void login(std::string server_id, std::string oauthLoginServer = "") = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief User login
|
|
||||||
if the process of logining need to know the parameters ,
|
|
||||||
you can use the function
|
|
||||||
@param the parameters
|
|
||||||
*/
|
|
||||||
virtual void login(std::map<std::string, std::string> info) = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Check whether the user logined or not
|
|
||||||
@return If user logined, return value is true;
|
|
||||||
else return value is false.
|
|
||||||
*/
|
|
||||||
virtual bool isLogined() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get USER ID
|
|
||||||
@return If user logined, return value is userID;
|
|
||||||
else return value is empty string.
|
|
||||||
*/
|
|
||||||
virtual std::string getUserID() = 0 ;
|
|
||||||
/**
|
|
||||||
@brief set the result listener
|
|
||||||
@param pListener The callback object for user result
|
|
||||||
*/
|
|
||||||
virtual void setActionListener(UserActionListener* listener) = 0 ;
|
|
||||||
/**
|
|
||||||
@brief get pListener The callback object for user result
|
|
||||||
@return the listener
|
|
||||||
*/
|
|
||||||
virtual UserActionListener* getActionListener() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief get plugin id
|
|
||||||
@return the plugin id
|
|
||||||
*/
|
|
||||||
virtual std::string getPluginId() = 0 ;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_USER_H__ */
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
#ifndef __STATISTICS_H__
|
|
||||||
#define __STATISTICS_H__
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class Statistics
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static void initInfo();
|
|
||||||
static void createPlugin(std::string pluginName, int pluginType);
|
|
||||||
static void callFunction(std::string pluginName, std::string functionName);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif //__STATISTICS_H__
|
|
||||||
Binary file not shown.
|
|
@ -1,245 +0,0 @@
|
||||||
/** @file AgentManager.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __CCX_AGENTMANAGER_H__
|
|
||||||
#define __CCX_AGENTMANAGER_H__
|
|
||||||
|
|
||||||
#include "PluginManager.h"
|
|
||||||
#include "ProtocolIAP.h"
|
|
||||||
#include "ProtocolAnalytics.h"
|
|
||||||
#include "ProtocolShare.h"
|
|
||||||
#include "ProtocolAds.h"
|
|
||||||
#include "ProtocolSocial.h"
|
|
||||||
#include "ProtocolUser.h"
|
|
||||||
#include "ProtocolPush.h"
|
|
||||||
#include "ProtocolCrash.h"
|
|
||||||
#include "ProtocolREC.h"
|
|
||||||
#include "ProtocolCustom.h"
|
|
||||||
#include "ProtocolAdTracking.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/** @brief Plugin_type enum, with inline docs */
|
|
||||||
typedef enum {
|
|
||||||
kPluginAds = 16,/**< enum value is the type of Ads. */
|
|
||||||
kPluginAnalytics = 1,/**< enum value is the type of Analytics. */
|
|
||||||
kPluginIAP = 8,/**< enum value is the type of IAP. */
|
|
||||||
kPluginShare = 2,/**< enum value is the type of Share. */
|
|
||||||
kPluginUser = 32,/**< enum value is the type of User. */
|
|
||||||
kPluginSocial = 4,/**< enum value is the type of Social. */
|
|
||||||
kPluginPush = 64,/**< enum value is the type of Push. */
|
|
||||||
kPluginCrash = 128,/**< enum value is the type of Crash. */
|
|
||||||
kPluginCustom = 256,/**< enum value is the type of Custom. */
|
|
||||||
kPluginREC = 512,/**< enum value is the type of REC. */
|
|
||||||
kPluginAdTracking = 1024,/**< enum value is the type of AdTracking. */
|
|
||||||
}Plugin_type;
|
|
||||||
/**
|
|
||||||
* @class AgentManager
|
|
||||||
*/
|
|
||||||
class AgentManager
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~AgentManager();
|
|
||||||
/**
|
|
||||||
@brief Get singleton of AgentManager
|
|
||||||
*/
|
|
||||||
|
|
||||||
static AgentManager* getInstance();
|
|
||||||
/**
|
|
||||||
@brief Destory the instance of AgentManager
|
|
||||||
*/
|
|
||||||
static void end();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@breif the init of AgentManager
|
|
||||||
@param the appKey of anysdk
|
|
||||||
@param the appSecret of anysdk
|
|
||||||
@param the privateKey of anysdk
|
|
||||||
@param the url of oauthLoginServer
|
|
||||||
@warning Must invoke this interface before loadAllPlugins
|
|
||||||
*/
|
|
||||||
void init(std::string appKey,std::string appSecret,std::string privateKey,std::string oauthLoginServer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief load the plugins
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE void loadALLPlugin();
|
|
||||||
/**
|
|
||||||
@brief unload the plugins
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE void unloadALLPlugin();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief load the plugins
|
|
||||||
*/
|
|
||||||
void loadAllPlugins();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief unload the plugins
|
|
||||||
*/
|
|
||||||
void unloadAllPlugins();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Analytics plugin
|
|
||||||
@return if Analytics plugin exist ,return value is Analytics plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolAnalytics* getAnalyticsPlugin(){return _pAnalytics;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get User plugin
|
|
||||||
@return if User plugin exist ,return value is User plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolUser* getUserPlugin(){return _pUser;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get IAP plugin
|
|
||||||
@return if IAP plugin exist ,return value is IAP plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
std::map<std::string , ProtocolIAP*>* getIAPPlugin(){return &_pluginsIAPMap;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Share plugin
|
|
||||||
@return if Share plugin exist ,return value is Share plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolShare* getSharePlugin(){return _pShare;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Social plugin
|
|
||||||
@return if Social plugin exist ,return value is Social plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolSocial* getSocialPlugin(){return _pSocial;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Ads plugin
|
|
||||||
@return if Ads plugin exist ,return value is Ads plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolAds* getAdsPlugin(){return _pAds;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Push plugin
|
|
||||||
@return if Push plugin exist ,return value is Push plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolPush* getPushPlugin(){return _pPush;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Crash plugin
|
|
||||||
@return if Crash plugin exist ,return value is Crash plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolCrash* getCrashPlugin(){return _pCrash;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Custom plugin
|
|
||||||
@return if Crash plugin exist ,return value is Custom plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolCustom* getCustomPlugin(){return _pCustom;};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get REC plugin
|
|
||||||
@return if REC plugin exist ,return value is REC plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolREC* getRECPlugin(){return _pREC;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get AdTracking plugin
|
|
||||||
@return if AdTracking plugin exist ,return value is AdTracking plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolAdTracking* getAdTrackingPlugin(){return _pAdTracking;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get channel ID
|
|
||||||
@return return value is channel ID.
|
|
||||||
*/
|
|
||||||
std::string getChannelId();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get custom param
|
|
||||||
@return return value is custom param for channel.
|
|
||||||
*/
|
|
||||||
std::string getCustomParam();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get framework version
|
|
||||||
@return return value is the version of AnySDKFramework.
|
|
||||||
*/
|
|
||||||
std::string getFrameworkVersion();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@Title: setIsAnaylticsEnabled
|
|
||||||
@Description: choose to open or close
|
|
||||||
@param @param enabled true or false
|
|
||||||
@return void
|
|
||||||
*/
|
|
||||||
void setIsAnaylticsEnabled(bool value){bIsAnaylticsEnabled = value;};
|
|
||||||
/**
|
|
||||||
@Title: isAnaylticsEnabled
|
|
||||||
@Description: the status of Anayltics
|
|
||||||
@param @return true or false
|
|
||||||
@return boolean
|
|
||||||
*/
|
|
||||||
bool isAnaylticsEnabled(){return bIsAnaylticsEnabled;};
|
|
||||||
|
|
||||||
|
|
||||||
void loadPlugin(const char* nodeName,int type);
|
|
||||||
protected:
|
|
||||||
void setDebugMode(bool flag);
|
|
||||||
std::string getSupportPlugin();
|
|
||||||
void release();
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
AgentManager(void);
|
|
||||||
|
|
||||||
// Analytics plugin
|
|
||||||
ProtocolAnalytics* _pAnalytics;
|
|
||||||
|
|
||||||
// user plugin
|
|
||||||
ProtocolUser* _pUser;
|
|
||||||
|
|
||||||
// IAP plugins
|
|
||||||
// ProtocolIAP* _pIAP;
|
|
||||||
std::map<std::string , ProtocolIAP*> _pluginsIAPMap;
|
|
||||||
|
|
||||||
// Share plugin
|
|
||||||
ProtocolShare* _pShare;
|
|
||||||
|
|
||||||
// Social plugin
|
|
||||||
ProtocolSocial* _pSocial;
|
|
||||||
|
|
||||||
// Ads plugin
|
|
||||||
ProtocolAds* _pAds;
|
|
||||||
|
|
||||||
// Push plugin
|
|
||||||
ProtocolPush* _pPush;
|
|
||||||
|
|
||||||
// Crash plugin
|
|
||||||
ProtocolCrash* _pCrash;
|
|
||||||
|
|
||||||
// Custom plugin
|
|
||||||
ProtocolCustom* _pCustom;
|
|
||||||
|
|
||||||
// REC plugin
|
|
||||||
ProtocolREC* _pREC;
|
|
||||||
|
|
||||||
// AdTracking plugin
|
|
||||||
ProtocolAdTracking* _pAdTracking;
|
|
||||||
|
|
||||||
bool bIsAnaylticsEnabled;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_AGENTMANAGER_H__ */
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
/** @file JSBRelation.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_JSBRELATION_H__
|
|
||||||
#define __CCX_JSBRELATION_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @class JSBRelation
|
|
||||||
*/
|
|
||||||
class JSBRelation
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static string getMethodsOfPlugin(PluginProtocol* plugin);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_JSBRELATION_H__ */
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
/** @file PluginFactory.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PLUGIN_FACTORY_H__
|
|
||||||
#define __CCX_PLUGIN_FACTORY_H__
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class PluginProtocol;
|
|
||||||
class PluginManager;
|
|
||||||
/**
|
|
||||||
* @class PluginFactory
|
|
||||||
*/
|
|
||||||
class PluginFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~PluginFactory();
|
|
||||||
/**
|
|
||||||
@brief Get singleton of PluginFactory
|
|
||||||
*/
|
|
||||||
static PluginFactory* getInstance();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Destory the instance of PluginFactory
|
|
||||||
*/
|
|
||||||
static void purgeFactory();
|
|
||||||
|
|
||||||
private:
|
|
||||||
friend class PluginManager;
|
|
||||||
PluginFactory(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief create the plugin by name and type
|
|
||||||
@param the name of plugin
|
|
||||||
@param the type of plugin
|
|
||||||
*/
|
|
||||||
PluginProtocol* createPlugin(const char* name, int pluginType);
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PLUGIN_FACTORY_H__ */
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
#ifndef __PLUGIN_JAVA_DATA_H__
|
|
||||||
#define __PLUGIN_JAVA_DATA_H__
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <jni.h>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
typedef struct _PluginJavaData_
|
|
||||||
{
|
|
||||||
jobject jobj;
|
|
||||||
std::string jclassName;
|
|
||||||
} PluginJavaData;
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif // __PLUGIN_JAVA_DATA_H__
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
#ifndef __PLUGIN_JNI_HELPER_H__
|
|
||||||
#define __PLUGIN_JNI_HELPER_H__
|
|
||||||
|
|
||||||
#include <jni.h>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk {namespace framework{
|
|
||||||
|
|
||||||
typedef struct PluginJniMethodInfo_
|
|
||||||
{
|
|
||||||
JNIEnv * env;
|
|
||||||
jclass classID;
|
|
||||||
jmethodID methodID;
|
|
||||||
} PluginJniMethodInfo;
|
|
||||||
|
|
||||||
class PluginJniHelper
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static JavaVM* getJavaVM();
|
|
||||||
static void setJavaVM(JavaVM *javaVM);
|
|
||||||
static JNIEnv* getEnv();
|
|
||||||
|
|
||||||
static bool getStaticMethodInfo(PluginJniMethodInfo &methodinfo, const char *className, const char *methodName, const char *paramCode);
|
|
||||||
static bool getMethodInfo(PluginJniMethodInfo &methodinfo, const char *className, const char *methodName, const char *paramCode);
|
|
||||||
static std::string jstring2string(jstring jstr);
|
|
||||||
static jstring newStringUTF(JNIEnv* env, const std::string& utf8Str);
|
|
||||||
|
|
||||||
static bool setClassLoaderFrom(jobject nativeActivityInstance);
|
|
||||||
|
|
||||||
static jmethodID loadclassMethod_methodID;
|
|
||||||
static jobject classloader;
|
|
||||||
|
|
||||||
private:
|
|
||||||
static JavaVM *_psJavaVM;
|
|
||||||
static bool getMethodInfo_DefaultClassLoader(PluginJniMethodInfo &methodinfo,
|
|
||||||
const char *className,
|
|
||||||
const char *methodName,
|
|
||||||
const char *paramCode);
|
|
||||||
};
|
|
||||||
|
|
||||||
}}
|
|
||||||
|
|
||||||
#endif // __PLUGIN_JNI_HELPER_H__
|
|
||||||
|
|
@ -1,156 +0,0 @@
|
||||||
#ifndef __PLUGIN_JNI_MACROS_H__
|
|
||||||
#define __PLUGIN_JNI_MACROS_H__
|
|
||||||
|
|
||||||
#define return_if_fails(cond) if (!(cond)) return;
|
|
||||||
#define return_val_if_fails(cond, ret) if(!(cond)) return (ret);
|
|
||||||
|
|
||||||
#define CALL_BASERET_JAVA_FUNC_WITH_PARAM(retType, paramCode, param, retCode, defaultRet) \
|
|
||||||
retType ret = defaultRet; \
|
|
||||||
return_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret); \
|
|
||||||
return_val_if_fails(paramCode != NULL && strlen(paramCode) > 0, ret); \
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz); \
|
|
||||||
return_val_if_fails(pData != NULL, ret); \
|
|
||||||
\
|
|
||||||
PluginJniMethodInfo t; \
|
|
||||||
if (PluginJniHelper::getMethodInfo(t \
|
|
||||||
, pData->jclassName.c_str() \
|
|
||||||
, funcName \
|
|
||||||
, paramCode)) \
|
|
||||||
{ \
|
|
||||||
ret = t.env->Call##retCode##Method(pData->jobj, t.methodID, param); \
|
|
||||||
t.env->DeleteLocalRef(t.classID); \
|
|
||||||
} \
|
|
||||||
return ret; \
|
|
||||||
|
|
||||||
|
|
||||||
#define CALL_BASERET_JAVA_FUNC(retType, paramCode, retCode, defaultRet) \
|
|
||||||
retType ret = defaultRet; \
|
|
||||||
return_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret); \
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz); \
|
|
||||||
return_val_if_fails(pData != NULL, ret); \
|
|
||||||
\
|
|
||||||
PluginJniMethodInfo t; \
|
|
||||||
if (PluginJniHelper::getMethodInfo(t \
|
|
||||||
, pData->jclassName.c_str() \
|
|
||||||
, funcName \
|
|
||||||
, paramCode)) \
|
|
||||||
{ \
|
|
||||||
ret = t.env->Call##retCode##Method(pData->jobj, t.methodID); \
|
|
||||||
t.env->DeleteLocalRef(t.classID); \
|
|
||||||
} \
|
|
||||||
return ret; \
|
|
||||||
|
|
||||||
|
|
||||||
#define CALL_JAVA_FUNC_WITH_VALIST(retCode) \
|
|
||||||
std::vector<PluginParam*> allParams; \
|
|
||||||
if (NULL != param) \
|
|
||||||
{ \
|
|
||||||
allParams.push_back(param); \
|
|
||||||
\
|
|
||||||
va_list argp; \
|
|
||||||
PluginParam* pArg = NULL; \
|
|
||||||
va_start( argp, param ); \
|
|
||||||
while (1) \
|
|
||||||
{ \
|
|
||||||
pArg = va_arg(argp, PluginParam*); \
|
|
||||||
if (pArg == NULL) \
|
|
||||||
break; \
|
|
||||||
\
|
|
||||||
allParams.push_back(pArg); \
|
|
||||||
} \
|
|
||||||
va_end(argp); \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
return call##retCode##FuncWithParam(funcName, allParams); \
|
|
||||||
|
|
||||||
|
|
||||||
#define CALL_JAVA_FUNC(retType, retCode, defaultRet, jRetCode) \
|
|
||||||
retType ret = defaultRet; \
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(this); \
|
|
||||||
if (NULL == pData) { \
|
|
||||||
PluginUtils::outputLog(ANDROID_LOG_ERROR, "PluginProtocol", "Can't find java data for plugin : %s", this->getPluginName()); \
|
|
||||||
return ret; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
std::string paramCode; \
|
|
||||||
int nParamNum = params.size(); \
|
|
||||||
if (0 == nParamNum) \
|
|
||||||
{ \
|
|
||||||
paramCode = "()"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName(this, funcName); \
|
|
||||||
} else \
|
|
||||||
{ \
|
|
||||||
PluginParam* pRetParam = NULL; \
|
|
||||||
bool needDel = false; \
|
|
||||||
if (nParamNum == 1) { \
|
|
||||||
pRetParam = params[0]; \
|
|
||||||
} else { \
|
|
||||||
std::map<std::string, PluginParam*> allParams; \
|
|
||||||
for (int i = 0; i < nParamNum; i++) \
|
|
||||||
{ \
|
|
||||||
PluginParam* pArg = params[i]; \
|
|
||||||
if (pArg == NULL) \
|
|
||||||
{ \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
char strKey[8] = { 0 }; \
|
|
||||||
sprintf(strKey, "Param%d", i + 1); \
|
|
||||||
allParams[strKey] = pArg; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
pRetParam = new PluginParam(allParams); \
|
|
||||||
needDel = true; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
switch(pRetParam->getCurrentType()) \
|
|
||||||
{ \
|
|
||||||
case PluginParam::kParamTypeInt: \
|
|
||||||
paramCode = "(I)"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), pRetParam->getIntValue()); \
|
|
||||||
break; \
|
|
||||||
case PluginParam::kParamTypeFloat: \
|
|
||||||
paramCode = "(F)"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), pRetParam->getFloatValue()); \
|
|
||||||
break; \
|
|
||||||
case PluginParam::kParamTypeBool: \
|
|
||||||
paramCode = "(Z)"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), pRetParam->getBoolValue()); \
|
|
||||||
break; \
|
|
||||||
case PluginParam::kParamTypeString: \
|
|
||||||
{ \
|
|
||||||
jstring jstr = PluginJniHelper::newStringUTF(PluginUtils::getEnv(), pRetParam->getStringValue()); \
|
|
||||||
paramCode = "(Ljava/lang/String;)"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), jstr); \
|
|
||||||
PluginUtils::getEnv()->DeleteLocalRef(jstr); \
|
|
||||||
} \
|
|
||||||
break; \
|
|
||||||
case PluginParam::kParamTypeStringMap: \
|
|
||||||
case PluginParam::kParamTypeMap: \
|
|
||||||
{ \
|
|
||||||
jobject jMap = PluginUtils::getJObjFromParam(pRetParam); \
|
|
||||||
paramCode = "(Lorg/json/JSONObject;)"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), jMap); \
|
|
||||||
PluginUtils::getEnv()->DeleteLocalRef(jMap); \
|
|
||||||
} \
|
|
||||||
break; \
|
|
||||||
default: \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
if (needDel && pRetParam != NULL) \
|
|
||||||
{ \
|
|
||||||
delete pRetParam; \
|
|
||||||
pRetParam = NULL; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
return ret; \
|
|
||||||
|
|
||||||
|
|
||||||
#endif // __PLUGIN_JNI_MACROS_H__
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
/** @file PluginFactory.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PLUGINMANAGER_H__
|
|
||||||
#define __CCX_PLUGINMANAGER_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include "PluginFactory.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @class PluginManager
|
|
||||||
*/
|
|
||||||
class PluginManager
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~PluginManager();
|
|
||||||
/**
|
|
||||||
@brief Get singleton of PluginManager
|
|
||||||
*/
|
|
||||||
static PluginManager* getInstance();
|
|
||||||
/**
|
|
||||||
@brief Destory the instance of PluginManager
|
|
||||||
*/
|
|
||||||
static void end();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief load the plugin by name and type
|
|
||||||
@param the name of plugin
|
|
||||||
@param the type of plugin
|
|
||||||
*/
|
|
||||||
PluginProtocol* loadPlugin(const char* name, int pluginType);
|
|
||||||
/**
|
|
||||||
@brief unload the plugin by name and type
|
|
||||||
@param the name of plugin
|
|
||||||
@param the type of plugin
|
|
||||||
*/
|
|
||||||
void unloadPlugin(const char* name, int pluginType = 0);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
PluginManager(void);
|
|
||||||
std::map<std::string, PluginProtocol*> _pluginsMap;
|
|
||||||
// bool _isDebug;
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PLUGINMANAGER_H__ */
|
|
||||||
|
|
@ -1,126 +0,0 @@
|
||||||
/** @file PluginParam.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PLUGIN_PARAM_H__
|
|
||||||
#define __CCX_PLUGIN_PARAM_H__
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
/// \typedef std::map<std::string, std::string> StringMap
|
|
||||||
/// typedef YString.
|
|
||||||
typedef std::map<std::string, std::string> StringMap;
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class PluginProtocol;
|
|
||||||
/**
|
|
||||||
* @class PluginParam
|
|
||||||
*/
|
|
||||||
class PluginParam
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
@brief the default constructor of PluginParam
|
|
||||||
*/
|
|
||||||
PluginParam();
|
|
||||||
|
|
||||||
virtual ~PluginParam();
|
|
||||||
/**
|
|
||||||
@brief the constructor of PluginParam
|
|
||||||
@param the value is Integer
|
|
||||||
*/
|
|
||||||
PluginParam(int nValue);
|
|
||||||
/**
|
|
||||||
@brief the constructor of PluginParam
|
|
||||||
@param the value is float
|
|
||||||
*/
|
|
||||||
PluginParam(float fValue);
|
|
||||||
/**
|
|
||||||
@brief the constructor of PluginParam
|
|
||||||
@param the value is boolean
|
|
||||||
*/
|
|
||||||
PluginParam(bool bValue);
|
|
||||||
/**
|
|
||||||
@brief the default constructor of PluginParam
|
|
||||||
@param the value is char
|
|
||||||
*/
|
|
||||||
PluginParam(const char* strValue);
|
|
||||||
/**
|
|
||||||
@brief the default constructor of PluginParam
|
|
||||||
@param the value is StringMap
|
|
||||||
*/
|
|
||||||
PluginParam(StringMap strMapValue);
|
|
||||||
|
|
||||||
typedef enum{
|
|
||||||
kParamTypeNull = 0,
|
|
||||||
kParamTypeInt,
|
|
||||||
kParamTypeFloat,
|
|
||||||
kParamTypeBool,
|
|
||||||
kParamTypeString,
|
|
||||||
kParamTypeStringMap,
|
|
||||||
kParamTypeMap,
|
|
||||||
} ParamType;
|
|
||||||
/**
|
|
||||||
@brief get the ParamType of value
|
|
||||||
*/
|
|
||||||
inline ParamType getCurrentType() {
|
|
||||||
return _type;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the int value
|
|
||||||
*/
|
|
||||||
inline int getIntValue() {
|
|
||||||
return _intValue;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the float value
|
|
||||||
*/
|
|
||||||
inline float getFloatValue() {
|
|
||||||
return _floatValue;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the boolean value
|
|
||||||
*/
|
|
||||||
inline bool getBoolValue() {
|
|
||||||
return _boolValue;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the char value
|
|
||||||
*/
|
|
||||||
inline const char* getStringValue() {
|
|
||||||
return _strValue.c_str();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the map of value
|
|
||||||
*/
|
|
||||||
inline std::map<std::string, PluginParam*> getMapValue() {
|
|
||||||
return _mapValue;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the StringMap value
|
|
||||||
*/
|
|
||||||
inline StringMap getStrMapValue() {
|
|
||||||
return _strMapValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
friend class PluginProtocol;
|
|
||||||
/**
|
|
||||||
@brief the constructor of PluginParam
|
|
||||||
@param the map of value
|
|
||||||
*/
|
|
||||||
PluginParam(std::map<std::string, PluginParam*> mapValue);
|
|
||||||
|
|
||||||
private:
|
|
||||||
ParamType _type;
|
|
||||||
|
|
||||||
int _intValue;
|
|
||||||
float _floatValue;
|
|
||||||
bool _boolValue;
|
|
||||||
std::string _strValue;
|
|
||||||
std::map<std::string, PluginParam*> _mapValue;
|
|
||||||
StringMap _strMapValue;
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PLUGIN_PARAM_H__ */
|
|
||||||
|
|
@ -1,144 +0,0 @@
|
||||||
/** @file PluginProtocol.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_IPLUGIN_H__
|
|
||||||
#define __CCX_IPLUGIN_H__
|
|
||||||
|
|
||||||
#include "PluginParam.h"
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
|
|
||||||
#define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
|
|
||||||
#elif _MSC_VER >= 1400 //vs 2005 or higher
|
|
||||||
#define CC_DEPRECATED_ATTRIBUTE __declspec(deprecated)
|
|
||||||
#else
|
|
||||||
#define CC_DEPRECATED_ATTRIBUTE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @class PluginProtocol
|
|
||||||
* @brief The super class for all plugins.
|
|
||||||
*/
|
|
||||||
class PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~PluginProtocol() {};
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief set plugin name
|
|
||||||
*@param the name of plugin
|
|
||||||
*/
|
|
||||||
virtual void setPluginName(const char* name) = 0 ;
|
|
||||||
/**
|
|
||||||
*@brief get plugin name
|
|
||||||
*@return the name of plugin
|
|
||||||
*/
|
|
||||||
virtual const char* getPluginName() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief get the version of plugin
|
|
||||||
*@return the version of plugin
|
|
||||||
*/
|
|
||||||
virtual std::string getPluginVersion();
|
|
||||||
/**
|
|
||||||
*@brief get the version of sdk
|
|
||||||
*@return the version of sdk
|
|
||||||
*/
|
|
||||||
virtual std::string getSDKVersion();
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief switch debug plug-in on/off
|
|
||||||
*@param the value of on/off
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE virtual void setDebugMode(bool bDebug);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void callFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void callFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return string
|
|
||||||
*/
|
|
||||||
virtual std::string callStringFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return string
|
|
||||||
*/
|
|
||||||
virtual std::string callStringFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return int
|
|
||||||
*/
|
|
||||||
virtual int callIntFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return int
|
|
||||||
*/
|
|
||||||
virtual int callIntFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return bool
|
|
||||||
*/
|
|
||||||
virtual bool callBoolFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return bool
|
|
||||||
*/
|
|
||||||
virtual bool callBoolFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return float
|
|
||||||
*/
|
|
||||||
virtual float callFloatFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return float
|
|
||||||
*/
|
|
||||||
virtual float callFloatFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Check function the plugin support or not
|
|
||||||
@param the name of plugin
|
|
||||||
@return if the function support ,return true
|
|
||||||
else retur false
|
|
||||||
*/
|
|
||||||
virtual bool isFunctionSupported(std::string functionName);
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_IPLUGIN_H__ */
|
|
||||||
|
|
@ -1,157 +0,0 @@
|
||||||
#ifndef __PLUGIN_UTILS_H__
|
|
||||||
#define __PLUGIN_UTILS_H__
|
|
||||||
|
|
||||||
#include "PluginJniHelper.h"
|
|
||||||
#include "PluginJavaData.h"
|
|
||||||
#include <map>
|
|
||||||
#include <list>
|
|
||||||
#include "PluginParam.h"
|
|
||||||
#include "PluginJniMacros.h"
|
|
||||||
#include <android/log.h>
|
|
||||||
//#include <android_native_app_glue.h>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class PluginProtocol;
|
|
||||||
class PluginUtils
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
//cjh static void initPluginWrapper(android_app* app);
|
|
||||||
static jobject createJavaMapObject(std::map<std::string, std::string>* paramMap);
|
|
||||||
static jobject createJavaListObject(std::list<std::string>* paramList);
|
|
||||||
static void initJavaPlugin(PluginProtocol* pPlugin, jobject jObj, const char* className, int type);
|
|
||||||
static JNIEnv* getEnv();
|
|
||||||
|
|
||||||
static PluginJavaData* getPluginJavaData(PluginProtocol* pKeyObj);
|
|
||||||
static void setPluginJavaData(PluginProtocol* pKeyObj, PluginJavaData* pData, int type);
|
|
||||||
static void erasePluginJavaData(PluginProtocol* pKeyObj,int type);
|
|
||||||
static void erasePluginJavaData(std::string key);
|
|
||||||
|
|
||||||
static PluginProtocol* getPluginPtr(std::string className);
|
|
||||||
|
|
||||||
static jobject getJObjFromParam(PluginParam* param);
|
|
||||||
|
|
||||||
// methods have no return value
|
|
||||||
template <typename T>
|
|
||||||
static void callJavaFunctionWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)
|
|
||||||
{
|
|
||||||
return_if_fails(funcName != NULL && strlen(funcName) > 0);
|
|
||||||
return_if_fails(paramCode != NULL && strlen(paramCode) > 0);
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);
|
|
||||||
return_if_fails(pData != NULL);
|
|
||||||
|
|
||||||
PluginJniMethodInfo t;
|
|
||||||
if (PluginJniHelper::getMethodInfo(t
|
|
||||||
, pData->jclassName.c_str()
|
|
||||||
, funcName
|
|
||||||
, paramCode))
|
|
||||||
{
|
|
||||||
t.env->CallVoidMethod(pData->jobj, t.methodID, param);
|
|
||||||
t.env->DeleteLocalRef(t.classID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static void callJavaFunctionWithName(PluginProtocol* thiz, const char* funcName)
|
|
||||||
{
|
|
||||||
return_if_fails(funcName != NULL && strlen(funcName) > 0);
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);
|
|
||||||
return_if_fails(pData != NULL);
|
|
||||||
|
|
||||||
PluginJniMethodInfo t;
|
|
||||||
if (PluginJniHelper::getMethodInfo(t
|
|
||||||
, pData->jclassName.c_str()
|
|
||||||
, funcName
|
|
||||||
, "()V"))
|
|
||||||
{
|
|
||||||
t.env->CallVoidMethod(pData->jobj, t.methodID);
|
|
||||||
t.env->DeleteLocalRef(t.classID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// methods return value is string
|
|
||||||
template <typename T>
|
|
||||||
static std::string callJavaStringFuncWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)
|
|
||||||
{
|
|
||||||
std::string ret = "";
|
|
||||||
return_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret);
|
|
||||||
return_val_if_fails(paramCode != NULL && strlen(paramCode) > 0, ret);
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);
|
|
||||||
return_val_if_fails(pData != NULL, ret);
|
|
||||||
|
|
||||||
PluginJniMethodInfo t;
|
|
||||||
if (PluginJniHelper::getMethodInfo(t
|
|
||||||
, pData->jclassName.c_str()
|
|
||||||
, funcName
|
|
||||||
, paramCode))
|
|
||||||
{
|
|
||||||
jstring strRet = (jstring)t.env->CallObjectMethod(pData->jobj, t.methodID, param);
|
|
||||||
ret = PluginJniHelper::jstring2string(strRet);
|
|
||||||
t.env->DeleteLocalRef(t.classID);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
static std::string callJavaStringFuncWithName(PluginProtocol* thiz, const char* funcName)
|
|
||||||
{
|
|
||||||
std::string ret = "";
|
|
||||||
return_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret);
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);
|
|
||||||
return_val_if_fails(pData != NULL, ret);
|
|
||||||
|
|
||||||
PluginJniMethodInfo t;
|
|
||||||
if (PluginJniHelper::getMethodInfo(t
|
|
||||||
, pData->jclassName.c_str()
|
|
||||||
, funcName
|
|
||||||
, "()Ljava/lang/String;"))
|
|
||||||
{
|
|
||||||
jstring strRet = (jstring) t.env->CallObjectMethod(pData->jobj, t.methodID);
|
|
||||||
ret = PluginJniHelper::jstring2string(strRet);
|
|
||||||
t.env->DeleteLocalRef(t.classID);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
// methods return value is int
|
|
||||||
template <typename T>
|
|
||||||
static int callJavaIntFuncWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC_WITH_PARAM(int, paramCode, param, Int, 0)
|
|
||||||
}
|
|
||||||
static int callJavaIntFuncWithName(PluginProtocol* thiz, const char* funcName)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC(int, "()I", Int, 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
// methods return value is float
|
|
||||||
template <typename T>
|
|
||||||
static float callJavaFloatFuncWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC_WITH_PARAM(float, paramCode, param, Float, 0.0f)
|
|
||||||
}
|
|
||||||
static float callJavaFloatFuncWithName(PluginProtocol* thiz, const char* funcName)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC(float, "()F", Float, 0.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
// methods return value is bool
|
|
||||||
template <typename T>
|
|
||||||
static bool callJavaBoolFuncWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC_WITH_PARAM(bool, paramCode, param, Boolean, false)
|
|
||||||
}
|
|
||||||
static bool callJavaBoolFuncWithName(PluginProtocol* thiz, const char* funcName)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC(bool, "()Z", Boolean, false)
|
|
||||||
}
|
|
||||||
|
|
||||||
static void callJavaFunctionWithName_string_map(PluginProtocol* thiz, const char* funcName, const char* keyParam, std::map<std::string, std::string>* paramMap);
|
|
||||||
|
|
||||||
static void outputLog(int type, const char* logTag, const char* pFormat, ...);
|
|
||||||
static void output(int type, const char* logTag, const char* contents);
|
|
||||||
|
|
||||||
static void resetLogLevel();
|
|
||||||
private:
|
|
||||||
static std::string _logLevel;
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif //__PLUGIN_UTILS_H__
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
/** @file ProtocolAdTracking.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_ADTRACKING_H__
|
|
||||||
#define __CCX_PROTOCOL_ADTRACKING_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/**
|
|
||||||
*@class ProtocolAdTracking
|
|
||||||
*@brief the interface of AdTracking
|
|
||||||
*/
|
|
||||||
class ProtocolAdTracking : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: onRegister
|
|
||||||
* @Description: Call this method if you want to track register events as happening during a section.
|
|
||||||
* @param userId user identifier
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
virtual void onRegister(const char* userId) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: onLogin
|
|
||||||
* @Description:Call this method if you want to track login events as happening during a section.
|
|
||||||
* @param userInfo The details of this parameters are already covered by document.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
virtual void onLogin(std::map<std::string, std::string> userInfo) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: onPay
|
|
||||||
* @Description: Call this method if you want to track pay events as happening during a section.
|
|
||||||
* @param productInfo The details of this parameters are already covered by document.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
virtual void onPay(std::map<std::string, std::string> productInfo) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: trackEvent
|
|
||||||
* @Description: Call this method if you want to track custom events with parameters as happening during a section.
|
|
||||||
* @param eventId The custom event name.
|
|
||||||
* @param paramMap The details of this parameters are already covered by document.
|
|
||||||
*/
|
|
||||||
virtual void trackEvent(const char* eventId, std::map<std::string, std::string>* paramMap = NULL) = 0;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* ----- #ifndef __CCX_PROTOCOL_ADTRACKING_H__ ----- */
|
|
||||||
|
|
@ -1,133 +0,0 @@
|
||||||
/** @file ProtocolAds.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_ADS_H__
|
|
||||||
#define __CCX_PROTOCOL_ADS_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> TAdsDeveloperInfo
|
|
||||||
/// typedef TAdsDeveloperInfo.
|
|
||||||
typedef std::map<std::string, std::string> TAdsDeveloperInfo;
|
|
||||||
/// \typedef std::map<std::string, std::string> TAdsInfo
|
|
||||||
/// typedef TAdsInfo.
|
|
||||||
typedef std::map<std::string, std::string> TAdsInfo;
|
|
||||||
/** @brief AdsResultCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kAdsReceived = 0, /**< enum the callback: the ad is received is at center. */
|
|
||||||
|
|
||||||
kAdsShown, /**< enum the callback: the advertisement dismissed. */
|
|
||||||
kAdsDismissed, /**< enum the callback: the advertisement dismissed. */
|
|
||||||
|
|
||||||
kPointsSpendSucceed, /**< enum the callback: the points spend succeed. */
|
|
||||||
kPointsSpendFailed, /**< enum the callback: the points spend failed. */
|
|
||||||
|
|
||||||
kNetworkError, /**< enum the callback of Network error at center. */
|
|
||||||
kUnknownError, /**< enum the callback of Unknown error. */
|
|
||||||
kOfferWallOnPointsChanged, /**< enum the callback of Changing the point of offerwall. */
|
|
||||||
kRewardedVideoWithReward,/**< enum the callback of receiving the reward of rewardedvideo. */
|
|
||||||
kInAppPurchaseFinished,/**< enum the callback of finishing IAP ad. */
|
|
||||||
kAdsClicked,/**< enum the callback of the advertisement clicked. */
|
|
||||||
kAdsExtension = 40000 /**< enum value is extension code . */
|
|
||||||
} AdsResultCode;
|
|
||||||
/** @brief AdsPos enum, with inline docs */
|
|
||||||
typedef enum {
|
|
||||||
kPosCenter = 0,/**< enum the toolbar is at center. */
|
|
||||||
kPosTop,/**< enum the toolbar is at top. */
|
|
||||||
kPosTopLeft,/**< enum the toolbar is at topleft. */
|
|
||||||
kPosTopRight,/**< enum the toolbar is at topright. */
|
|
||||||
kPosBottom,/**< enum the toolbar is at bottom. */
|
|
||||||
kPosBottomLeft,/**< enum the toolbar is at bottomleft. */
|
|
||||||
kPosBottomRight,/**< enum the toolbar is at bottomright. */
|
|
||||||
} AdsPos;
|
|
||||||
/** @brief AdsType enum, with inline docs */
|
|
||||||
typedef enum {
|
|
||||||
AD_TYPE_BANNER = 0,/**< enum value is banner ads . */
|
|
||||||
AD_TYPE_FULLSCREEN,/**< enum value is fullscreen ads . */
|
|
||||||
AD_TYPE_MOREAPP,/**< enum value is moreapp ads . */
|
|
||||||
AD_TYPE_OFFERWALL,/**< enum value is offerwall ads . */
|
|
||||||
AD_TYPE_REWARDEDVIDEO,/**< enum value is rewarded video ads . */
|
|
||||||
AD_TYPE_NATIVEEXPRESS,/**< enum value is Native express ads . */
|
|
||||||
AD_TYPE_NATIVEADVANCED,/**< enum value is Native advanced ads . */
|
|
||||||
} AdsType;
|
|
||||||
|
|
||||||
class ProtocolAds;
|
|
||||||
class AdsListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief The advertisement request result
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onAdsResult(AdsResultCode code, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ProtocolAds : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief show adview
|
|
||||||
@param the type of ads
|
|
||||||
@param the idx of ads
|
|
||||||
*/
|
|
||||||
virtual void showAds(AdsType adsType, int idx = 1) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Hide the adview
|
|
||||||
@param the type of ads
|
|
||||||
@param the idx of ads
|
|
||||||
*/
|
|
||||||
virtual void hideAds(AdsType adsType, int idx = 1) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief preload the adview
|
|
||||||
@param the type of ads
|
|
||||||
@param the idx of ads
|
|
||||||
*/
|
|
||||||
virtual void preloadAds(AdsType adsType, int idx = 1)= 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief Query the points of player
|
|
||||||
*@return the point
|
|
||||||
*/
|
|
||||||
virtual float queryPoints() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief Spend the points.
|
|
||||||
Use this method to notify server spend points.
|
|
||||||
*@param points Need spend number of points
|
|
||||||
*/
|
|
||||||
virtual void spendPoints(int points) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief set the Ads listener
|
|
||||||
@param pListener The callback object for Ads result
|
|
||||||
*/
|
|
||||||
virtual void setAdsListener(AdsListener* listener) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief get pListener The callback object for Ads result
|
|
||||||
@return the listener
|
|
||||||
*/
|
|
||||||
virtual AdsListener* getAdsListener() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Is it supportive of this type of ads
|
|
||||||
@param the type of ads
|
|
||||||
@return if it is supportive ,return true
|
|
||||||
else retur false
|
|
||||||
*/
|
|
||||||
virtual bool isAdTypeSupported(AdsType adType) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_ADS_H__ */
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
/** @file ProtocolAnalytics.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_ANALYTICS_H__
|
|
||||||
#define __CCX_PROTOCOL_ANALYTICS_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> LogEventParamPair
|
|
||||||
/// typedef LogEventParamPair.
|
|
||||||
typedef std::pair< std::string, std::string > LogEventParamPair;
|
|
||||||
/// \typedef std::map<std::string, std::string> LogEventParamMap
|
|
||||||
/// typedef LogEventParamMap.
|
|
||||||
typedef std::map< std::string, std::string > LogEventParamMap;
|
|
||||||
typedef enum {
|
|
||||||
ANONYMOUS,/**< enum value is anonymous typek. */
|
|
||||||
REGISTED,/**< enum value is registed type. */
|
|
||||||
SINA_WEIBO,/**< enum value is sineweibo type. */
|
|
||||||
TENCENT_WEIBO,/**< enum value is tecentweibo type */
|
|
||||||
QQ,/**< enum value is qq type */
|
|
||||||
ND91,/**< enum value is nd91 type. */
|
|
||||||
} AccountType;
|
|
||||||
typedef enum {
|
|
||||||
LOGIN,/**< enum value is the login operate. */
|
|
||||||
LOGOUT,/**< enum value is the logout operate. */
|
|
||||||
REGISTER,/**< enum value is the register operate. */
|
|
||||||
} AccountOperate;
|
|
||||||
typedef enum {
|
|
||||||
MALE,/**< enum value is male. */
|
|
||||||
FEMALE,/**< enum value is female. */
|
|
||||||
UNKNOWN,/**< enum value is unknow. */
|
|
||||||
|
|
||||||
} AccountGender;
|
|
||||||
typedef enum {
|
|
||||||
GUIDE_LINE,/**< enum value is the guideline type.. */
|
|
||||||
MAIN_LINE,/**< enum value is the mainline type.. */
|
|
||||||
BRANCH_LINE,/**<enum value is the branchline type.. */
|
|
||||||
DAILY,/**< enum value is the daily type.. */
|
|
||||||
ACTIVITY,/**< enum value is the activity type. */
|
|
||||||
OTHER,/**< enum value is other type. */
|
|
||||||
} TaskType;
|
|
||||||
/**
|
|
||||||
*@class ProtocolAnalytics
|
|
||||||
*@brief the interface of Analytics
|
|
||||||
*/
|
|
||||||
class ProtocolAnalytics : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Start a new session.
|
|
||||||
*/
|
|
||||||
virtual void startSession() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Stop a session.
|
|
||||||
@warning This interface only worked on android
|
|
||||||
*/
|
|
||||||
virtual void stopSession() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Set the timeout for expiring a session.
|
|
||||||
@param millis In milliseconds as the unit of time.
|
|
||||||
@note It must be invoked before calling startSession.
|
|
||||||
*/
|
|
||||||
virtual void setSessionContinueMillis(long millis) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief log an error
|
|
||||||
@param errorId The identity of error
|
|
||||||
@param message Extern message for the error
|
|
||||||
*/
|
|
||||||
virtual void logError(const char* errorId, const char* message) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief log an event.
|
|
||||||
@param eventId The identity of event
|
|
||||||
@param paramMap Extern parameters of the event, use NULL if not needed.
|
|
||||||
*/
|
|
||||||
virtual void logEvent(const char* eventId, LogEventParamMap* paramMap = NULL) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Track an event begin.
|
|
||||||
@param eventId The identity of event
|
|
||||||
*/
|
|
||||||
virtual void logTimedEventBegin(const char* eventId) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Track an event end.
|
|
||||||
@param eventId The identity of event
|
|
||||||
*/
|
|
||||||
virtual void logTimedEventEnd(const char* eventId) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Whether to catch uncaught exceptions to server.
|
|
||||||
@warning This interface only worked on android.
|
|
||||||
*/
|
|
||||||
virtual void setCaptureUncaughtException(bool enabled) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_ANALYTICS_H__ */
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
/** @file ProtocolCrash.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_CRASH_H__
|
|
||||||
#define __CCX_PROTOCOL_CRASH_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class ProtocolCrash : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* set user identifier
|
|
||||||
*
|
|
||||||
* @param userInfo
|
|
||||||
*/
|
|
||||||
virtual void setUserIdentifier(const char* identifier) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The uploader captured in exception information
|
|
||||||
*
|
|
||||||
* @param message Set the custom information
|
|
||||||
* @param exception The exception
|
|
||||||
*/
|
|
||||||
virtual void reportException(const char* message, const char* exception) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* customize logging
|
|
||||||
*
|
|
||||||
* @param string Custom log
|
|
||||||
*/
|
|
||||||
virtual void leaveBreadcrumb(const char* breadcrumb) = 0;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_CRASH_H__ */
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
/** @file ProtocolCustom.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_CUSTOM_H__
|
|
||||||
#define __CCX_PROTOCOL_CUSTOM_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kCustomExtension = 80000 /**< enum value is extension code . */
|
|
||||||
} CustomResultCode;
|
|
||||||
/**
|
|
||||||
*@class CustomResultListener
|
|
||||||
*@brief the interface of share callback
|
|
||||||
*/
|
|
||||||
class CustomResultListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of share callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onCustomResult(CustomResultCode ret, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
*@class ProtocolCustom
|
|
||||||
*@brief the interface of custom
|
|
||||||
*/
|
|
||||||
class ProtocolCustom : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
@breif set the result listener
|
|
||||||
@param pListener The callback object for custom result
|
|
||||||
@wraning Must invoke this interface before custom
|
|
||||||
*/
|
|
||||||
virtual void setResultListener(CustomResultListener* pListener) = 0;
|
|
||||||
|
|
||||||
virtual CustomResultListener* getCustomListener() = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* ----- #ifndef __CCX_PROTOCOL_Custom_H__ ----- */
|
|
||||||
|
|
@ -1,119 +0,0 @@
|
||||||
/** @file ProtocolIAP.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_IAP_H__
|
|
||||||
#define __CCX_PROTOCOL_IAP_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> TIAPDeveloperInfo
|
|
||||||
/// typedef TIAPDeveloperInfo.
|
|
||||||
typedef std::map<std::string, std::string> TIAPDeveloperInfo;
|
|
||||||
/// \typedef std::map<std::string, std::string> TProductInfo
|
|
||||||
/// typedef TProductInfo.
|
|
||||||
typedef std::map<std::string, std::string> TProductInfo;
|
|
||||||
/// typedef TProductsInfo.
|
|
||||||
typedef std::map<std::string, TProductInfo> AllProductsInfo;
|
|
||||||
/** @brief PayResultCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kPaySuccess = 0,/**< enum value is callback of succeeding in paying . */
|
|
||||||
kPayFail,/**< enum value is callback of failing to pay . */
|
|
||||||
kPayCancel,/**< enum value is callback of canceling to pay . */
|
|
||||||
kPayNetworkError,/**< enum value is callback of network error . */
|
|
||||||
kPayProductionInforIncomplete,/**< enum value is callback of incompleting info . */
|
|
||||||
kPayInitSuccess,/**< enum value is callback of succeeding in initing sdk . */
|
|
||||||
kPayInitFail,/**< enum value is callback of failing to init sdk . */
|
|
||||||
kPayNowPaying,/**< enum value is callback of paying now . */
|
|
||||||
kPayRechargeSuccess,/**< enum value is callback of succeeding in recharging. */
|
|
||||||
kPayExtension = 30000 /**< enum value is extension code . */
|
|
||||||
} PayResultCode;
|
|
||||||
/** @brief RequestResultCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kRequestSuccess = 31000,/**< enum value is callback of succeeding in paying . */
|
|
||||||
kRequestFail/**< enum value is callback of failing to pay . */
|
|
||||||
} RequestResultCode;
|
|
||||||
/**
|
|
||||||
*@class PayResultListener
|
|
||||||
*@brief the interface of pay callback
|
|
||||||
*/
|
|
||||||
class PayResultListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of pay callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*@param the info of pay
|
|
||||||
*/
|
|
||||||
virtual void onPayResult(PayResultCode ret, const char* msg, TProductInfo info) = 0;
|
|
||||||
/**
|
|
||||||
*@brief the interface of request callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*@param the info of request product
|
|
||||||
*/
|
|
||||||
virtual void onRequestResult(RequestResultCode ret, const char* msg, AllProductsInfo info) {}
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
*@class ProtocolIAP
|
|
||||||
*@brief the interface of pay
|
|
||||||
*/
|
|
||||||
|
|
||||||
class ProtocolIAP : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief pay for product
|
|
||||||
@param info The info of product, must contains key:
|
|
||||||
productName The name of product
|
|
||||||
productPrice The price of product(must can be parse to float)
|
|
||||||
productDesc The description of product
|
|
||||||
@warning For different plugin, the parameter should have other keys to pay.
|
|
||||||
Look at the manual of plugins.
|
|
||||||
*/
|
|
||||||
virtual void payForProduct(TProductInfo info) = 0;
|
|
||||||
/**
|
|
||||||
@brief get order id
|
|
||||||
@return the order id
|
|
||||||
*/
|
|
||||||
virtual std::string getOrderId() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@breif set the result listener
|
|
||||||
@param pListener The callback object for pay result
|
|
||||||
@wraning Must invoke this interface before payForProduct.
|
|
||||||
*/
|
|
||||||
virtual void setResultListener(PayResultListener* pListener) = 0;
|
|
||||||
|
|
||||||
virtual PayResultListener* getPayListener() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief get plugin id
|
|
||||||
@return the plugin id
|
|
||||||
*/
|
|
||||||
virtual std::string getPluginId() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief change the state of paying
|
|
||||||
@param the state
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void resetPayState()
|
|
||||||
{
|
|
||||||
_paying = false;
|
|
||||||
}
|
|
||||||
static bool _paying;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_IAP_H__ */
|
|
||||||
|
|
@ -1,104 +0,0 @@
|
||||||
/** @file PluginFactory.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_PUSH_H__
|
|
||||||
#define __CCX_PROTOCOL_PUSH_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <list>
|
|
||||||
#include <string>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/** @brief Plugin_type enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kPushReceiveMessage = 0,/**value is callback of Receiving Message . */
|
|
||||||
kPushExtensionCode = 60000 /**< enum value is extension code . */
|
|
||||||
|
|
||||||
|
|
||||||
} PushActionResultCode;
|
|
||||||
class ProtocolPush;
|
|
||||||
/**
|
|
||||||
*@class PushActionListener
|
|
||||||
*@brief the interface of Push callback
|
|
||||||
*/
|
|
||||||
class PushActionListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of Push callback
|
|
||||||
*@param the adatper of plugin
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onActionResult(ProtocolPush* pPlugin, PushActionResultCode code, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* @class ProtocolPush
|
|
||||||
*/
|
|
||||||
class ProtocolPush : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief start/register Push services
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void startPush() = 0 ;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief close Push services
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void closePush() = 0 ;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief set alias
|
|
||||||
*@param tags
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void setAlias(string alias) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief del alias
|
|
||||||
*@param tags
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void delAlias(string alias) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief set tag
|
|
||||||
*@param tags
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void setTags(list<string> tags) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief delete tag
|
|
||||||
*@param tags
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void delTags(list<string> tags) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief set the result listener
|
|
||||||
@param pListener The callback object for push result
|
|
||||||
*/
|
|
||||||
virtual void setActionListener(PushActionListener* listener) = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief get pListener The callback object for Push result
|
|
||||||
@return the listener
|
|
||||||
*/
|
|
||||||
virtual PushActionListener* getActionListener() = 0 ;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_PUSH_H__ */
|
|
||||||
|
|
@ -1,83 +0,0 @@
|
||||||
/** @file ProtocolREC.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_REC_H__
|
|
||||||
#define __CCX_PROTOCOL_REC_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
typedef std::map<std::string, std::string> TVideoInfo;
|
|
||||||
|
|
||||||
/** @brief RECResultCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kRECInitSuccess = 0,/**< enum value is callback of succeeding in initing sdk . */
|
|
||||||
kRECInitFail,/**< enum value is callback of failing to init sdk. */
|
|
||||||
kRECStartRecording,/**< enum value is callback of starting to record. */
|
|
||||||
kRECStopRecording,/**< enum value is callback of stoping to record. */
|
|
||||||
kRECPauseRecording,/**< enum value is callback of pausing to record. */
|
|
||||||
kRECResumeRecording,/**< enum value is callback of resuming to record. */
|
|
||||||
kRECEnterSDKPage,/**< enum value is callback of entering SDK`s page. */
|
|
||||||
kRECQuitSDKPage,/**< enum value is callback of quiting SDK`s page. */
|
|
||||||
kRECShareSuccess,/**< enum value is callback of succeeding in sharing. */
|
|
||||||
kRECShareFail,/**< enum value is callback of failing to share. */
|
|
||||||
kRECExtension = 90000 /**< enum value is extension code . */
|
|
||||||
} RECResultCode;
|
|
||||||
/**
|
|
||||||
*@class RECResultListener
|
|
||||||
*@brief the interface of REC callback
|
|
||||||
*/
|
|
||||||
class RECResultListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of REC callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onRECResult(RECResultCode ret, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
*@class ProtocolREC
|
|
||||||
*@brief the interface of REC
|
|
||||||
*/
|
|
||||||
class ProtocolREC : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: Start to record video
|
|
||||||
*/
|
|
||||||
virtual void startRecording() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: Stop to record video
|
|
||||||
*/
|
|
||||||
virtual void stopRecording() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: share video
|
|
||||||
* @Param info The info of share
|
|
||||||
*/
|
|
||||||
virtual void share(TVideoInfo info) = 0;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@breif set the result listener
|
|
||||||
@param pListener The callback object for REC result
|
|
||||||
@wraning Must invoke this interface before REC
|
|
||||||
*/
|
|
||||||
virtual void setResultListener(RECResultListener* pListener) = 0;
|
|
||||||
|
|
||||||
virtual RECResultListener* getRECListener() = 0;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* ----- #ifndef __CCX_PROTOCOL_SHARE_H__ ----- */
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
/** @file ProtocolShare.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_SHARE_H__
|
|
||||||
#define __CCX_PROTOCOL_SHARE_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> TShareDeveloperInfo
|
|
||||||
/// typedef TShareDeveloperInfo.
|
|
||||||
typedef std::map<std::string, std::string> TShareDeveloperInfo;
|
|
||||||
/// \typedef std::map<std::string, std::string> TShareInfo
|
|
||||||
/// typedef TShareInfo.
|
|
||||||
typedef std::map<std::string, std::string> TShareInfo;
|
|
||||||
/** @brief ShareResultCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kShareSuccess = 0,/**< enum value is callback of failing to sharing . */
|
|
||||||
kShareFail,/**< enum value is callback of failing to share . */
|
|
||||||
kShareCancel,/**< enum value is callback of canceling to share . */
|
|
||||||
kShareNetworkError,/**< enum value is callback of network error . */
|
|
||||||
kShareExtension = 10000 /**< enum value is extension code . */
|
|
||||||
} ShareResultCode;
|
|
||||||
/**
|
|
||||||
*@class ShareResultListener
|
|
||||||
*@brief the interface of share callback
|
|
||||||
*/
|
|
||||||
class ShareResultListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of share callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onShareResult(ShareResultCode ret, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
*@class ProtocolShare
|
|
||||||
*@brief the interface of share
|
|
||||||
*/
|
|
||||||
class ProtocolShare : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief share information
|
|
||||||
@param info The info of share, contains key:
|
|
||||||
SharedText The text need to share
|
|
||||||
SharedImagePath The full path of image file need to share (optinal)
|
|
||||||
@warning For different plugin, the parameter should have other keys to share.
|
|
||||||
Look at the manual of plugins. */
|
|
||||||
virtual void share(TShareInfo info) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@breif set the result listener
|
|
||||||
@param pListener The callback object for share result
|
|
||||||
@wraning Must invoke this interface before share
|
|
||||||
*/
|
|
||||||
virtual void setResultListener(ShareResultListener* pListener) = 0;
|
|
||||||
|
|
||||||
virtual ShareResultListener* getShareListener() = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* ----- #ifndef __CCX_PROTOCOL_SHARE_H__ ----- */
|
|
||||||
|
|
@ -1,105 +0,0 @@
|
||||||
/** @file ProtocolSocial.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_SOCIAL_H__
|
|
||||||
#define __CCX_PROTOCOL_SOCIAL_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> TSocialDeveloperInfo
|
|
||||||
/// typedef TSocialDeveloperInfo.
|
|
||||||
typedef std::map<std::string, std::string> TSocialDeveloperInfo;
|
|
||||||
/// \typedef std::map<std::string, std::string> TAchievementInfo
|
|
||||||
/// typedef TAchievementInfo.
|
|
||||||
typedef std::map<std::string, std::string> TAchievementInfo;
|
|
||||||
/** @brief SocialRetCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
// code for leaderboard feature
|
|
||||||
kScoreSubmitSucceed =1,/**< enum value is callback of succeeding in submiting. */
|
|
||||||
kScoreSubmitfail,/**< enum value is callback of failing to submit . */
|
|
||||||
|
|
||||||
// code for achievement feature
|
|
||||||
kAchUnlockSucceed,/**< enum value is callback of succeeding in unlocking. */
|
|
||||||
kAchUnlockFail,/**< enum value is callback of failing to unlock. */
|
|
||||||
|
|
||||||
kSocialSignInSucceed,/**< enum value is callback of succeeding to login. */
|
|
||||||
kSocialSignInFail,/**< enum value is callback of failing to login. */
|
|
||||||
|
|
||||||
kSocialSignOutSucceed,/**< enum value is callback of succeeding to login. */
|
|
||||||
kSocialSignOutFail,/**< enum value is callback of failing to login. */
|
|
||||||
kSocialGetGameFriends,/**< enum value is callback of getGameFriends. */
|
|
||||||
kSocialExtensionCode = 20000 /**< enum value is extension code . */
|
|
||||||
|
|
||||||
} SocialRetCode;
|
|
||||||
/**
|
|
||||||
*@class SocialListener
|
|
||||||
*@brief the interface of social callback
|
|
||||||
*/
|
|
||||||
class SocialListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of social callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onSocialResult(SocialRetCode code, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@class ProtocolSocial
|
|
||||||
*@brief the interface of social
|
|
||||||
*/
|
|
||||||
class ProtocolSocial : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief user signIn
|
|
||||||
*/
|
|
||||||
virtual void signIn() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief user signOut
|
|
||||||
*/
|
|
||||||
virtual void signOut() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief submit the score
|
|
||||||
@param leaderboardID
|
|
||||||
@param the score
|
|
||||||
*/
|
|
||||||
virtual void submitScore(const char* leadboardID, long score) = 0;
|
|
||||||
/**
|
|
||||||
@brief show the id of Leaderboard page
|
|
||||||
@param leaderboardID
|
|
||||||
*/
|
|
||||||
virtual void showLeaderboard(const char* leaderboardID) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief methods of achievement feature
|
|
||||||
@param the info of achievement
|
|
||||||
*/
|
|
||||||
virtual void unlockAchievement(TAchievementInfo achInfo) = 0;
|
|
||||||
/**
|
|
||||||
@brief show the page of achievements
|
|
||||||
*/
|
|
||||||
virtual void showAchievements() = 0;
|
|
||||||
/**
|
|
||||||
@brief set pListener The callback object for social result
|
|
||||||
@param the listener
|
|
||||||
*/
|
|
||||||
virtual void setListener(SocialListener* listener) = 0;
|
|
||||||
/**
|
|
||||||
@brief get pListener The callback object for social result
|
|
||||||
@return the listener
|
|
||||||
*/
|
|
||||||
virtual SocialListener* getListener() = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* ----- #ifndef __CCX_PROTOCOL_SOCIAL_H__ ----- */
|
|
||||||
|
|
@ -1,135 +0,0 @@
|
||||||
/** @file ProtocolUser.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_USER_H__
|
|
||||||
#define __CCX_PROTOCOL_USER_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> TUserDeveloperInfo
|
|
||||||
/// typedef TUserDeveloperInfo.
|
|
||||||
typedef std::map<std::string, std::string> TUserDeveloperInfo;
|
|
||||||
/** @brief Plugin_type enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kInitSuccess = 0,/**< enum value is callback of succeeding in initing sdk. */
|
|
||||||
kInitFail,/**< enum value is callback of failing to init sdk. */
|
|
||||||
kLoginSuccess,/**< enum value is callback of succeeding in login.*/
|
|
||||||
kLoginNetworkError,/**< enum value is callback of network error*/
|
|
||||||
kLoginNoNeed,/**< enum value is callback of no need login.*/
|
|
||||||
kLoginFail,/**< enum value is callback of failing to login. */
|
|
||||||
kLoginCancel,/**< enum value is callback of canceling to login. */
|
|
||||||
kLogoutSuccess,/**< enum value is callback of succeeding in logout. */
|
|
||||||
kLogoutFail,/**< enum value is callback of failing to logout. */
|
|
||||||
kPlatformEnter,/**< enum value is callback after enter platform. */
|
|
||||||
kPlatformBack,/**< enum value is callback after exit antiAddiction. */
|
|
||||||
kPausePage,/**< enum value is callback after exit pause page. */
|
|
||||||
kExitPage,/**< enum value is callback after exit exit page. */
|
|
||||||
kAntiAddictionQuery,/**< enum value is callback after querying antiAddiction. */
|
|
||||||
kRealNameRegister,/**< enum value is callback after registering realname. */
|
|
||||||
kAccountSwitchSuccess,/**< enum value is callback of succeeding in switching account. */
|
|
||||||
kAccountSwitchFail,/**< enum value is callback of failing to switch account. */
|
|
||||||
kOpenShop,/**< enum value is callback of open the shop. */
|
|
||||||
kAccountSwitchCancel,/**< enum value is callback of canceling to switch account. */
|
|
||||||
kGameExitPage,/**< enum value is callback of no channel exit page. */
|
|
||||||
kUserExtension = 50000 /**< enum value is extension code . */
|
|
||||||
|
|
||||||
|
|
||||||
} UserActionResultCode;
|
|
||||||
/** @brief ToolBarPlace enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kToolBarTopLeft = 1,/**< enum the toolbar is at topleft. */
|
|
||||||
kToolBarTopRight,/**< enum the toolbar is at topright. */
|
|
||||||
kToolBarMidLeft,/**< enum the toolbar is at midleft. */
|
|
||||||
kToolBarMidRight,/**< enum the toolbar is at midright. */
|
|
||||||
kToolBarBottomLeft,/**< enum the toolbar is at bottomleft. */
|
|
||||||
kToolBarBottomRight,/**< enum the toolbar is at bottomright. */
|
|
||||||
} ToolBarPlace;
|
|
||||||
|
|
||||||
class ProtocolUser;
|
|
||||||
/**
|
|
||||||
*@class UserActionListener
|
|
||||||
*@brief the interface of user callback
|
|
||||||
*/
|
|
||||||
class UserActionListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of user callback
|
|
||||||
*@param the adatper of plugin
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onActionResult(ProtocolUser* pPlugin, UserActionResultCode code, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* @class ProtocolUser
|
|
||||||
*/
|
|
||||||
class ProtocolUser : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief User login
|
|
||||||
*/
|
|
||||||
virtual void login() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief User login
|
|
||||||
if the process of logining need to know the param of server_id ,
|
|
||||||
you can use the function
|
|
||||||
and if you must change oauthloginserver, you can add the param of oauthLoginServer
|
|
||||||
@param server_id
|
|
||||||
@param oauthLoginServer
|
|
||||||
*/
|
|
||||||
|
|
||||||
CC_DEPRECATED_ATTRIBUTE virtual void login(std::string server_id, std::string oauthLoginServer = "") = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief User login
|
|
||||||
if the process of logining need to know the parameters ,
|
|
||||||
you can use the function
|
|
||||||
@param the parameters
|
|
||||||
*/
|
|
||||||
virtual void login(std::map<std::string, std::string> info) = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Check whether the user logined or not
|
|
||||||
@return If user logined, return value is true;
|
|
||||||
else return value is false.
|
|
||||||
*/
|
|
||||||
virtual bool isLogined() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get USER ID
|
|
||||||
@return If user logined, return value is userID;
|
|
||||||
else return value is empty string.
|
|
||||||
*/
|
|
||||||
virtual std::string getUserID() = 0 ;
|
|
||||||
/**
|
|
||||||
@brief set the result listener
|
|
||||||
@param pListener The callback object for user result
|
|
||||||
*/
|
|
||||||
virtual void setActionListener(UserActionListener* listener) = 0 ;
|
|
||||||
/**
|
|
||||||
@brief get pListener The callback object for user result
|
|
||||||
@return the listener
|
|
||||||
*/
|
|
||||||
virtual UserActionListener* getActionListener() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief get plugin id
|
|
||||||
@return the plugin id
|
|
||||||
*/
|
|
||||||
virtual std::string getPluginId() = 0 ;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_USER_H__ */
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
#ifndef __STATISTICS_H__
|
|
||||||
#define __STATISTICS_H__
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class Statistics
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static void initInfo();
|
|
||||||
static void createPlugin(std::string pluginName, int pluginType);
|
|
||||||
static void callFunction(std::string pluginName, std::string functionName);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif //__STATISTICS_H__
|
|
||||||
Binary file not shown.
|
|
@ -1,245 +0,0 @@
|
||||||
/** @file AgentManager.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __CCX_AGENTMANAGER_H__
|
|
||||||
#define __CCX_AGENTMANAGER_H__
|
|
||||||
|
|
||||||
#include "PluginManager.h"
|
|
||||||
#include "ProtocolIAP.h"
|
|
||||||
#include "ProtocolAnalytics.h"
|
|
||||||
#include "ProtocolShare.h"
|
|
||||||
#include "ProtocolAds.h"
|
|
||||||
#include "ProtocolSocial.h"
|
|
||||||
#include "ProtocolUser.h"
|
|
||||||
#include "ProtocolPush.h"
|
|
||||||
#include "ProtocolCrash.h"
|
|
||||||
#include "ProtocolREC.h"
|
|
||||||
#include "ProtocolCustom.h"
|
|
||||||
#include "ProtocolAdTracking.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/** @brief Plugin_type enum, with inline docs */
|
|
||||||
typedef enum {
|
|
||||||
kPluginAds = 16,/**< enum value is the type of Ads. */
|
|
||||||
kPluginAnalytics = 1,/**< enum value is the type of Analytics. */
|
|
||||||
kPluginIAP = 8,/**< enum value is the type of IAP. */
|
|
||||||
kPluginShare = 2,/**< enum value is the type of Share. */
|
|
||||||
kPluginUser = 32,/**< enum value is the type of User. */
|
|
||||||
kPluginSocial = 4,/**< enum value is the type of Social. */
|
|
||||||
kPluginPush = 64,/**< enum value is the type of Push. */
|
|
||||||
kPluginCrash = 128,/**< enum value is the type of Crash. */
|
|
||||||
kPluginCustom = 256,/**< enum value is the type of Custom. */
|
|
||||||
kPluginREC = 512,/**< enum value is the type of REC. */
|
|
||||||
kPluginAdTracking = 1024,/**< enum value is the type of AdTracking. */
|
|
||||||
}Plugin_type;
|
|
||||||
/**
|
|
||||||
* @class AgentManager
|
|
||||||
*/
|
|
||||||
class AgentManager
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~AgentManager();
|
|
||||||
/**
|
|
||||||
@brief Get singleton of AgentManager
|
|
||||||
*/
|
|
||||||
|
|
||||||
static AgentManager* getInstance();
|
|
||||||
/**
|
|
||||||
@brief Destory the instance of AgentManager
|
|
||||||
*/
|
|
||||||
static void end();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@breif the init of AgentManager
|
|
||||||
@param the appKey of anysdk
|
|
||||||
@param the appSecret of anysdk
|
|
||||||
@param the privateKey of anysdk
|
|
||||||
@param the url of oauthLoginServer
|
|
||||||
@warning Must invoke this interface before loadAllPlugins
|
|
||||||
*/
|
|
||||||
void init(std::string appKey,std::string appSecret,std::string privateKey,std::string oauthLoginServer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief load the plugins
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE void loadALLPlugin();
|
|
||||||
/**
|
|
||||||
@brief unload the plugins
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE void unloadALLPlugin();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief load the plugins
|
|
||||||
*/
|
|
||||||
void loadAllPlugins();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief unload the plugins
|
|
||||||
*/
|
|
||||||
void unloadAllPlugins();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Analytics plugin
|
|
||||||
@return if Analytics plugin exist ,return value is Analytics plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolAnalytics* getAnalyticsPlugin(){return _pAnalytics;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get User plugin
|
|
||||||
@return if User plugin exist ,return value is User plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolUser* getUserPlugin(){return _pUser;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get IAP plugin
|
|
||||||
@return if IAP plugin exist ,return value is IAP plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
std::map<std::string , ProtocolIAP*>* getIAPPlugin(){return &_pluginsIAPMap;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Share plugin
|
|
||||||
@return if Share plugin exist ,return value is Share plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolShare* getSharePlugin(){return _pShare;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Social plugin
|
|
||||||
@return if Social plugin exist ,return value is Social plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolSocial* getSocialPlugin(){return _pSocial;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Ads plugin
|
|
||||||
@return if Ads plugin exist ,return value is Ads plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolAds* getAdsPlugin(){return _pAds;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Push plugin
|
|
||||||
@return if Push plugin exist ,return value is Push plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolPush* getPushPlugin(){return _pPush;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Crash plugin
|
|
||||||
@return if Crash plugin exist ,return value is Crash plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolCrash* getCrashPlugin(){return _pCrash;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Custom plugin
|
|
||||||
@return if Crash plugin exist ,return value is Custom plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolCustom* getCustomPlugin(){return _pCustom;};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get REC plugin
|
|
||||||
@return if REC plugin exist ,return value is REC plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolREC* getRECPlugin(){return _pREC;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get AdTracking plugin
|
|
||||||
@return if AdTracking plugin exist ,return value is AdTracking plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolAdTracking* getAdTrackingPlugin(){return _pAdTracking;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get channel ID
|
|
||||||
@return return value is channel ID.
|
|
||||||
*/
|
|
||||||
std::string getChannelId();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get custom param
|
|
||||||
@return return value is custom param for channel.
|
|
||||||
*/
|
|
||||||
std::string getCustomParam();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get framework version
|
|
||||||
@return return value is the version of AnySDKFramework.
|
|
||||||
*/
|
|
||||||
std::string getFrameworkVersion();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@Title: setIsAnaylticsEnabled
|
|
||||||
@Description: choose to open or close
|
|
||||||
@param @param enabled true or false
|
|
||||||
@return void
|
|
||||||
*/
|
|
||||||
void setIsAnaylticsEnabled(bool value){bIsAnaylticsEnabled = value;};
|
|
||||||
/**
|
|
||||||
@Title: isAnaylticsEnabled
|
|
||||||
@Description: the status of Anayltics
|
|
||||||
@param @return true or false
|
|
||||||
@return boolean
|
|
||||||
*/
|
|
||||||
bool isAnaylticsEnabled(){return bIsAnaylticsEnabled;};
|
|
||||||
|
|
||||||
|
|
||||||
void loadPlugin(const char* nodeName,int type);
|
|
||||||
protected:
|
|
||||||
void setDebugMode(bool flag);
|
|
||||||
std::string getSupportPlugin();
|
|
||||||
void release();
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
AgentManager(void);
|
|
||||||
|
|
||||||
// Analytics plugin
|
|
||||||
ProtocolAnalytics* _pAnalytics;
|
|
||||||
|
|
||||||
// user plugin
|
|
||||||
ProtocolUser* _pUser;
|
|
||||||
|
|
||||||
// IAP plugins
|
|
||||||
// ProtocolIAP* _pIAP;
|
|
||||||
std::map<std::string , ProtocolIAP*> _pluginsIAPMap;
|
|
||||||
|
|
||||||
// Share plugin
|
|
||||||
ProtocolShare* _pShare;
|
|
||||||
|
|
||||||
// Social plugin
|
|
||||||
ProtocolSocial* _pSocial;
|
|
||||||
|
|
||||||
// Ads plugin
|
|
||||||
ProtocolAds* _pAds;
|
|
||||||
|
|
||||||
// Push plugin
|
|
||||||
ProtocolPush* _pPush;
|
|
||||||
|
|
||||||
// Crash plugin
|
|
||||||
ProtocolCrash* _pCrash;
|
|
||||||
|
|
||||||
// Custom plugin
|
|
||||||
ProtocolCustom* _pCustom;
|
|
||||||
|
|
||||||
// REC plugin
|
|
||||||
ProtocolREC* _pREC;
|
|
||||||
|
|
||||||
// AdTracking plugin
|
|
||||||
ProtocolAdTracking* _pAdTracking;
|
|
||||||
|
|
||||||
bool bIsAnaylticsEnabled;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_AGENTMANAGER_H__ */
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
/** @file JSBRelation.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_JSBRELATION_H__
|
|
||||||
#define __CCX_JSBRELATION_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @class JSBRelation
|
|
||||||
*/
|
|
||||||
class JSBRelation
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static string getMethodsOfPlugin(PluginProtocol* plugin);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_JSBRELATION_H__ */
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
/** @file PluginFactory.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PLUGIN_FACTORY_H__
|
|
||||||
#define __CCX_PLUGIN_FACTORY_H__
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class PluginProtocol;
|
|
||||||
class PluginManager;
|
|
||||||
/**
|
|
||||||
* @class PluginFactory
|
|
||||||
*/
|
|
||||||
class PluginFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~PluginFactory();
|
|
||||||
/**
|
|
||||||
@brief Get singleton of PluginFactory
|
|
||||||
*/
|
|
||||||
static PluginFactory* getInstance();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Destory the instance of PluginFactory
|
|
||||||
*/
|
|
||||||
static void purgeFactory();
|
|
||||||
|
|
||||||
private:
|
|
||||||
friend class PluginManager;
|
|
||||||
PluginFactory(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief create the plugin by name and type
|
|
||||||
@param the name of plugin
|
|
||||||
@param the type of plugin
|
|
||||||
*/
|
|
||||||
PluginProtocol* createPlugin(const char* name, int pluginType);
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PLUGIN_FACTORY_H__ */
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
#ifndef __PLUGIN_JAVA_DATA_H__
|
|
||||||
#define __PLUGIN_JAVA_DATA_H__
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
#include <jni.h>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
typedef struct _PluginJavaData_
|
|
||||||
{
|
|
||||||
jobject jobj;
|
|
||||||
std::string jclassName;
|
|
||||||
} PluginJavaData;
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif // __PLUGIN_JAVA_DATA_H__
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
#ifndef __PLUGIN_JNI_HELPER_H__
|
|
||||||
#define __PLUGIN_JNI_HELPER_H__
|
|
||||||
|
|
||||||
#include <jni.h>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk {namespace framework{
|
|
||||||
|
|
||||||
typedef struct PluginJniMethodInfo_
|
|
||||||
{
|
|
||||||
JNIEnv * env;
|
|
||||||
jclass classID;
|
|
||||||
jmethodID methodID;
|
|
||||||
} PluginJniMethodInfo;
|
|
||||||
|
|
||||||
class PluginJniHelper
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static JavaVM* getJavaVM();
|
|
||||||
static void setJavaVM(JavaVM *javaVM);
|
|
||||||
static JNIEnv* getEnv();
|
|
||||||
|
|
||||||
static bool getStaticMethodInfo(PluginJniMethodInfo &methodinfo, const char *className, const char *methodName, const char *paramCode);
|
|
||||||
static bool getMethodInfo(PluginJniMethodInfo &methodinfo, const char *className, const char *methodName, const char *paramCode);
|
|
||||||
static std::string jstring2string(jstring jstr);
|
|
||||||
static jstring newStringUTF(JNIEnv* env, const std::string& utf8Str);
|
|
||||||
|
|
||||||
static bool setClassLoaderFrom(jobject nativeActivityInstance);
|
|
||||||
|
|
||||||
static jmethodID loadclassMethod_methodID;
|
|
||||||
static jobject classloader;
|
|
||||||
|
|
||||||
private:
|
|
||||||
static JavaVM *_psJavaVM;
|
|
||||||
static bool getMethodInfo_DefaultClassLoader(PluginJniMethodInfo &methodinfo,
|
|
||||||
const char *className,
|
|
||||||
const char *methodName,
|
|
||||||
const char *paramCode);
|
|
||||||
};
|
|
||||||
|
|
||||||
}}
|
|
||||||
|
|
||||||
#endif // __PLUGIN_JNI_HELPER_H__
|
|
||||||
|
|
@ -1,156 +0,0 @@
|
||||||
#ifndef __PLUGIN_JNI_MACROS_H__
|
|
||||||
#define __PLUGIN_JNI_MACROS_H__
|
|
||||||
|
|
||||||
#define return_if_fails(cond) if (!(cond)) return;
|
|
||||||
#define return_val_if_fails(cond, ret) if(!(cond)) return (ret);
|
|
||||||
|
|
||||||
#define CALL_BASERET_JAVA_FUNC_WITH_PARAM(retType, paramCode, param, retCode, defaultRet) \
|
|
||||||
retType ret = defaultRet; \
|
|
||||||
return_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret); \
|
|
||||||
return_val_if_fails(paramCode != NULL && strlen(paramCode) > 0, ret); \
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz); \
|
|
||||||
return_val_if_fails(pData != NULL, ret); \
|
|
||||||
\
|
|
||||||
PluginJniMethodInfo t; \
|
|
||||||
if (PluginJniHelper::getMethodInfo(t \
|
|
||||||
, pData->jclassName.c_str() \
|
|
||||||
, funcName \
|
|
||||||
, paramCode)) \
|
|
||||||
{ \
|
|
||||||
ret = t.env->Call##retCode##Method(pData->jobj, t.methodID, param); \
|
|
||||||
t.env->DeleteLocalRef(t.classID); \
|
|
||||||
} \
|
|
||||||
return ret; \
|
|
||||||
|
|
||||||
|
|
||||||
#define CALL_BASERET_JAVA_FUNC(retType, paramCode, retCode, defaultRet) \
|
|
||||||
retType ret = defaultRet; \
|
|
||||||
return_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret); \
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz); \
|
|
||||||
return_val_if_fails(pData != NULL, ret); \
|
|
||||||
\
|
|
||||||
PluginJniMethodInfo t; \
|
|
||||||
if (PluginJniHelper::getMethodInfo(t \
|
|
||||||
, pData->jclassName.c_str() \
|
|
||||||
, funcName \
|
|
||||||
, paramCode)) \
|
|
||||||
{ \
|
|
||||||
ret = t.env->Call##retCode##Method(pData->jobj, t.methodID); \
|
|
||||||
t.env->DeleteLocalRef(t.classID); \
|
|
||||||
} \
|
|
||||||
return ret; \
|
|
||||||
|
|
||||||
|
|
||||||
#define CALL_JAVA_FUNC_WITH_VALIST(retCode) \
|
|
||||||
std::vector<PluginParam*> allParams; \
|
|
||||||
if (NULL != param) \
|
|
||||||
{ \
|
|
||||||
allParams.push_back(param); \
|
|
||||||
\
|
|
||||||
va_list argp; \
|
|
||||||
PluginParam* pArg = NULL; \
|
|
||||||
va_start( argp, param ); \
|
|
||||||
while (1) \
|
|
||||||
{ \
|
|
||||||
pArg = va_arg(argp, PluginParam*); \
|
|
||||||
if (pArg == NULL) \
|
|
||||||
break; \
|
|
||||||
\
|
|
||||||
allParams.push_back(pArg); \
|
|
||||||
} \
|
|
||||||
va_end(argp); \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
return call##retCode##FuncWithParam(funcName, allParams); \
|
|
||||||
|
|
||||||
|
|
||||||
#define CALL_JAVA_FUNC(retType, retCode, defaultRet, jRetCode) \
|
|
||||||
retType ret = defaultRet; \
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(this); \
|
|
||||||
if (NULL == pData) { \
|
|
||||||
PluginUtils::outputLog(ANDROID_LOG_ERROR, "PluginProtocol", "Can't find java data for plugin : %s", this->getPluginName()); \
|
|
||||||
return ret; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
std::string paramCode; \
|
|
||||||
int nParamNum = params.size(); \
|
|
||||||
if (0 == nParamNum) \
|
|
||||||
{ \
|
|
||||||
paramCode = "()"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName(this, funcName); \
|
|
||||||
} else \
|
|
||||||
{ \
|
|
||||||
PluginParam* pRetParam = NULL; \
|
|
||||||
bool needDel = false; \
|
|
||||||
if (nParamNum == 1) { \
|
|
||||||
pRetParam = params[0]; \
|
|
||||||
} else { \
|
|
||||||
std::map<std::string, PluginParam*> allParams; \
|
|
||||||
for (int i = 0; i < nParamNum; i++) \
|
|
||||||
{ \
|
|
||||||
PluginParam* pArg = params[i]; \
|
|
||||||
if (pArg == NULL) \
|
|
||||||
{ \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
char strKey[8] = { 0 }; \
|
|
||||||
sprintf(strKey, "Param%d", i + 1); \
|
|
||||||
allParams[strKey] = pArg; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
pRetParam = new PluginParam(allParams); \
|
|
||||||
needDel = true; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
switch(pRetParam->getCurrentType()) \
|
|
||||||
{ \
|
|
||||||
case PluginParam::kParamTypeInt: \
|
|
||||||
paramCode = "(I)"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), pRetParam->getIntValue()); \
|
|
||||||
break; \
|
|
||||||
case PluginParam::kParamTypeFloat: \
|
|
||||||
paramCode = "(F)"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), pRetParam->getFloatValue()); \
|
|
||||||
break; \
|
|
||||||
case PluginParam::kParamTypeBool: \
|
|
||||||
paramCode = "(Z)"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), pRetParam->getBoolValue()); \
|
|
||||||
break; \
|
|
||||||
case PluginParam::kParamTypeString: \
|
|
||||||
{ \
|
|
||||||
jstring jstr = PluginJniHelper::newStringUTF(PluginUtils::getEnv(), pRetParam->getStringValue()); \
|
|
||||||
paramCode = "(Ljava/lang/String;)"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), jstr); \
|
|
||||||
PluginUtils::getEnv()->DeleteLocalRef(jstr); \
|
|
||||||
} \
|
|
||||||
break; \
|
|
||||||
case PluginParam::kParamTypeStringMap: \
|
|
||||||
case PluginParam::kParamTypeMap: \
|
|
||||||
{ \
|
|
||||||
jobject jMap = PluginUtils::getJObjFromParam(pRetParam); \
|
|
||||||
paramCode = "(Lorg/json/JSONObject;)"; \
|
|
||||||
paramCode.append(jRetCode); \
|
|
||||||
ret = PluginUtils::callJava##retCode##FuncWithName_oneParam(this, funcName, paramCode.c_str(), jMap); \
|
|
||||||
PluginUtils::getEnv()->DeleteLocalRef(jMap); \
|
|
||||||
} \
|
|
||||||
break; \
|
|
||||||
default: \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
\
|
|
||||||
if (needDel && pRetParam != NULL) \
|
|
||||||
{ \
|
|
||||||
delete pRetParam; \
|
|
||||||
pRetParam = NULL; \
|
|
||||||
} \
|
|
||||||
} \
|
|
||||||
return ret; \
|
|
||||||
|
|
||||||
|
|
||||||
#endif // __PLUGIN_JNI_MACROS_H__
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
/** @file PluginFactory.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PLUGINMANAGER_H__
|
|
||||||
#define __CCX_PLUGINMANAGER_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include "PluginFactory.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @class PluginManager
|
|
||||||
*/
|
|
||||||
class PluginManager
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~PluginManager();
|
|
||||||
/**
|
|
||||||
@brief Get singleton of PluginManager
|
|
||||||
*/
|
|
||||||
static PluginManager* getInstance();
|
|
||||||
/**
|
|
||||||
@brief Destory the instance of PluginManager
|
|
||||||
*/
|
|
||||||
static void end();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief load the plugin by name and type
|
|
||||||
@param the name of plugin
|
|
||||||
@param the type of plugin
|
|
||||||
*/
|
|
||||||
PluginProtocol* loadPlugin(const char* name, int pluginType);
|
|
||||||
/**
|
|
||||||
@brief unload the plugin by name and type
|
|
||||||
@param the name of plugin
|
|
||||||
@param the type of plugin
|
|
||||||
*/
|
|
||||||
void unloadPlugin(const char* name, int pluginType = 0);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
PluginManager(void);
|
|
||||||
std::map<std::string, PluginProtocol*> _pluginsMap;
|
|
||||||
// bool _isDebug;
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PLUGINMANAGER_H__ */
|
|
||||||
|
|
@ -1,126 +0,0 @@
|
||||||
/** @file PluginParam.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PLUGIN_PARAM_H__
|
|
||||||
#define __CCX_PLUGIN_PARAM_H__
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
/// \typedef std::map<std::string, std::string> StringMap
|
|
||||||
/// typedef YString.
|
|
||||||
typedef std::map<std::string, std::string> StringMap;
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class PluginProtocol;
|
|
||||||
/**
|
|
||||||
* @class PluginParam
|
|
||||||
*/
|
|
||||||
class PluginParam
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
@brief the default constructor of PluginParam
|
|
||||||
*/
|
|
||||||
PluginParam();
|
|
||||||
|
|
||||||
virtual ~PluginParam();
|
|
||||||
/**
|
|
||||||
@brief the constructor of PluginParam
|
|
||||||
@param the value is Integer
|
|
||||||
*/
|
|
||||||
PluginParam(int nValue);
|
|
||||||
/**
|
|
||||||
@brief the constructor of PluginParam
|
|
||||||
@param the value is float
|
|
||||||
*/
|
|
||||||
PluginParam(float fValue);
|
|
||||||
/**
|
|
||||||
@brief the constructor of PluginParam
|
|
||||||
@param the value is boolean
|
|
||||||
*/
|
|
||||||
PluginParam(bool bValue);
|
|
||||||
/**
|
|
||||||
@brief the default constructor of PluginParam
|
|
||||||
@param the value is char
|
|
||||||
*/
|
|
||||||
PluginParam(const char* strValue);
|
|
||||||
/**
|
|
||||||
@brief the default constructor of PluginParam
|
|
||||||
@param the value is StringMap
|
|
||||||
*/
|
|
||||||
PluginParam(StringMap strMapValue);
|
|
||||||
|
|
||||||
typedef enum{
|
|
||||||
kParamTypeNull = 0,
|
|
||||||
kParamTypeInt,
|
|
||||||
kParamTypeFloat,
|
|
||||||
kParamTypeBool,
|
|
||||||
kParamTypeString,
|
|
||||||
kParamTypeStringMap,
|
|
||||||
kParamTypeMap,
|
|
||||||
} ParamType;
|
|
||||||
/**
|
|
||||||
@brief get the ParamType of value
|
|
||||||
*/
|
|
||||||
inline ParamType getCurrentType() {
|
|
||||||
return _type;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the int value
|
|
||||||
*/
|
|
||||||
inline int getIntValue() {
|
|
||||||
return _intValue;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the float value
|
|
||||||
*/
|
|
||||||
inline float getFloatValue() {
|
|
||||||
return _floatValue;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the boolean value
|
|
||||||
*/
|
|
||||||
inline bool getBoolValue() {
|
|
||||||
return _boolValue;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the char value
|
|
||||||
*/
|
|
||||||
inline const char* getStringValue() {
|
|
||||||
return _strValue.c_str();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the map of value
|
|
||||||
*/
|
|
||||||
inline std::map<std::string, PluginParam*> getMapValue() {
|
|
||||||
return _mapValue;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the StringMap value
|
|
||||||
*/
|
|
||||||
inline StringMap getStrMapValue() {
|
|
||||||
return _strMapValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
friend class PluginProtocol;
|
|
||||||
/**
|
|
||||||
@brief the constructor of PluginParam
|
|
||||||
@param the map of value
|
|
||||||
*/
|
|
||||||
PluginParam(std::map<std::string, PluginParam*> mapValue);
|
|
||||||
|
|
||||||
private:
|
|
||||||
ParamType _type;
|
|
||||||
|
|
||||||
int _intValue;
|
|
||||||
float _floatValue;
|
|
||||||
bool _boolValue;
|
|
||||||
std::string _strValue;
|
|
||||||
std::map<std::string, PluginParam*> _mapValue;
|
|
||||||
StringMap _strMapValue;
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PLUGIN_PARAM_H__ */
|
|
||||||
|
|
@ -1,144 +0,0 @@
|
||||||
/** @file PluginProtocol.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_IPLUGIN_H__
|
|
||||||
#define __CCX_IPLUGIN_H__
|
|
||||||
|
|
||||||
#include "PluginParam.h"
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
|
|
||||||
#define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
|
|
||||||
#elif _MSC_VER >= 1400 //vs 2005 or higher
|
|
||||||
#define CC_DEPRECATED_ATTRIBUTE __declspec(deprecated)
|
|
||||||
#else
|
|
||||||
#define CC_DEPRECATED_ATTRIBUTE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @class PluginProtocol
|
|
||||||
* @brief The super class for all plugins.
|
|
||||||
*/
|
|
||||||
class PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~PluginProtocol() {};
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief set plugin name
|
|
||||||
*@param the name of plugin
|
|
||||||
*/
|
|
||||||
virtual void setPluginName(const char* name) = 0 ;
|
|
||||||
/**
|
|
||||||
*@brief get plugin name
|
|
||||||
*@return the name of plugin
|
|
||||||
*/
|
|
||||||
virtual const char* getPluginName() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief get the version of plugin
|
|
||||||
*@return the version of plugin
|
|
||||||
*/
|
|
||||||
virtual std::string getPluginVersion();
|
|
||||||
/**
|
|
||||||
*@brief get the version of sdk
|
|
||||||
*@return the version of sdk
|
|
||||||
*/
|
|
||||||
virtual std::string getSDKVersion();
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief switch debug plug-in on/off
|
|
||||||
*@param the value of on/off
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE virtual void setDebugMode(bool bDebug);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void callFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void callFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return string
|
|
||||||
*/
|
|
||||||
virtual std::string callStringFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return string
|
|
||||||
*/
|
|
||||||
virtual std::string callStringFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return int
|
|
||||||
*/
|
|
||||||
virtual int callIntFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return int
|
|
||||||
*/
|
|
||||||
virtual int callIntFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return bool
|
|
||||||
*/
|
|
||||||
virtual bool callBoolFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return bool
|
|
||||||
*/
|
|
||||||
virtual bool callBoolFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return float
|
|
||||||
*/
|
|
||||||
virtual float callFloatFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return float
|
|
||||||
*/
|
|
||||||
virtual float callFloatFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Check function the plugin support or not
|
|
||||||
@param the name of plugin
|
|
||||||
@return if the function support ,return true
|
|
||||||
else retur false
|
|
||||||
*/
|
|
||||||
virtual bool isFunctionSupported(std::string functionName);
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_IPLUGIN_H__ */
|
|
||||||
|
|
@ -1,157 +0,0 @@
|
||||||
#ifndef __PLUGIN_UTILS_H__
|
|
||||||
#define __PLUGIN_UTILS_H__
|
|
||||||
|
|
||||||
#include "PluginJniHelper.h"
|
|
||||||
#include "PluginJavaData.h"
|
|
||||||
#include <map>
|
|
||||||
#include <list>
|
|
||||||
#include "PluginParam.h"
|
|
||||||
#include "PluginJniMacros.h"
|
|
||||||
#include <android/log.h>
|
|
||||||
//#include <android_native_app_glue.h>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class PluginProtocol;
|
|
||||||
class PluginUtils
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
//cjh static void initPluginWrapper(android_app* app);
|
|
||||||
static jobject createJavaMapObject(std::map<std::string, std::string>* paramMap);
|
|
||||||
static jobject createJavaListObject(std::list<std::string>* paramList);
|
|
||||||
static void initJavaPlugin(PluginProtocol* pPlugin, jobject jObj, const char* className, int type);
|
|
||||||
static JNIEnv* getEnv();
|
|
||||||
|
|
||||||
static PluginJavaData* getPluginJavaData(PluginProtocol* pKeyObj);
|
|
||||||
static void setPluginJavaData(PluginProtocol* pKeyObj, PluginJavaData* pData, int type);
|
|
||||||
static void erasePluginJavaData(PluginProtocol* pKeyObj,int type);
|
|
||||||
static void erasePluginJavaData(std::string key);
|
|
||||||
|
|
||||||
static PluginProtocol* getPluginPtr(std::string className);
|
|
||||||
|
|
||||||
static jobject getJObjFromParam(PluginParam* param);
|
|
||||||
|
|
||||||
// methods have no return value
|
|
||||||
template <typename T>
|
|
||||||
static void callJavaFunctionWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)
|
|
||||||
{
|
|
||||||
return_if_fails(funcName != NULL && strlen(funcName) > 0);
|
|
||||||
return_if_fails(paramCode != NULL && strlen(paramCode) > 0);
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);
|
|
||||||
return_if_fails(pData != NULL);
|
|
||||||
|
|
||||||
PluginJniMethodInfo t;
|
|
||||||
if (PluginJniHelper::getMethodInfo(t
|
|
||||||
, pData->jclassName.c_str()
|
|
||||||
, funcName
|
|
||||||
, paramCode))
|
|
||||||
{
|
|
||||||
t.env->CallVoidMethod(pData->jobj, t.methodID, param);
|
|
||||||
t.env->DeleteLocalRef(t.classID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
static void callJavaFunctionWithName(PluginProtocol* thiz, const char* funcName)
|
|
||||||
{
|
|
||||||
return_if_fails(funcName != NULL && strlen(funcName) > 0);
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);
|
|
||||||
return_if_fails(pData != NULL);
|
|
||||||
|
|
||||||
PluginJniMethodInfo t;
|
|
||||||
if (PluginJniHelper::getMethodInfo(t
|
|
||||||
, pData->jclassName.c_str()
|
|
||||||
, funcName
|
|
||||||
, "()V"))
|
|
||||||
{
|
|
||||||
t.env->CallVoidMethod(pData->jobj, t.methodID);
|
|
||||||
t.env->DeleteLocalRef(t.classID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// methods return value is string
|
|
||||||
template <typename T>
|
|
||||||
static std::string callJavaStringFuncWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)
|
|
||||||
{
|
|
||||||
std::string ret = "";
|
|
||||||
return_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret);
|
|
||||||
return_val_if_fails(paramCode != NULL && strlen(paramCode) > 0, ret);
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);
|
|
||||||
return_val_if_fails(pData != NULL, ret);
|
|
||||||
|
|
||||||
PluginJniMethodInfo t;
|
|
||||||
if (PluginJniHelper::getMethodInfo(t
|
|
||||||
, pData->jclassName.c_str()
|
|
||||||
, funcName
|
|
||||||
, paramCode))
|
|
||||||
{
|
|
||||||
jstring strRet = (jstring)t.env->CallObjectMethod(pData->jobj, t.methodID, param);
|
|
||||||
ret = PluginJniHelper::jstring2string(strRet);
|
|
||||||
t.env->DeleteLocalRef(t.classID);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
static std::string callJavaStringFuncWithName(PluginProtocol* thiz, const char* funcName)
|
|
||||||
{
|
|
||||||
std::string ret = "";
|
|
||||||
return_val_if_fails(funcName != NULL && strlen(funcName) > 0, ret);
|
|
||||||
PluginJavaData* pData = PluginUtils::getPluginJavaData(thiz);
|
|
||||||
return_val_if_fails(pData != NULL, ret);
|
|
||||||
|
|
||||||
PluginJniMethodInfo t;
|
|
||||||
if (PluginJniHelper::getMethodInfo(t
|
|
||||||
, pData->jclassName.c_str()
|
|
||||||
, funcName
|
|
||||||
, "()Ljava/lang/String;"))
|
|
||||||
{
|
|
||||||
jstring strRet = (jstring) t.env->CallObjectMethod(pData->jobj, t.methodID);
|
|
||||||
ret = PluginJniHelper::jstring2string(strRet);
|
|
||||||
t.env->DeleteLocalRef(t.classID);
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
// methods return value is int
|
|
||||||
template <typename T>
|
|
||||||
static int callJavaIntFuncWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC_WITH_PARAM(int, paramCode, param, Int, 0)
|
|
||||||
}
|
|
||||||
static int callJavaIntFuncWithName(PluginProtocol* thiz, const char* funcName)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC(int, "()I", Int, 0)
|
|
||||||
}
|
|
||||||
|
|
||||||
// methods return value is float
|
|
||||||
template <typename T>
|
|
||||||
static float callJavaFloatFuncWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC_WITH_PARAM(float, paramCode, param, Float, 0.0f)
|
|
||||||
}
|
|
||||||
static float callJavaFloatFuncWithName(PluginProtocol* thiz, const char* funcName)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC(float, "()F", Float, 0.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
// methods return value is bool
|
|
||||||
template <typename T>
|
|
||||||
static bool callJavaBoolFuncWithName_oneParam(PluginProtocol* thiz, const char* funcName, const char* paramCode, T param)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC_WITH_PARAM(bool, paramCode, param, Boolean, false)
|
|
||||||
}
|
|
||||||
static bool callJavaBoolFuncWithName(PluginProtocol* thiz, const char* funcName)
|
|
||||||
{
|
|
||||||
CALL_BASERET_JAVA_FUNC(bool, "()Z", Boolean, false)
|
|
||||||
}
|
|
||||||
|
|
||||||
static void callJavaFunctionWithName_string_map(PluginProtocol* thiz, const char* funcName, const char* keyParam, std::map<std::string, std::string>* paramMap);
|
|
||||||
|
|
||||||
static void outputLog(int type, const char* logTag, const char* pFormat, ...);
|
|
||||||
static void output(int type, const char* logTag, const char* contents);
|
|
||||||
|
|
||||||
static void resetLogLevel();
|
|
||||||
private:
|
|
||||||
static std::string _logLevel;
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif //__PLUGIN_UTILS_H__
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
/** @file ProtocolAdTracking.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_ADTRACKING_H__
|
|
||||||
#define __CCX_PROTOCOL_ADTRACKING_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/**
|
|
||||||
*@class ProtocolAdTracking
|
|
||||||
*@brief the interface of AdTracking
|
|
||||||
*/
|
|
||||||
class ProtocolAdTracking : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: onRegister
|
|
||||||
* @Description: Call this method if you want to track register events as happening during a section.
|
|
||||||
* @param userId user identifier
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
virtual void onRegister(const char* userId) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: onLogin
|
|
||||||
* @Description:Call this method if you want to track login events as happening during a section.
|
|
||||||
* @param userInfo The details of this parameters are already covered by document.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
virtual void onLogin(std::map<std::string, std::string> userInfo) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: onPay
|
|
||||||
* @Description: Call this method if you want to track pay events as happening during a section.
|
|
||||||
* @param productInfo The details of this parameters are already covered by document.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
virtual void onPay(std::map<std::string, std::string> productInfo) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: trackEvent
|
|
||||||
* @Description: Call this method if you want to track custom events with parameters as happening during a section.
|
|
||||||
* @param eventId The custom event name.
|
|
||||||
* @param paramMap The details of this parameters are already covered by document.
|
|
||||||
*/
|
|
||||||
virtual void trackEvent(const char* eventId, std::map<std::string, std::string>* paramMap = NULL) = 0;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* ----- #ifndef __CCX_PROTOCOL_ADTRACKING_H__ ----- */
|
|
||||||
|
|
@ -1,133 +0,0 @@
|
||||||
/** @file ProtocolAds.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_ADS_H__
|
|
||||||
#define __CCX_PROTOCOL_ADS_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> TAdsDeveloperInfo
|
|
||||||
/// typedef TAdsDeveloperInfo.
|
|
||||||
typedef std::map<std::string, std::string> TAdsDeveloperInfo;
|
|
||||||
/// \typedef std::map<std::string, std::string> TAdsInfo
|
|
||||||
/// typedef TAdsInfo.
|
|
||||||
typedef std::map<std::string, std::string> TAdsInfo;
|
|
||||||
/** @brief AdsResultCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kAdsReceived = 0, /**< enum the callback: the ad is received is at center. */
|
|
||||||
|
|
||||||
kAdsShown, /**< enum the callback: the advertisement dismissed. */
|
|
||||||
kAdsDismissed, /**< enum the callback: the advertisement dismissed. */
|
|
||||||
|
|
||||||
kPointsSpendSucceed, /**< enum the callback: the points spend succeed. */
|
|
||||||
kPointsSpendFailed, /**< enum the callback: the points spend failed. */
|
|
||||||
|
|
||||||
kNetworkError, /**< enum the callback of Network error at center. */
|
|
||||||
kUnknownError, /**< enum the callback of Unknown error. */
|
|
||||||
kOfferWallOnPointsChanged, /**< enum the callback of Changing the point of offerwall. */
|
|
||||||
kRewardedVideoWithReward,/**< enum the callback of receiving the reward of rewardedvideo. */
|
|
||||||
kInAppPurchaseFinished,/**< enum the callback of finishing IAP ad. */
|
|
||||||
kAdsClicked,/**< enum the callback of the advertisement clicked. */
|
|
||||||
kAdsExtension = 40000 /**< enum value is extension code . */
|
|
||||||
} AdsResultCode;
|
|
||||||
/** @brief AdsPos enum, with inline docs */
|
|
||||||
typedef enum {
|
|
||||||
kPosCenter = 0,/**< enum the toolbar is at center. */
|
|
||||||
kPosTop,/**< enum the toolbar is at top. */
|
|
||||||
kPosTopLeft,/**< enum the toolbar is at topleft. */
|
|
||||||
kPosTopRight,/**< enum the toolbar is at topright. */
|
|
||||||
kPosBottom,/**< enum the toolbar is at bottom. */
|
|
||||||
kPosBottomLeft,/**< enum the toolbar is at bottomleft. */
|
|
||||||
kPosBottomRight,/**< enum the toolbar is at bottomright. */
|
|
||||||
} AdsPos;
|
|
||||||
/** @brief AdsType enum, with inline docs */
|
|
||||||
typedef enum {
|
|
||||||
AD_TYPE_BANNER = 0,/**< enum value is banner ads . */
|
|
||||||
AD_TYPE_FULLSCREEN,/**< enum value is fullscreen ads . */
|
|
||||||
AD_TYPE_MOREAPP,/**< enum value is moreapp ads . */
|
|
||||||
AD_TYPE_OFFERWALL,/**< enum value is offerwall ads . */
|
|
||||||
AD_TYPE_REWARDEDVIDEO,/**< enum value is rewarded video ads . */
|
|
||||||
AD_TYPE_NATIVEEXPRESS,/**< enum value is Native express ads . */
|
|
||||||
AD_TYPE_NATIVEADVANCED,/**< enum value is Native advanced ads . */
|
|
||||||
} AdsType;
|
|
||||||
|
|
||||||
class ProtocolAds;
|
|
||||||
class AdsListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief The advertisement request result
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onAdsResult(AdsResultCode code, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ProtocolAds : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief show adview
|
|
||||||
@param the type of ads
|
|
||||||
@param the idx of ads
|
|
||||||
*/
|
|
||||||
virtual void showAds(AdsType adsType, int idx = 1) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Hide the adview
|
|
||||||
@param the type of ads
|
|
||||||
@param the idx of ads
|
|
||||||
*/
|
|
||||||
virtual void hideAds(AdsType adsType, int idx = 1) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief preload the adview
|
|
||||||
@param the type of ads
|
|
||||||
@param the idx of ads
|
|
||||||
*/
|
|
||||||
virtual void preloadAds(AdsType adsType, int idx = 1)= 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief Query the points of player
|
|
||||||
*@return the point
|
|
||||||
*/
|
|
||||||
virtual float queryPoints() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief Spend the points.
|
|
||||||
Use this method to notify server spend points.
|
|
||||||
*@param points Need spend number of points
|
|
||||||
*/
|
|
||||||
virtual void spendPoints(int points) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief set the Ads listener
|
|
||||||
@param pListener The callback object for Ads result
|
|
||||||
*/
|
|
||||||
virtual void setAdsListener(AdsListener* listener) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief get pListener The callback object for Ads result
|
|
||||||
@return the listener
|
|
||||||
*/
|
|
||||||
virtual AdsListener* getAdsListener() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Is it supportive of this type of ads
|
|
||||||
@param the type of ads
|
|
||||||
@return if it is supportive ,return true
|
|
||||||
else retur false
|
|
||||||
*/
|
|
||||||
virtual bool isAdTypeSupported(AdsType adType) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_ADS_H__ */
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
/** @file ProtocolAnalytics.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_ANALYTICS_H__
|
|
||||||
#define __CCX_PROTOCOL_ANALYTICS_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> LogEventParamPair
|
|
||||||
/// typedef LogEventParamPair.
|
|
||||||
typedef std::pair< std::string, std::string > LogEventParamPair;
|
|
||||||
/// \typedef std::map<std::string, std::string> LogEventParamMap
|
|
||||||
/// typedef LogEventParamMap.
|
|
||||||
typedef std::map< std::string, std::string > LogEventParamMap;
|
|
||||||
typedef enum {
|
|
||||||
ANONYMOUS,/**< enum value is anonymous typek. */
|
|
||||||
REGISTED,/**< enum value is registed type. */
|
|
||||||
SINA_WEIBO,/**< enum value is sineweibo type. */
|
|
||||||
TENCENT_WEIBO,/**< enum value is tecentweibo type */
|
|
||||||
QQ,/**< enum value is qq type */
|
|
||||||
ND91,/**< enum value is nd91 type. */
|
|
||||||
} AccountType;
|
|
||||||
typedef enum {
|
|
||||||
LOGIN,/**< enum value is the login operate. */
|
|
||||||
LOGOUT,/**< enum value is the logout operate. */
|
|
||||||
REGISTER,/**< enum value is the register operate. */
|
|
||||||
} AccountOperate;
|
|
||||||
typedef enum {
|
|
||||||
MALE,/**< enum value is male. */
|
|
||||||
FEMALE,/**< enum value is female. */
|
|
||||||
UNKNOWN,/**< enum value is unknow. */
|
|
||||||
|
|
||||||
} AccountGender;
|
|
||||||
typedef enum {
|
|
||||||
GUIDE_LINE,/**< enum value is the guideline type.. */
|
|
||||||
MAIN_LINE,/**< enum value is the mainline type.. */
|
|
||||||
BRANCH_LINE,/**<enum value is the branchline type.. */
|
|
||||||
DAILY,/**< enum value is the daily type.. */
|
|
||||||
ACTIVITY,/**< enum value is the activity type. */
|
|
||||||
OTHER,/**< enum value is other type. */
|
|
||||||
} TaskType;
|
|
||||||
/**
|
|
||||||
*@class ProtocolAnalytics
|
|
||||||
*@brief the interface of Analytics
|
|
||||||
*/
|
|
||||||
class ProtocolAnalytics : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Start a new session.
|
|
||||||
*/
|
|
||||||
virtual void startSession() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Stop a session.
|
|
||||||
@warning This interface only worked on android
|
|
||||||
*/
|
|
||||||
virtual void stopSession() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Set the timeout for expiring a session.
|
|
||||||
@param millis In milliseconds as the unit of time.
|
|
||||||
@note It must be invoked before calling startSession.
|
|
||||||
*/
|
|
||||||
virtual void setSessionContinueMillis(long millis) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief log an error
|
|
||||||
@param errorId The identity of error
|
|
||||||
@param message Extern message for the error
|
|
||||||
*/
|
|
||||||
virtual void logError(const char* errorId, const char* message) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief log an event.
|
|
||||||
@param eventId The identity of event
|
|
||||||
@param paramMap Extern parameters of the event, use NULL if not needed.
|
|
||||||
*/
|
|
||||||
virtual void logEvent(const char* eventId, LogEventParamMap* paramMap = NULL) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Track an event begin.
|
|
||||||
@param eventId The identity of event
|
|
||||||
*/
|
|
||||||
virtual void logTimedEventBegin(const char* eventId) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Track an event end.
|
|
||||||
@param eventId The identity of event
|
|
||||||
*/
|
|
||||||
virtual void logTimedEventEnd(const char* eventId) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Whether to catch uncaught exceptions to server.
|
|
||||||
@warning This interface only worked on android.
|
|
||||||
*/
|
|
||||||
virtual void setCaptureUncaughtException(bool enabled) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_ANALYTICS_H__ */
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
/** @file ProtocolCrash.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_CRASH_H__
|
|
||||||
#define __CCX_PROTOCOL_CRASH_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class ProtocolCrash : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* set user identifier
|
|
||||||
*
|
|
||||||
* @param userInfo
|
|
||||||
*/
|
|
||||||
virtual void setUserIdentifier(const char* identifier) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The uploader captured in exception information
|
|
||||||
*
|
|
||||||
* @param message Set the custom information
|
|
||||||
* @param exception The exception
|
|
||||||
*/
|
|
||||||
virtual void reportException(const char* message, const char* exception) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* customize logging
|
|
||||||
*
|
|
||||||
* @param string Custom log
|
|
||||||
*/
|
|
||||||
virtual void leaveBreadcrumb(const char* breadcrumb) = 0;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_CRASH_H__ */
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
/** @file ProtocolCustom.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_CUSTOM_H__
|
|
||||||
#define __CCX_PROTOCOL_CUSTOM_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kCustomExtension = 80000 /**< enum value is extension code . */
|
|
||||||
} CustomResultCode;
|
|
||||||
/**
|
|
||||||
*@class CustomResultListener
|
|
||||||
*@brief the interface of share callback
|
|
||||||
*/
|
|
||||||
class CustomResultListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of share callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onCustomResult(CustomResultCode ret, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
*@class ProtocolCustom
|
|
||||||
*@brief the interface of custom
|
|
||||||
*/
|
|
||||||
class ProtocolCustom : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
@breif set the result listener
|
|
||||||
@param pListener The callback object for custom result
|
|
||||||
@wraning Must invoke this interface before custom
|
|
||||||
*/
|
|
||||||
virtual void setResultListener(CustomResultListener* pListener) = 0;
|
|
||||||
|
|
||||||
virtual CustomResultListener* getCustomListener() = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* ----- #ifndef __CCX_PROTOCOL_Custom_H__ ----- */
|
|
||||||
|
|
@ -1,119 +0,0 @@
|
||||||
/** @file ProtocolIAP.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_IAP_H__
|
|
||||||
#define __CCX_PROTOCOL_IAP_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> TIAPDeveloperInfo
|
|
||||||
/// typedef TIAPDeveloperInfo.
|
|
||||||
typedef std::map<std::string, std::string> TIAPDeveloperInfo;
|
|
||||||
/// \typedef std::map<std::string, std::string> TProductInfo
|
|
||||||
/// typedef TProductInfo.
|
|
||||||
typedef std::map<std::string, std::string> TProductInfo;
|
|
||||||
/// typedef TProductsInfo.
|
|
||||||
typedef std::map<std::string, TProductInfo> AllProductsInfo;
|
|
||||||
/** @brief PayResultCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kPaySuccess = 0,/**< enum value is callback of succeeding in paying . */
|
|
||||||
kPayFail,/**< enum value is callback of failing to pay . */
|
|
||||||
kPayCancel,/**< enum value is callback of canceling to pay . */
|
|
||||||
kPayNetworkError,/**< enum value is callback of network error . */
|
|
||||||
kPayProductionInforIncomplete,/**< enum value is callback of incompleting info . */
|
|
||||||
kPayInitSuccess,/**< enum value is callback of succeeding in initing sdk . */
|
|
||||||
kPayInitFail,/**< enum value is callback of failing to init sdk . */
|
|
||||||
kPayNowPaying,/**< enum value is callback of paying now . */
|
|
||||||
kPayRechargeSuccess,/**< enum value is callback of succeeding in recharging. */
|
|
||||||
kPayExtension = 30000 /**< enum value is extension code . */
|
|
||||||
} PayResultCode;
|
|
||||||
/** @brief RequestResultCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kRequestSuccess = 31000,/**< enum value is callback of succeeding in paying . */
|
|
||||||
kRequestFail/**< enum value is callback of failing to pay . */
|
|
||||||
} RequestResultCode;
|
|
||||||
/**
|
|
||||||
*@class PayResultListener
|
|
||||||
*@brief the interface of pay callback
|
|
||||||
*/
|
|
||||||
class PayResultListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of pay callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*@param the info of pay
|
|
||||||
*/
|
|
||||||
virtual void onPayResult(PayResultCode ret, const char* msg, TProductInfo info) = 0;
|
|
||||||
/**
|
|
||||||
*@brief the interface of request callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*@param the info of request product
|
|
||||||
*/
|
|
||||||
virtual void onRequestResult(RequestResultCode ret, const char* msg, AllProductsInfo info) {}
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
*@class ProtocolIAP
|
|
||||||
*@brief the interface of pay
|
|
||||||
*/
|
|
||||||
|
|
||||||
class ProtocolIAP : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief pay for product
|
|
||||||
@param info The info of product, must contains key:
|
|
||||||
productName The name of product
|
|
||||||
productPrice The price of product(must can be parse to float)
|
|
||||||
productDesc The description of product
|
|
||||||
@warning For different plugin, the parameter should have other keys to pay.
|
|
||||||
Look at the manual of plugins.
|
|
||||||
*/
|
|
||||||
virtual void payForProduct(TProductInfo info) = 0;
|
|
||||||
/**
|
|
||||||
@brief get order id
|
|
||||||
@return the order id
|
|
||||||
*/
|
|
||||||
virtual std::string getOrderId() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@breif set the result listener
|
|
||||||
@param pListener The callback object for pay result
|
|
||||||
@wraning Must invoke this interface before payForProduct.
|
|
||||||
*/
|
|
||||||
virtual void setResultListener(PayResultListener* pListener) = 0;
|
|
||||||
|
|
||||||
virtual PayResultListener* getPayListener() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief get plugin id
|
|
||||||
@return the plugin id
|
|
||||||
*/
|
|
||||||
virtual std::string getPluginId() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief change the state of paying
|
|
||||||
@param the state
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void resetPayState()
|
|
||||||
{
|
|
||||||
_paying = false;
|
|
||||||
}
|
|
||||||
static bool _paying;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_IAP_H__ */
|
|
||||||
|
|
@ -1,104 +0,0 @@
|
||||||
/** @file PluginFactory.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_PUSH_H__
|
|
||||||
#define __CCX_PROTOCOL_PUSH_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <list>
|
|
||||||
#include <string>
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/** @brief Plugin_type enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kPushReceiveMessage = 0,/**value is callback of Receiving Message . */
|
|
||||||
kPushExtensionCode = 60000 /**< enum value is extension code . */
|
|
||||||
|
|
||||||
|
|
||||||
} PushActionResultCode;
|
|
||||||
class ProtocolPush;
|
|
||||||
/**
|
|
||||||
*@class PushActionListener
|
|
||||||
*@brief the interface of Push callback
|
|
||||||
*/
|
|
||||||
class PushActionListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of Push callback
|
|
||||||
*@param the adatper of plugin
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onActionResult(ProtocolPush* pPlugin, PushActionResultCode code, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* @class ProtocolPush
|
|
||||||
*/
|
|
||||||
class ProtocolPush : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief start/register Push services
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void startPush() = 0 ;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief close Push services
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void closePush() = 0 ;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief set alias
|
|
||||||
*@param tags
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void setAlias(string alias) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief del alias
|
|
||||||
*@param tags
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void delAlias(string alias) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief set tag
|
|
||||||
*@param tags
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void setTags(list<string> tags) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief delete tag
|
|
||||||
*@param tags
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void delTags(list<string> tags) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief set the result listener
|
|
||||||
@param pListener The callback object for push result
|
|
||||||
*/
|
|
||||||
virtual void setActionListener(PushActionListener* listener) = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief get pListener The callback object for Push result
|
|
||||||
@return the listener
|
|
||||||
*/
|
|
||||||
virtual PushActionListener* getActionListener() = 0 ;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_PUSH_H__ */
|
|
||||||
|
|
@ -1,83 +0,0 @@
|
||||||
/** @file ProtocolREC.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_REC_H__
|
|
||||||
#define __CCX_PROTOCOL_REC_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
typedef std::map<std::string, std::string> TVideoInfo;
|
|
||||||
|
|
||||||
/** @brief RECResultCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kRECInitSuccess = 0,/**< enum value is callback of succeeding in initing sdk . */
|
|
||||||
kRECInitFail,/**< enum value is callback of failing to init sdk. */
|
|
||||||
kRECStartRecording,/**< enum value is callback of starting to record. */
|
|
||||||
kRECStopRecording,/**< enum value is callback of stoping to record. */
|
|
||||||
kRECPauseRecording,/**< enum value is callback of pausing to record. */
|
|
||||||
kRECResumeRecording,/**< enum value is callback of resuming to record. */
|
|
||||||
kRECEnterSDKPage,/**< enum value is callback of entering SDK`s page. */
|
|
||||||
kRECQuitSDKPage,/**< enum value is callback of quiting SDK`s page. */
|
|
||||||
kRECShareSuccess,/**< enum value is callback of succeeding in sharing. */
|
|
||||||
kRECShareFail,/**< enum value is callback of failing to share. */
|
|
||||||
kRECExtension = 90000 /**< enum value is extension code . */
|
|
||||||
} RECResultCode;
|
|
||||||
/**
|
|
||||||
*@class RECResultListener
|
|
||||||
*@brief the interface of REC callback
|
|
||||||
*/
|
|
||||||
class RECResultListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of REC callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onRECResult(RECResultCode ret, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
*@class ProtocolREC
|
|
||||||
*@brief the interface of REC
|
|
||||||
*/
|
|
||||||
class ProtocolREC : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: Start to record video
|
|
||||||
*/
|
|
||||||
virtual void startRecording() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: Stop to record video
|
|
||||||
*/
|
|
||||||
virtual void stopRecording() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: share video
|
|
||||||
* @Param info The info of share
|
|
||||||
*/
|
|
||||||
virtual void share(TVideoInfo info) = 0;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@breif set the result listener
|
|
||||||
@param pListener The callback object for REC result
|
|
||||||
@wraning Must invoke this interface before REC
|
|
||||||
*/
|
|
||||||
virtual void setResultListener(RECResultListener* pListener) = 0;
|
|
||||||
|
|
||||||
virtual RECResultListener* getRECListener() = 0;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* ----- #ifndef __CCX_PROTOCOL_SHARE_H__ ----- */
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
/** @file ProtocolShare.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_SHARE_H__
|
|
||||||
#define __CCX_PROTOCOL_SHARE_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> TShareDeveloperInfo
|
|
||||||
/// typedef TShareDeveloperInfo.
|
|
||||||
typedef std::map<std::string, std::string> TShareDeveloperInfo;
|
|
||||||
/// \typedef std::map<std::string, std::string> TShareInfo
|
|
||||||
/// typedef TShareInfo.
|
|
||||||
typedef std::map<std::string, std::string> TShareInfo;
|
|
||||||
/** @brief ShareResultCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kShareSuccess = 0,/**< enum value is callback of failing to sharing . */
|
|
||||||
kShareFail,/**< enum value is callback of failing to share . */
|
|
||||||
kShareCancel,/**< enum value is callback of canceling to share . */
|
|
||||||
kShareNetworkError,/**< enum value is callback of network error . */
|
|
||||||
kShareExtension = 10000 /**< enum value is extension code . */
|
|
||||||
} ShareResultCode;
|
|
||||||
/**
|
|
||||||
*@class ShareResultListener
|
|
||||||
*@brief the interface of share callback
|
|
||||||
*/
|
|
||||||
class ShareResultListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of share callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onShareResult(ShareResultCode ret, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
*@class ProtocolShare
|
|
||||||
*@brief the interface of share
|
|
||||||
*/
|
|
||||||
class ProtocolShare : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief share information
|
|
||||||
@param info The info of share, contains key:
|
|
||||||
SharedText The text need to share
|
|
||||||
SharedImagePath The full path of image file need to share (optinal)
|
|
||||||
@warning For different plugin, the parameter should have other keys to share.
|
|
||||||
Look at the manual of plugins. */
|
|
||||||
virtual void share(TShareInfo info) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@breif set the result listener
|
|
||||||
@param pListener The callback object for share result
|
|
||||||
@wraning Must invoke this interface before share
|
|
||||||
*/
|
|
||||||
virtual void setResultListener(ShareResultListener* pListener) = 0;
|
|
||||||
|
|
||||||
virtual ShareResultListener* getShareListener() = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* ----- #ifndef __CCX_PROTOCOL_SHARE_H__ ----- */
|
|
||||||
|
|
@ -1,105 +0,0 @@
|
||||||
/** @file ProtocolSocial.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_SOCIAL_H__
|
|
||||||
#define __CCX_PROTOCOL_SOCIAL_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> TSocialDeveloperInfo
|
|
||||||
/// typedef TSocialDeveloperInfo.
|
|
||||||
typedef std::map<std::string, std::string> TSocialDeveloperInfo;
|
|
||||||
/// \typedef std::map<std::string, std::string> TAchievementInfo
|
|
||||||
/// typedef TAchievementInfo.
|
|
||||||
typedef std::map<std::string, std::string> TAchievementInfo;
|
|
||||||
/** @brief SocialRetCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
// code for leaderboard feature
|
|
||||||
kScoreSubmitSucceed =1,/**< enum value is callback of succeeding in submiting. */
|
|
||||||
kScoreSubmitfail,/**< enum value is callback of failing to submit . */
|
|
||||||
|
|
||||||
// code for achievement feature
|
|
||||||
kAchUnlockSucceed,/**< enum value is callback of succeeding in unlocking. */
|
|
||||||
kAchUnlockFail,/**< enum value is callback of failing to unlock. */
|
|
||||||
|
|
||||||
kSocialSignInSucceed,/**< enum value is callback of succeeding to login. */
|
|
||||||
kSocialSignInFail,/**< enum value is callback of failing to login. */
|
|
||||||
|
|
||||||
kSocialSignOutSucceed,/**< enum value is callback of succeeding to login. */
|
|
||||||
kSocialSignOutFail,/**< enum value is callback of failing to login. */
|
|
||||||
kSocialGetGameFriends,/**< enum value is callback of getGameFriends. */
|
|
||||||
kSocialExtensionCode = 20000 /**< enum value is extension code . */
|
|
||||||
|
|
||||||
} SocialRetCode;
|
|
||||||
/**
|
|
||||||
*@class SocialListener
|
|
||||||
*@brief the interface of social callback
|
|
||||||
*/
|
|
||||||
class SocialListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of social callback
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onSocialResult(SocialRetCode code, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@class ProtocolSocial
|
|
||||||
*@brief the interface of social
|
|
||||||
*/
|
|
||||||
class ProtocolSocial : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief user signIn
|
|
||||||
*/
|
|
||||||
virtual void signIn() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief user signOut
|
|
||||||
*/
|
|
||||||
virtual void signOut() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief submit the score
|
|
||||||
@param leaderboardID
|
|
||||||
@param the score
|
|
||||||
*/
|
|
||||||
virtual void submitScore(const char* leadboardID, long score) = 0;
|
|
||||||
/**
|
|
||||||
@brief show the id of Leaderboard page
|
|
||||||
@param leaderboardID
|
|
||||||
*/
|
|
||||||
virtual void showLeaderboard(const char* leaderboardID) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief methods of achievement feature
|
|
||||||
@param the info of achievement
|
|
||||||
*/
|
|
||||||
virtual void unlockAchievement(TAchievementInfo achInfo) = 0;
|
|
||||||
/**
|
|
||||||
@brief show the page of achievements
|
|
||||||
*/
|
|
||||||
virtual void showAchievements() = 0;
|
|
||||||
/**
|
|
||||||
@brief set pListener The callback object for social result
|
|
||||||
@param the listener
|
|
||||||
*/
|
|
||||||
virtual void setListener(SocialListener* listener) = 0;
|
|
||||||
/**
|
|
||||||
@brief get pListener The callback object for social result
|
|
||||||
@return the listener
|
|
||||||
*/
|
|
||||||
virtual SocialListener* getListener() = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* ----- #ifndef __CCX_PROTOCOL_SOCIAL_H__ ----- */
|
|
||||||
|
|
@ -1,135 +0,0 @@
|
||||||
/** @file ProtocolUser.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_USER_H__
|
|
||||||
#define __CCX_PROTOCOL_USER_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> TUserDeveloperInfo
|
|
||||||
/// typedef TUserDeveloperInfo.
|
|
||||||
typedef std::map<std::string, std::string> TUserDeveloperInfo;
|
|
||||||
/** @brief Plugin_type enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kInitSuccess = 0,/**< enum value is callback of succeeding in initing sdk. */
|
|
||||||
kInitFail,/**< enum value is callback of failing to init sdk. */
|
|
||||||
kLoginSuccess,/**< enum value is callback of succeeding in login.*/
|
|
||||||
kLoginNetworkError,/**< enum value is callback of network error*/
|
|
||||||
kLoginNoNeed,/**< enum value is callback of no need login.*/
|
|
||||||
kLoginFail,/**< enum value is callback of failing to login. */
|
|
||||||
kLoginCancel,/**< enum value is callback of canceling to login. */
|
|
||||||
kLogoutSuccess,/**< enum value is callback of succeeding in logout. */
|
|
||||||
kLogoutFail,/**< enum value is callback of failing to logout. */
|
|
||||||
kPlatformEnter,/**< enum value is callback after enter platform. */
|
|
||||||
kPlatformBack,/**< enum value is callback after exit antiAddiction. */
|
|
||||||
kPausePage,/**< enum value is callback after exit pause page. */
|
|
||||||
kExitPage,/**< enum value is callback after exit exit page. */
|
|
||||||
kAntiAddictionQuery,/**< enum value is callback after querying antiAddiction. */
|
|
||||||
kRealNameRegister,/**< enum value is callback after registering realname. */
|
|
||||||
kAccountSwitchSuccess,/**< enum value is callback of succeeding in switching account. */
|
|
||||||
kAccountSwitchFail,/**< enum value is callback of failing to switch account. */
|
|
||||||
kOpenShop,/**< enum value is callback of open the shop. */
|
|
||||||
kAccountSwitchCancel,/**< enum value is callback of canceling to switch account. */
|
|
||||||
kGameExitPage,/**< enum value is callback of no channel exit page. */
|
|
||||||
kUserExtension = 50000 /**< enum value is extension code . */
|
|
||||||
|
|
||||||
|
|
||||||
} UserActionResultCode;
|
|
||||||
/** @brief ToolBarPlace enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kToolBarTopLeft = 1,/**< enum the toolbar is at topleft. */
|
|
||||||
kToolBarTopRight,/**< enum the toolbar is at topright. */
|
|
||||||
kToolBarMidLeft,/**< enum the toolbar is at midleft. */
|
|
||||||
kToolBarMidRight,/**< enum the toolbar is at midright. */
|
|
||||||
kToolBarBottomLeft,/**< enum the toolbar is at bottomleft. */
|
|
||||||
kToolBarBottomRight,/**< enum the toolbar is at bottomright. */
|
|
||||||
} ToolBarPlace;
|
|
||||||
|
|
||||||
class ProtocolUser;
|
|
||||||
/**
|
|
||||||
*@class UserActionListener
|
|
||||||
*@brief the interface of user callback
|
|
||||||
*/
|
|
||||||
class UserActionListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief the interface of user callback
|
|
||||||
*@param the adatper of plugin
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onActionResult(ProtocolUser* pPlugin, UserActionResultCode code, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* @class ProtocolUser
|
|
||||||
*/
|
|
||||||
class ProtocolUser : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief User login
|
|
||||||
*/
|
|
||||||
virtual void login() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief User login
|
|
||||||
if the process of logining need to know the param of server_id ,
|
|
||||||
you can use the function
|
|
||||||
and if you must change oauthloginserver, you can add the param of oauthLoginServer
|
|
||||||
@param server_id
|
|
||||||
@param oauthLoginServer
|
|
||||||
*/
|
|
||||||
|
|
||||||
CC_DEPRECATED_ATTRIBUTE virtual void login(std::string server_id, std::string oauthLoginServer = "") = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief User login
|
|
||||||
if the process of logining need to know the parameters ,
|
|
||||||
you can use the function
|
|
||||||
@param the parameters
|
|
||||||
*/
|
|
||||||
virtual void login(std::map<std::string, std::string> info) = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Check whether the user logined or not
|
|
||||||
@return If user logined, return value is true;
|
|
||||||
else return value is false.
|
|
||||||
*/
|
|
||||||
virtual bool isLogined() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get USER ID
|
|
||||||
@return If user logined, return value is userID;
|
|
||||||
else return value is empty string.
|
|
||||||
*/
|
|
||||||
virtual std::string getUserID() = 0 ;
|
|
||||||
/**
|
|
||||||
@brief set the result listener
|
|
||||||
@param pListener The callback object for user result
|
|
||||||
*/
|
|
||||||
virtual void setActionListener(UserActionListener* listener) = 0 ;
|
|
||||||
/**
|
|
||||||
@brief get pListener The callback object for user result
|
|
||||||
@return the listener
|
|
||||||
*/
|
|
||||||
virtual UserActionListener* getActionListener() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief get plugin id
|
|
||||||
@return the plugin id
|
|
||||||
*/
|
|
||||||
virtual std::string getPluginId() = 0 ;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_USER_H__ */
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
#ifndef __STATISTICS_H__
|
|
||||||
#define __STATISTICS_H__
|
|
||||||
|
|
||||||
#include <string>
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class Statistics
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static void initInfo();
|
|
||||||
static void createPlugin(std::string pluginName, int pluginType);
|
|
||||||
static void callFunction(std::string pluginName, std::string functionName);
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif //__STATISTICS_H__
|
|
||||||
Binary file not shown.
|
|
@ -1,20 +0,0 @@
|
||||||
//
|
|
||||||
// AdsUtil.h
|
|
||||||
// PluginProtocol
|
|
||||||
//
|
|
||||||
// Created by cocos2dx on 14-9-23.
|
|
||||||
// Copyright (c) 2014年 cocos2dx. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
@interface AdsUtil : NSObject
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the parameters of ads system in special case
|
|
||||||
*
|
|
||||||
* @return return the parameters
|
|
||||||
*/
|
|
||||||
+ (NSMutableDictionary*)getAdsParams;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,96 +0,0 @@
|
||||||
//
|
|
||||||
// AdsWrapper.h
|
|
||||||
// PluginProtocol
|
|
||||||
//
|
|
||||||
// Created by cocos2dx on 14-8-29.
|
|
||||||
// Copyright (c) 2014年 cocos2dx. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
RESULT_CODE_AdsReceived = 0, // The ad is received
|
|
||||||
RESULT_CODE_AdsShown, // The advertisement shown
|
|
||||||
RESULT_CODE_AdsDismissed, // The advertisement
|
|
||||||
// dismissed
|
|
||||||
RESULT_CODE_PointsSpendSucceed, // The points
|
|
||||||
// spend succeed
|
|
||||||
RESULT_CODE_PointsSpendFailed, // The points
|
|
||||||
// spend failed
|
|
||||||
RESULT_CODE_NetworkError, // Network error
|
|
||||||
RESULT_CODE_UnknownError, // Unknown error
|
|
||||||
RESULT_CODE_OfferWallOnPointsChanged, // Change the point of offerwall
|
|
||||||
RESULT_CODE_RewardedVideoWithReward,//the callback of receiving the reward of rewardedvideo
|
|
||||||
RESULT_CODE_InAppPurchaseFinished,////the callback of finishing YAP ad
|
|
||||||
RESULT_CODE_AdsClicked, //the callback of the advertisement clicked
|
|
||||||
RESULT_CODE_ADSEXTENSION = 40000 //ads extension code
|
|
||||||
|
|
||||||
}AD_RET_CODE;
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
AD_TYPE_BANNER = 0,/**< enum value is banner ads . */
|
|
||||||
AD_TYPE_FULLSCREEN,/**< enum value is fullscreen ads . */
|
|
||||||
AD_TYPE_MOREAPP,/**< enum value is moreapp ads . */
|
|
||||||
AD_TYPE_OFFERWALL, /**< enum value is offerwall ads . */
|
|
||||||
AD_TYPE_REWARDEDVIDEO,/**< enum value is rewarded video ads . */
|
|
||||||
AD_TYPE_NATIVEEXPRESS,/**< enum value is Native express ads . */
|
|
||||||
AD_TYPE_NATIVEADVANCED/**< enum value is Native advanced ads . */
|
|
||||||
} ADS_TYPE;
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
POS_CENTER = 0,/**< enum the toolbar is at center. */
|
|
||||||
POS_TOP,/**< enum the toolbar is at top. */
|
|
||||||
POS_TOP_LEFT,/**< enum the toolbar is at topleft. */
|
|
||||||
POS_TOP_RIGHT,/**< enum the toolbar is at topright. */
|
|
||||||
POS_BOTTOM,/**< enum the toolbar is at bottom. */
|
|
||||||
POS_BOTTOM_LEFT,/**< enum the toolbar is at bottomleft. */
|
|
||||||
POS_BOTTOM_RIGHT/**< enum the toolbar is at bottomright. */
|
|
||||||
|
|
||||||
}AD_POS;
|
|
||||||
|
|
||||||
@interface AdsWrapper : NSObject
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get current RootViewController
|
|
||||||
*
|
|
||||||
* @return RootViewController
|
|
||||||
*/
|
|
||||||
+ (UIViewController *)getCurrentRootViewController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get top window
|
|
||||||
*
|
|
||||||
* @return return top window
|
|
||||||
*/
|
|
||||||
+ (UIWindow*) getTopWindow;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The callback interface of yap system
|
|
||||||
*
|
|
||||||
* @param pPlugin the yap plugin
|
|
||||||
* @param ret the code of callback
|
|
||||||
* @param msg the message of callback
|
|
||||||
*/
|
|
||||||
+ (void)onAdsResult:(id)target retCode:(int)code msg:(NSString*)msg;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* add ad view
|
|
||||||
*
|
|
||||||
* @param view view
|
|
||||||
* @param pos position
|
|
||||||
*/
|
|
||||||
+ (void) addAdView:(UIView*) view atPos:(AD_POS) pos;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the name of the advertising types
|
|
||||||
*
|
|
||||||
* @param adType the type of the advertising
|
|
||||||
*
|
|
||||||
* @return the name of the advertising types
|
|
||||||
*/
|
|
||||||
+ (NSString*)getAdNameWithType:(int)adType;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,269 +0,0 @@
|
||||||
/** @file AgentManager.h
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __CCX_AGENTMANAGER_H__
|
|
||||||
#define __CCX_AGENTMANAGER_H__
|
|
||||||
|
|
||||||
#include "PluginManager.h"
|
|
||||||
#include "ProtocolYAP.h"
|
|
||||||
#include "ProtocolAnalytics.h"
|
|
||||||
#include "ProtocolShare.h"
|
|
||||||
#include "ProtocolAds.h"
|
|
||||||
#include "ProtocolSocial.h"
|
|
||||||
#include "ProtocolUser.h"
|
|
||||||
#include "ProtocolPush.h"
|
|
||||||
#include "ProtocolCrash.h"
|
|
||||||
#include "ProtocolREC.h"
|
|
||||||
#include "ProtocolCustom.h"
|
|
||||||
#include "ProtocolAdTracking.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#define ProtocolIAP ProtocolYAP
|
|
||||||
#define getIAPPlugin getYAPPlugin
|
|
||||||
#define kPluginIAP kPluginYAP
|
|
||||||
#define onPay onYap
|
|
||||||
#define kPaySuccess kYapSuccess
|
|
||||||
#define kPayFail kYapFail
|
|
||||||
#define kPayCancel kPayCancel
|
|
||||||
#define kPayNetworkError kPayNetworkError
|
|
||||||
#define kPayProductionInforIncomplete kYapProductionInforIncomplete
|
|
||||||
#define kPayInitSuccess kYapInitSuccess
|
|
||||||
#define kPayInitFail kYapInitFail
|
|
||||||
#define kPayNowPaying kYapNowYaping
|
|
||||||
#define kPayRechargeSuccess kYapYapSuccess
|
|
||||||
#define kPayExtension kYapExtension
|
|
||||||
#define PayResultCode YapResultCode
|
|
||||||
#define resetPayState resetYapState
|
|
||||||
#define getPayListener getYapListener
|
|
||||||
#define payForProduct yapForProduct
|
|
||||||
#define onPayResult onYapResult
|
|
||||||
#define PayResultListener YapResultListener
|
|
||||||
#define kPayCancel kYapCancel
|
|
||||||
#define kPayNetworkError kYapNetworkError
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/** @brief Plugin_type enum, with inline docs */
|
|
||||||
typedef enum {
|
|
||||||
kPluginAds = 16,/**< enum value is the type of Ads. */
|
|
||||||
kPluginAnalytics = 1,/**< enum value is the type of Analytics. */
|
|
||||||
kPluginYAP = 8,/**< enum value is the type of YAP. */
|
|
||||||
kPluginShare = 2,/**< enum value is the type of Share. */
|
|
||||||
kPluginUser = 32,/**< enum value is the type of User. */
|
|
||||||
kPluginSocial = 4,/**< enum value is the type of Social. */
|
|
||||||
kPluginPush = 64,/**< enum value is the type of Push. */
|
|
||||||
kPluginCrash = 128,/**< enum value is the type of Crash. */
|
|
||||||
kPluginCustom = 256,/**< enum value is the type of Custom. */
|
|
||||||
kPluginREC = 512,/**< enum value is the type of REC. */
|
|
||||||
kPluginAdTracking = 1024,/**< enum value is the type of AdTracking. */
|
|
||||||
}Plugin_type;
|
|
||||||
/**
|
|
||||||
* @class AgentManager
|
|
||||||
*/
|
|
||||||
class AgentManager
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~AgentManager();
|
|
||||||
/**
|
|
||||||
@brief Get singleton of AgentManager
|
|
||||||
*/
|
|
||||||
|
|
||||||
static AgentManager* getInstance();
|
|
||||||
/**
|
|
||||||
@brief Destory the instance of AgentManager
|
|
||||||
*/
|
|
||||||
static void end();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@breif the init of AgentManager
|
|
||||||
@param the appKey of anysdk
|
|
||||||
@param the appSecret of anysdk
|
|
||||||
@param the privateKey of anysdk
|
|
||||||
@param the url of oauthLoginServer
|
|
||||||
@warning Must invoke this interface before loadAllPlugins
|
|
||||||
*/
|
|
||||||
void init(std::string appKey,std::string appSecret,std::string privateKey,std::string oauthLoginServer);
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief load the plugins
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE void loadALLPlugin();
|
|
||||||
/**
|
|
||||||
@brief unload the plugins
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE void unloadALLPlugin();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief load the plugins
|
|
||||||
*/
|
|
||||||
void loadAllPlugins();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief unload the plugins
|
|
||||||
*/
|
|
||||||
void unloadAllPlugins();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Analytics plugin
|
|
||||||
@return if Analytics plugin exist ,return value is Analytics plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolAnalytics* getAnalyticsPlugin(){return _pAnalytics;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get User plugin
|
|
||||||
@return if User plugin exist ,return value is User plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolUser* getUserPlugin(){return _pUser;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get YAP plugin
|
|
||||||
@return if YAP plugin exist ,return value is YAP plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
std::map<std::string , ProtocolYAP*>* getYAPPlugin(){return &_pluginsYAPMap;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Share plugin
|
|
||||||
@return if Share plugin exist ,return value is Share plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolShare* getSharePlugin(){return _pShare;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Social plugin
|
|
||||||
@return if Social plugin exist ,return value is Social plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolSocial* getSocialPlugin(){return _pSocial;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Ads plugin
|
|
||||||
@return if Ads plugin exist ,return value is Ads plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolAds* getAdsPlugin(){return _pAds;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Push plugin
|
|
||||||
@return if Push plugin exist ,return value is Push plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolPush* getPushPlugin(){return _pPush;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Crash plugin
|
|
||||||
@return if Crash plugin exist ,return value is Crash plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolCrash* getCrashPlugin(){return _pCrash;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get Custom plugin
|
|
||||||
@return if Crash plugin exist ,return value is Custom plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolCustom* getCustomPlugin(){return _pCustom;};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get REC plugin
|
|
||||||
@return if REC plugin exist ,return value is REC plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolREC* getRECPlugin(){return _pREC;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get AdTracking plugin
|
|
||||||
@return if AdTracking plugin exist ,return value is AdTracking plugin.
|
|
||||||
else return value is null pointer.
|
|
||||||
*/
|
|
||||||
ProtocolAdTracking* getAdTrackingPlugin(){return _pAdTracking;};
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get channel ID
|
|
||||||
@return return value is channel ID.
|
|
||||||
*/
|
|
||||||
std::string getChannelId();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get custom param
|
|
||||||
@return return value is custom param for channel.
|
|
||||||
*/
|
|
||||||
std::string getCustomParam();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Get framework version
|
|
||||||
@return return value is the version of AnySDKFramework.
|
|
||||||
*/
|
|
||||||
std::string getFrameworkVersion();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@Title: setIsAnaylticsEnabled
|
|
||||||
@Description: choose to open or close
|
|
||||||
@param @param enabled true or false
|
|
||||||
@return void
|
|
||||||
*/
|
|
||||||
void setIsAnaylticsEnabled(bool value){bIsAnaylticsEnabled = value;};
|
|
||||||
/**
|
|
||||||
@Title: isAnaylticsEnabled
|
|
||||||
@Description: the status of Anayltics
|
|
||||||
@param @return true or false
|
|
||||||
@return boolean
|
|
||||||
*/
|
|
||||||
bool isAnaylticsEnabled(){return bIsAnaylticsEnabled;};
|
|
||||||
|
|
||||||
|
|
||||||
void loadPlugin(const char* nodeName,int type);
|
|
||||||
protected:
|
|
||||||
void setDebugMode(bool flag);
|
|
||||||
std::string getSupportPlugin();
|
|
||||||
void release();
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
AgentManager(void);
|
|
||||||
|
|
||||||
// Analytics plugin
|
|
||||||
ProtocolAnalytics* _pAnalytics;
|
|
||||||
|
|
||||||
// user plugin
|
|
||||||
ProtocolUser* _pUser;
|
|
||||||
|
|
||||||
// YAP plugins
|
|
||||||
// ProtocolYAP* _pYAP;
|
|
||||||
std::map<std::string , ProtocolYAP*> _pluginsYAPMap;
|
|
||||||
|
|
||||||
// Share plugin
|
|
||||||
ProtocolShare* _pShare;
|
|
||||||
|
|
||||||
// Social plugin
|
|
||||||
ProtocolSocial* _pSocial;
|
|
||||||
|
|
||||||
// Ads plugin
|
|
||||||
ProtocolAds* _pAds;
|
|
||||||
|
|
||||||
// Push plugin
|
|
||||||
ProtocolPush* _pPush;
|
|
||||||
|
|
||||||
// Crash plugin
|
|
||||||
ProtocolCrash* _pCrash;
|
|
||||||
|
|
||||||
// Custom plugin
|
|
||||||
ProtocolCustom* _pCustom;
|
|
||||||
|
|
||||||
// REC plugin
|
|
||||||
ProtocolREC* _pREC;
|
|
||||||
|
|
||||||
// AdTracking plugin
|
|
||||||
ProtocolAdTracking* _pAdTracking;
|
|
||||||
|
|
||||||
bool bIsAnaylticsEnabled;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_AGENTMANAGER_H__ */
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
//
|
|
||||||
// AnalyticsWrapper.h
|
|
||||||
// PluginProtocol
|
|
||||||
//
|
|
||||||
// Created by cocos2dx on 14-10-9.
|
|
||||||
// Copyright (c) 2014年 cocos2dx. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
ACCOUNT_TYPE_ANONYMOUS,/**< enum value is anonymous typek. */
|
|
||||||
ACCOUNT_TYPE_REGISTED,/**< enum value is registed type. */
|
|
||||||
ACCOUNT_TYPE_SINA_WEIBO,/**< enum value is sineweibo type. */
|
|
||||||
ACCOUNT_TYPE_TENCENT_WEIBO,/**< enum value is tecentweibo type */
|
|
||||||
ACCOUNT_TYPE_QQ,/**< enum value is qq type */
|
|
||||||
ACCOUNT_TYPE_ND91,/**< enum value is nd91 type. */
|
|
||||||
} ANALYTICS_ACCOUNT_TYPE;
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
ACCOUNT_OPERATE_LOGIN,/**< enum value is the login operate. */
|
|
||||||
ACCOUNT_OPERATE_LOGOUT,/**< enum value is the logout operate. */
|
|
||||||
ACCOUNT_OPERATE_REGISTER,/**< enum value is the register operate. */
|
|
||||||
}ANALYTICS_ACCOUNT_OPERATE;
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
ACCOUNT_GENDER_MALE,/**< enum value is male. */
|
|
||||||
ACCOUNT_GENDER_FEMALE,/**< enum value is female. */
|
|
||||||
ACCOUNT_GENDER_UNKNOWN,/**< enum value is unknow. */
|
|
||||||
|
|
||||||
} ANALYTICS_ACCOUNT_GENDER;
|
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
TASK_TYPE_GUIDE_LINE,/**< enum value is the guideline type.. */
|
|
||||||
TASK_TYPE_MAIN_LINE,/**< enum value is the mainline type.. */
|
|
||||||
TASK_TYPE_BRANCH_LINE,/**<enum value is the branchline type.. */
|
|
||||||
TASK_TYPE_DAILY,/**< enum value is the daily type.. */
|
|
||||||
TASK_TYPE_ACTIVITY,/**< enum value is the activity type. */
|
|
||||||
TASK_TYPE_OTHER,/**< enum value is other type. */
|
|
||||||
} ANALYTICS_TASK_TYPE;
|
|
||||||
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
#ifndef __CRT_SDK_DELEGATE_H
|
|
||||||
#define __CRT_SDK_DELEGATE_H
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
@protocol CocosRuntimeSDKDelegate <NSObject>
|
|
||||||
|
|
||||||
- (NSMutableArray*)getSupportForPlugins;
|
|
||||||
- (NSMutableDictionary*)getPluginParams;
|
|
||||||
- (NSString*)getDevelopInfo;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif /* __CRT_SDK_DELEGATE_H */
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
//
|
|
||||||
// CustomWrapper.h
|
|
||||||
// PluginProtocol
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
CUSTOMRESULT_CUSTOMEXTENSION = 80000 /**< enum value is extension code . */
|
|
||||||
} CUSTOM_RET_CODE;
|
|
||||||
|
|
||||||
@interface CustomWrapper : NSObject
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The callback interface of Custom system
|
|
||||||
*
|
|
||||||
* @param pPlugin the Custom plugin
|
|
||||||
* @param ret the code of callback
|
|
||||||
* @param msg the message of callback
|
|
||||||
*/
|
|
||||||
+ (void) onCustomResult:(id)pPlugin retCode:(int)ret retMsg:(NSString*)msg;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,108 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2012+2013 cocos2d+x.org
|
|
||||||
|
|
||||||
http://www.cocos2d+x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
@protocol InterfaceAdTracking<NSObject>
|
|
||||||
|
|
||||||
@required
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: onRegister
|
|
||||||
* @Description: Call this method if you want to track register events as happening during a section.
|
|
||||||
* @param userInfo user identifier
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
- (void) onRegister: (NSString*) userId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: onLogin
|
|
||||||
* @Description:Call this method if you want to track login events as happening during a section.
|
|
||||||
* @param userInfo The details of this parameters are already covered by document.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
- (void) onLogin: (NSMutableDictionary*) userInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: onYap
|
|
||||||
* @Description: Call this method if you want to track yap events as happening during a section.
|
|
||||||
* @param productInfo The details of this parameters are already covered by document.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
- (void) onYap: (NSMutableDictionary*) productInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: trackEvent
|
|
||||||
* @Description: Call this method if you want to track custom events as happening during a section.
|
|
||||||
* @param eventId The custom event name.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
- (void) trackEvent: (NSString*) eventId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: trackEvent
|
|
||||||
* @Description: Call this method if you want to track custom events with parameters as happening during a section.
|
|
||||||
* @param eventId The custom event name.
|
|
||||||
* @param paramMap The details of this parameters are already covered by document.
|
|
||||||
*/
|
|
||||||
- (void) trackEvent: (NSString*) eventId withParam:(NSMutableDictionary*) paramMap;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* whether function is supported
|
|
||||||
*
|
|
||||||
* @param functionName the name of function
|
|
||||||
*
|
|
||||||
* @return return If the function is supported, return true
|
|
||||||
or if the function is not supported, return false
|
|
||||||
*/
|
|
||||||
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of SDK
|
|
||||||
*
|
|
||||||
* @return the version of SDK
|
|
||||||
*/
|
|
||||||
- (NSString*) getSDKVersion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of plugin
|
|
||||||
*
|
|
||||||
* @return the version of plugin
|
|
||||||
*/
|
|
||||||
- (NSString*) getPluginVersion;
|
|
||||||
|
|
||||||
@optional
|
|
||||||
/**
|
|
||||||
* init SDK
|
|
||||||
*
|
|
||||||
* @param cpInfo the parameters of SDK
|
|
||||||
*/
|
|
||||||
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,122 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2012+2013 cocos2d+x.org
|
|
||||||
|
|
||||||
http://www.cocos2d+x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
@protocol InterfaceAds<NSObject>
|
|
||||||
|
|
||||||
@required
|
|
||||||
/**
|
|
||||||
* show advertising
|
|
||||||
*
|
|
||||||
* @param info the parameters of the advertising
|
|
||||||
key:Param1 value:the type of advertising
|
|
||||||
key:Param2 value:the order of advertising
|
|
||||||
*/
|
|
||||||
- (void) showAds: (NSMutableDictionary*) info;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* hide advertising
|
|
||||||
*
|
|
||||||
* @param info the parameters of the advertising
|
|
||||||
key:Param1 value:the type of advertising
|
|
||||||
key:Param2 value:the order of advertising
|
|
||||||
*/
|
|
||||||
- (void) hideAds: (NSMutableDictionary*) info;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* preload advertising
|
|
||||||
*
|
|
||||||
* @param info the parameters of the advertising
|
|
||||||
key:Param1 value:the type of advertising
|
|
||||||
key:Param2 value:the order of advertising
|
|
||||||
*/
|
|
||||||
- (void) preloadAds: (NSMutableDictionary*) info;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* query the points
|
|
||||||
*
|
|
||||||
* @return points
|
|
||||||
*/
|
|
||||||
- (float) queryPoints;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* spend user`s points
|
|
||||||
*
|
|
||||||
* @param points the points of spending
|
|
||||||
*/
|
|
||||||
- (void) spendPoints: (int) points;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Description
|
|
||||||
*
|
|
||||||
* @param adType the type of advertising
|
|
||||||
*
|
|
||||||
* @return if the type is supported ,return true
|
|
||||||
or if the type is supported ,return false
|
|
||||||
*/
|
|
||||||
- (BOOL) isAdTypeSupported: (int)adType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of SDK
|
|
||||||
*
|
|
||||||
* @return the version of SDK
|
|
||||||
*/
|
|
||||||
- (NSString*) getSDKVersion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of plugin
|
|
||||||
*
|
|
||||||
* @return the version of plugin
|
|
||||||
*/
|
|
||||||
- (NSString*) getPluginVersion;
|
|
||||||
|
|
||||||
|
|
||||||
@optional
|
|
||||||
/**
|
|
||||||
* init SDK
|
|
||||||
*
|
|
||||||
* @param cpInfo the parameters of SDK
|
|
||||||
*/
|
|
||||||
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* set debug mode true or false
|
|
||||||
*
|
|
||||||
* @param debug the status of debug
|
|
||||||
*/
|
|
||||||
- (void) setDebugMode: (BOOL) debug;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* whether function is supported
|
|
||||||
*
|
|
||||||
* @param functionName the name of function
|
|
||||||
*
|
|
||||||
* @return return If the function is supported, return true
|
|
||||||
or if the function is not supported, return false
|
|
||||||
*/
|
|
||||||
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,132 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2012+2013 cocos2d+x.org
|
|
||||||
|
|
||||||
http://www.cocos2d+x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
@protocol InterfaceAnalytics<NSObject>
|
|
||||||
|
|
||||||
@required
|
|
||||||
/**
|
|
||||||
* start session analytics
|
|
||||||
*/
|
|
||||||
- (void) startSession;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* stop session analytics
|
|
||||||
*/
|
|
||||||
- (void) stopSession;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the timeout for expiring a session.
|
|
||||||
*
|
|
||||||
* @param millis In milliseconds as the unit of time.
|
|
||||||
* @note It must be invoked before calling startSession.
|
|
||||||
*/
|
|
||||||
- (void) setSessionContinueMillis: (long) millis;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether to catch uncaught exceptions to server.
|
|
||||||
*
|
|
||||||
* @warning This interface only worked on android.
|
|
||||||
*/
|
|
||||||
- (void) setCaptureUncaughtException: (BOOL) isEnabled;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* log an error
|
|
||||||
*
|
|
||||||
* @param errorId The identity of event
|
|
||||||
* @param message message for the error
|
|
||||||
*/
|
|
||||||
- (void) logError: (NSString*) errorId withMsg:(NSString*) message;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* log an event
|
|
||||||
*
|
|
||||||
* @param eventId The identity of event
|
|
||||||
*/
|
|
||||||
- (void) logEvent: (NSString*) eventId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* log an event
|
|
||||||
*
|
|
||||||
* @param eventId The identity of event
|
|
||||||
* @param paramMap Extern parameters of the event
|
|
||||||
*/
|
|
||||||
- (void) logEvent: (NSString*) eventId withParam:(NSMutableDictionary*) paramMap;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Track an event begin
|
|
||||||
*
|
|
||||||
* @param eventId The identity of event
|
|
||||||
*/
|
|
||||||
- (void) logTimedEventBegin: (NSString*) eventId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Track an event end.
|
|
||||||
*
|
|
||||||
* @param eventId The identity of event
|
|
||||||
*/
|
|
||||||
- (void) logTimedEventEnd: (NSString*) eventId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* whether function is supported
|
|
||||||
*
|
|
||||||
* @param functionName the name of function
|
|
||||||
*
|
|
||||||
* @return return If the function is supported, return true
|
|
||||||
or if the function is not supported, return false
|
|
||||||
*/
|
|
||||||
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of SDK
|
|
||||||
*
|
|
||||||
* @return the version of SDK
|
|
||||||
*/
|
|
||||||
- (NSString*) getSDKVersion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of plugin
|
|
||||||
*
|
|
||||||
* @return the version of plugin
|
|
||||||
*/
|
|
||||||
- (NSString*) getPluginVersion;
|
|
||||||
|
|
||||||
@optional
|
|
||||||
/**
|
|
||||||
* init SDK
|
|
||||||
*
|
|
||||||
* @param cpInfo the parameters of SDK
|
|
||||||
*/
|
|
||||||
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* set debug mode true or false
|
|
||||||
*
|
|
||||||
* @param debug the status of debug
|
|
||||||
*/
|
|
||||||
- (void) setDebugMode: (BOOL) debug;
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,86 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2012+2013 cocos2d+x.org
|
|
||||||
|
|
||||||
http://www.cocos2d+x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
@protocol InterfaceCrash <NSObject>
|
|
||||||
|
|
||||||
@required
|
|
||||||
|
|
||||||
/**
|
|
||||||
* set user identifier
|
|
||||||
*
|
|
||||||
* @param userInfo
|
|
||||||
*/
|
|
||||||
- (void) setUserIdentifier: (NSString*)identifier ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The uploader captured in exception information
|
|
||||||
*
|
|
||||||
* @param message Set the custom information
|
|
||||||
* @param exception The exception
|
|
||||||
*/
|
|
||||||
- (void) reportException: (NSString*)message exception:(NSString*)exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* customize logging
|
|
||||||
*
|
|
||||||
* @param string Custom log
|
|
||||||
*/
|
|
||||||
- (void) leaveBreadcrumb: (NSString*)breadcrumb;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of SDK
|
|
||||||
*
|
|
||||||
* @return the version of SDK
|
|
||||||
*/
|
|
||||||
- (NSString*) getSDKVersion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of plugin
|
|
||||||
*
|
|
||||||
* @return the version of plugin
|
|
||||||
*/
|
|
||||||
- (NSString*) getPluginVersion;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* whether function is supported
|
|
||||||
*
|
|
||||||
* @param functionName the name of function
|
|
||||||
*
|
|
||||||
* @return return If the function is supported, return true
|
|
||||||
or if the function is not supported, return false
|
|
||||||
*/
|
|
||||||
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
|
||||||
|
|
||||||
@optional
|
|
||||||
/**
|
|
||||||
* init SDK
|
|
||||||
*
|
|
||||||
* @param cpInfo the parameters of SDK
|
|
||||||
*/
|
|
||||||
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,64 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2012+2013 cocos2d+x.org
|
|
||||||
|
|
||||||
http://www.cocos2d+x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
@protocol InterfaceCustom <NSObject>
|
|
||||||
|
|
||||||
@required
|
|
||||||
/**
|
|
||||||
* get the version of SDK
|
|
||||||
*
|
|
||||||
* @return the version of SDK
|
|
||||||
*/
|
|
||||||
- (NSString*) getSDKVersion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of plugin
|
|
||||||
*
|
|
||||||
* @return the version of plugin
|
|
||||||
*/
|
|
||||||
- (NSString*) getPluginVersion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* whether function is supported
|
|
||||||
*
|
|
||||||
* @param functionName the name of function
|
|
||||||
*
|
|
||||||
* @return return If the function is supported, return true
|
|
||||||
or if the function is not supported, return false
|
|
||||||
*/
|
|
||||||
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
|
||||||
|
|
||||||
@optional
|
|
||||||
/**
|
|
||||||
* init SDK
|
|
||||||
*
|
|
||||||
* @param cpInfo the parameters of SDK
|
|
||||||
*/
|
|
||||||
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,106 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2012+2013 cocos2d+x.org
|
|
||||||
|
|
||||||
http://www.cocos2d+x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
@protocol InterfacePush <NSObject>
|
|
||||||
|
|
||||||
@required
|
|
||||||
/**
|
|
||||||
* start push service
|
|
||||||
*/
|
|
||||||
- (void) startPush;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* close push service
|
|
||||||
*/
|
|
||||||
- (void) closePush;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* set alias
|
|
||||||
*
|
|
||||||
* @param alias the value of alias
|
|
||||||
*/
|
|
||||||
- (void) setAlias: (NSString*)alias;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* delete alias
|
|
||||||
*
|
|
||||||
* @param alias the value of alias
|
|
||||||
*/
|
|
||||||
- (void) delAlias: (NSString*)alias;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* set tags
|
|
||||||
*
|
|
||||||
* @param tags the content of tags
|
|
||||||
*/
|
|
||||||
- (void) setTags: (NSMutableArray*)tags;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* delete tags
|
|
||||||
*
|
|
||||||
* @param tags the content of tags
|
|
||||||
*/
|
|
||||||
- (void) delTags: (NSMutableArray*)tags;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of SDK
|
|
||||||
*
|
|
||||||
* @return the version of SDK
|
|
||||||
*/
|
|
||||||
- (NSString*) getSDKVersion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of plugin
|
|
||||||
*
|
|
||||||
* @return the version of plugin
|
|
||||||
*/
|
|
||||||
- (NSString*) getPluginVersion;
|
|
||||||
|
|
||||||
@optional
|
|
||||||
/**
|
|
||||||
* init SDK
|
|
||||||
*
|
|
||||||
* @param cpInfo the parameters of SDK
|
|
||||||
*/
|
|
||||||
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* set debug mode true or false
|
|
||||||
*
|
|
||||||
* @param debug the status of debug
|
|
||||||
*/
|
|
||||||
- (void) setDebugMode: (BOOL) debug;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* whether function is supported
|
|
||||||
*
|
|
||||||
* @param functionName the name of function
|
|
||||||
*
|
|
||||||
* @return return If the function is supported, return true
|
|
||||||
or if the function is not supported, return false
|
|
||||||
*/
|
|
||||||
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,95 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2012+2013 cocos2d+x.org
|
|
||||||
|
|
||||||
http://www.cocos2d+x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
@protocol InterfaceREC <NSObject>
|
|
||||||
|
|
||||||
@required
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: startRecording
|
|
||||||
* @Description: Start to record video
|
|
||||||
* @param @return None
|
|
||||||
* @return void
|
|
||||||
* @throws
|
|
||||||
*/
|
|
||||||
- (void) startRecording;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: stopRecording
|
|
||||||
* @Description: Stop to record video
|
|
||||||
* @param @return None
|
|
||||||
* @return void
|
|
||||||
* @throws
|
|
||||||
*/
|
|
||||||
- (void) stopRecording;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: share
|
|
||||||
* @Description: share video
|
|
||||||
* @param @param info the info of video
|
|
||||||
* @return void
|
|
||||||
* @throws
|
|
||||||
*/
|
|
||||||
- (void) share:(NSMutableDictionary *) info;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of SDK
|
|
||||||
*
|
|
||||||
* @return the version of SDK
|
|
||||||
*/
|
|
||||||
- (NSString*) getSDKVersion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of plugin
|
|
||||||
*
|
|
||||||
* @return the version of plugin
|
|
||||||
*/
|
|
||||||
- (NSString*) getPluginVersion;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* whether function is supported
|
|
||||||
*
|
|
||||||
* @param functionName the name of function
|
|
||||||
*
|
|
||||||
* @return return If the function is supported, return true
|
|
||||||
or if the function is not supported, return false
|
|
||||||
*/
|
|
||||||
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
|
||||||
|
|
||||||
@optional
|
|
||||||
/**
|
|
||||||
* init SDK
|
|
||||||
*
|
|
||||||
* @param cpInfo the parameters of SDK
|
|
||||||
*/
|
|
||||||
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,75 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2012+2013 cocos2d+x.org
|
|
||||||
|
|
||||||
http://www.cocos2d+x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
@protocol InterfaceShare <NSObject>
|
|
||||||
|
|
||||||
@required
|
|
||||||
/**
|
|
||||||
* share
|
|
||||||
*
|
|
||||||
* @param shareInfo the content of share
|
|
||||||
* @note the description is subject to the wiki(http://docs.anysdk.com/YAPSystem#.E6.94.AF.E4.BB.98)
|
|
||||||
*/
|
|
||||||
- (void) share: (NSMutableDictionary*) shareInfo;
|
|
||||||
/**
|
|
||||||
* get the version of SDK
|
|
||||||
*
|
|
||||||
* @return the version of SDK
|
|
||||||
*/
|
|
||||||
- (NSString*) getSDKVersion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of plugin
|
|
||||||
*
|
|
||||||
* @return the version of plugin
|
|
||||||
*/
|
|
||||||
- (NSString*) getPluginVersion;
|
|
||||||
|
|
||||||
@optional
|
|
||||||
/**
|
|
||||||
* init SDK
|
|
||||||
*
|
|
||||||
* @param cpInfo the parameters of SDK
|
|
||||||
*/
|
|
||||||
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* set debug mode true or false
|
|
||||||
*
|
|
||||||
* @param debug the status of debug
|
|
||||||
*/
|
|
||||||
- (void) setDebugMode: (BOOL) debug;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* whether function is supported
|
|
||||||
*
|
|
||||||
* @param functionName the name of function
|
|
||||||
*
|
|
||||||
* @return return If the function is supported, return true
|
|
||||||
or if the function is not supported, return false
|
|
||||||
*/
|
|
||||||
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,102 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2013 cocos2d+x.org
|
|
||||||
|
|
||||||
http://www.cocos2d+x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
@protocol InterfaceSocial <NSObject>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* login in socail system
|
|
||||||
*/
|
|
||||||
- (void) signIn;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* logout in socail system
|
|
||||||
*/
|
|
||||||
- (void) signOut;
|
|
||||||
/**
|
|
||||||
* submit the socre for leaderboard
|
|
||||||
*
|
|
||||||
* @param leaderboardID the identifier of leaderboard
|
|
||||||
* @param score the score
|
|
||||||
*/
|
|
||||||
- (void) submitScore: (NSString*) leaderboardID withScore: (long) score;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* show the leaderboard
|
|
||||||
*
|
|
||||||
* @param leaderboardID the identifier of leaderboard
|
|
||||||
*/
|
|
||||||
- (void) showLeaderboard: (NSString*) leaderboardID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* unlock achievements of game
|
|
||||||
*
|
|
||||||
* @param achInfo the content of achievement
|
|
||||||
*/
|
|
||||||
- (void) unlockAchievement: (NSMutableDictionary*) achInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* show achievements of game
|
|
||||||
*/
|
|
||||||
- (void) showAchievements;
|
|
||||||
/**
|
|
||||||
* get the version of SDK
|
|
||||||
*
|
|
||||||
* @return the version of SDK
|
|
||||||
*/
|
|
||||||
- (NSString*) getSDKVersion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of plugin
|
|
||||||
*
|
|
||||||
* @return the version of plugin
|
|
||||||
*/
|
|
||||||
- (NSString*) getPluginVersion;
|
|
||||||
|
|
||||||
@optional
|
|
||||||
/**
|
|
||||||
* init SDK
|
|
||||||
*
|
|
||||||
* @param cpInfo the parameters of SDK
|
|
||||||
*/
|
|
||||||
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* set debug mode true or false
|
|
||||||
*
|
|
||||||
* @param debug the status of debug
|
|
||||||
*/
|
|
||||||
- (void) setDebugMode: (BOOL) debug;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* whether function is supported
|
|
||||||
*
|
|
||||||
* @param functionName the name of function
|
|
||||||
*
|
|
||||||
* @return return If the function is supported, return true
|
|
||||||
or if the function is not supported, return false
|
|
||||||
*/
|
|
||||||
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,94 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2012+2013 cocos2d+x.org
|
|
||||||
|
|
||||||
http://www.cocos2d+x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
@protocol InterfaceUser <NSObject>
|
|
||||||
|
|
||||||
@required
|
|
||||||
/**
|
|
||||||
* user login
|
|
||||||
*/
|
|
||||||
- (void) login;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the status of login
|
|
||||||
*
|
|
||||||
* @return status of login
|
|
||||||
*/
|
|
||||||
- (BOOL) isLogined;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get user identifier
|
|
||||||
*
|
|
||||||
* @return user identifier
|
|
||||||
*/
|
|
||||||
- (NSString*) getUserID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of SDK
|
|
||||||
*
|
|
||||||
* @return the version of SDK
|
|
||||||
*/
|
|
||||||
- (NSString*) getSDKVersion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of plugin
|
|
||||||
*
|
|
||||||
* @return the version of plugin
|
|
||||||
*/
|
|
||||||
- (NSString*) getPluginVersion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the identifier of plugin
|
|
||||||
*
|
|
||||||
* @return the identifier of plugin
|
|
||||||
*/
|
|
||||||
- (NSString*) getPluginId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* whether function is supported
|
|
||||||
*
|
|
||||||
* @param functionName the name of function
|
|
||||||
*
|
|
||||||
* @return return If the function is supported, return true
|
|
||||||
or if the function is not supported, return false
|
|
||||||
*/
|
|
||||||
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
|
||||||
|
|
||||||
@optional
|
|
||||||
/**
|
|
||||||
* init SDK
|
|
||||||
*
|
|
||||||
* @param cpInfo the parameters of SDK
|
|
||||||
*/
|
|
||||||
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* set debug mode true or false
|
|
||||||
*
|
|
||||||
* @param debug the status of debug
|
|
||||||
*/
|
|
||||||
- (void) setDebugMode: (BOOL) debug;
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,102 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2012+2013 cocos2d+x.org
|
|
||||||
|
|
||||||
http://www.cocos2d+x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
@protocol InterfaceYAP <NSObject>
|
|
||||||
|
|
||||||
@required
|
|
||||||
/**
|
|
||||||
* yap for product
|
|
||||||
*
|
|
||||||
* @param profuctInfo the information of the product
|
|
||||||
key:Product_Id value: the identifier of product
|
|
||||||
key:Product_Name value: the name of product
|
|
||||||
key:Product_Price value: the price of product, denominated as the yuan.
|
|
||||||
key:Product_Count value: the count of product
|
|
||||||
key:Role_Id value:the identifier of role
|
|
||||||
key:Role_Name value: the name of role
|
|
||||||
key:Role_Grade value: the grade of role
|
|
||||||
key:Role_Balance value: the virtual currency amount of role
|
|
||||||
key:Server_Id value: the identifier of yaping server
|
|
||||||
key:EXT value: Extended Parameters
|
|
||||||
* @note the rule of production maybe changes,please the description is subject to the wiki(http://docs.anysdk.com/YAPSystem#.E6.94.AF.E4.BB.98)
|
|
||||||
*/
|
|
||||||
- (void) yapForProduct: (NSMutableDictionary*) productInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the order identifier
|
|
||||||
*
|
|
||||||
* @return the order identifier
|
|
||||||
*/
|
|
||||||
- (NSString*) getOrderId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of SDK
|
|
||||||
*
|
|
||||||
* @return the version of SDK
|
|
||||||
*/
|
|
||||||
- (NSString*) getSDKVersion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the version of plugin
|
|
||||||
*
|
|
||||||
* @return the version of plugin
|
|
||||||
*/
|
|
||||||
- (NSString*) getPluginVersion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the identifier of plugin
|
|
||||||
*
|
|
||||||
* @return the identifier of plugin
|
|
||||||
*/
|
|
||||||
- (NSString*) getPluginId;
|
|
||||||
|
|
||||||
@optional
|
|
||||||
/**
|
|
||||||
* init SDK
|
|
||||||
*
|
|
||||||
* @param cpInfo the parameters of SDK
|
|
||||||
*/
|
|
||||||
- (void) configDeveloperInfo : (NSMutableDictionary*) cpInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* set debug mode true or false
|
|
||||||
*
|
|
||||||
* @param debug the status of debug
|
|
||||||
*/
|
|
||||||
- (void) setDebugMode: (BOOL) debug;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* whether function is supported
|
|
||||||
*
|
|
||||||
* @param functionName the name of function
|
|
||||||
*
|
|
||||||
* @return return If the function is supported, return true
|
|
||||||
or if the function is not supported, return false
|
|
||||||
*/
|
|
||||||
- (BOOL) isFunctionSupported : (NSString*) functionName;
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
/** @file JSBRelation.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_JSBRELATION_H__
|
|
||||||
#define __CCX_JSBRELATION_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @class JSBRelation
|
|
||||||
*/
|
|
||||||
class JSBRelation
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static string getMethodsOfPlugin(PluginProtocol* plugin);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_JSBRELATION_H__ */
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
//
|
|
||||||
// JsonParser.h
|
|
||||||
// PluginProtocol
|
|
||||||
//
|
|
||||||
// Created by cocos2dx on 14-9-17.
|
|
||||||
// Copyright (c) 2014年 cocos2dx. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
@interface JsonParser : NSObject
|
|
||||||
|
|
||||||
+(NSString*)parseJsonForNSKey:(NSString*)data key:(NSString*)key __attribute__((deprecated));
|
|
||||||
|
|
||||||
+(NSString*)parseJsonForNSKey:(NSString*)data key:(NSString*)key key2:(NSString*)key2 __attribute__((deprecated));
|
|
||||||
|
|
||||||
+(NSString*)parseJsonForNSKey:(NSString*)data key:(NSString*)key key2:(NSString*)key2 key3:(NSString*)key3 __attribute__((deprecated));
|
|
||||||
|
|
||||||
|
|
||||||
+(const char*)parseJsonForKey:(const char*)data key:(const char*)key __attribute__((deprecated));
|
|
||||||
|
|
||||||
+(const char*)parseJsonForKey:(const char*)data key:(const char*)key key2:(const char*)key2 __attribute__((deprecated));
|
|
||||||
|
|
||||||
+(const char*)parseJsonForKey:(const char*)data key:(const char*)key key2:(const char*)key2 key3:(const char*)key3 __attribute__((deprecated));
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,53 +0,0 @@
|
||||||
/****************************************************************************
|
|
||||||
Copyright (c) 2012+2013 cocos2d+x.org
|
|
||||||
|
|
||||||
http://www.cocos2d+x.org
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
****************************************************************************/
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
@protocol PluginApplicationDelegate <NSObject>
|
|
||||||
|
|
||||||
@optional
|
|
||||||
//about user system
|
|
||||||
|
|
||||||
- (void)applicationDidEnterBackground:(UIApplication *)application ;
|
|
||||||
- (void)applicationWillEnterForeground:(UIApplication *)application ;
|
|
||||||
|
|
||||||
|
|
||||||
//about yap system
|
|
||||||
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation ;
|
|
||||||
|
|
||||||
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url;
|
|
||||||
|
|
||||||
|
|
||||||
//about push system
|
|
||||||
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken ;
|
|
||||||
|
|
||||||
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error ;
|
|
||||||
|
|
||||||
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo;
|
|
||||||
|
|
||||||
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler ;
|
|
||||||
|
|
||||||
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler ;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
/** @file PluginFactory.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PLUGIN_FACTORY_H__
|
|
||||||
#define __CCX_PLUGIN_FACTORY_H__
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class PluginProtocol;
|
|
||||||
class PluginManager;
|
|
||||||
/**
|
|
||||||
* @class PluginFactory
|
|
||||||
*/
|
|
||||||
class PluginFactory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~PluginFactory();
|
|
||||||
/**
|
|
||||||
@brief Get singleton of PluginFactory
|
|
||||||
*/
|
|
||||||
static PluginFactory* getInstance();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Destory the instance of PluginFactory
|
|
||||||
*/
|
|
||||||
static void purgeFactory();
|
|
||||||
|
|
||||||
private:
|
|
||||||
friend class PluginManager;
|
|
||||||
PluginFactory(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief create the plugin by name and type
|
|
||||||
@param the name of plugin
|
|
||||||
@param the type of plugin
|
|
||||||
*/
|
|
||||||
PluginProtocol* createPlugin(const char* name, int pluginType);
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PLUGIN_FACTORY_H__ */
|
|
||||||
|
|
@ -1,130 +0,0 @@
|
||||||
//
|
|
||||||
// PluginHelper.h
|
|
||||||
// PluginProtocol
|
|
||||||
//
|
|
||||||
// Created by cocos2dx on 14-8-29.
|
|
||||||
// Copyright (c) 2014年 cocos2dx. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
|
|
||||||
@interface PluginHelper : NSObject
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the parameters of SDK
|
|
||||||
*
|
|
||||||
* @return the parameters of SDK
|
|
||||||
*/
|
|
||||||
+ (NSMutableDictionary*) getParamsInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: getDebugModeStatus
|
|
||||||
* @Description: get the status of DebugMode
|
|
||||||
* @param @return status
|
|
||||||
* @return BOOL yes or no
|
|
||||||
*/
|
|
||||||
+ (BOOL) getDebugModeStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: getLogLevel
|
|
||||||
* @Description: get the level of log
|
|
||||||
* @param @return level
|
|
||||||
* @return "verbose" "debug" "info" "warning" "error"
|
|
||||||
*/
|
|
||||||
+ (NSString*) getLogLevel;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the status of network
|
|
||||||
*
|
|
||||||
* @return if the network is reachable ,return true
|
|
||||||
or if the network is reachable,return false
|
|
||||||
*/
|
|
||||||
+ (BOOL) networkReachable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get current RootViewController
|
|
||||||
*
|
|
||||||
* @return RootViewController
|
|
||||||
*/
|
|
||||||
+ (UIViewController *)getCurrentRootViewController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* network transmission in plugin
|
|
||||||
*
|
|
||||||
* @param data content transmitted over the network
|
|
||||||
* @param target callback object
|
|
||||||
* @param sel callback function
|
|
||||||
* @note the content must contain the value that key is "server_url"
|
|
||||||
* @note http use post
|
|
||||||
*/
|
|
||||||
+ (void) pluginHttp:(NSMutableDictionary*)data target:(id)target sel:(SEL)sel;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* log output ,the lever is verbose
|
|
||||||
*
|
|
||||||
* @param message the message about this log
|
|
||||||
*/
|
|
||||||
+ (void) logVerbose:(NSString*)format,...;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* log output ,the lever is error
|
|
||||||
*
|
|
||||||
* @param message the message about this log
|
|
||||||
*/
|
|
||||||
+ (void) logError:(NSString*)format,...;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* log output ,the lever is debug
|
|
||||||
*
|
|
||||||
* @param message the message about this log
|
|
||||||
*/
|
|
||||||
+ (void) logDebug:(NSString*)format,...;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* log output ,the lever is info
|
|
||||||
*
|
|
||||||
* @param message the message about this log
|
|
||||||
*/
|
|
||||||
+ (void) logInfo:(NSString*)format,...;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the game identifier
|
|
||||||
*
|
|
||||||
* @return name
|
|
||||||
*/
|
|
||||||
+ (NSString*) getGameId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the application name
|
|
||||||
*
|
|
||||||
* @return name
|
|
||||||
*/
|
|
||||||
+ (NSString*) getApplicationName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the application orientation
|
|
||||||
*
|
|
||||||
* @return multiple orientation
|
|
||||||
*/
|
|
||||||
+ (NSArray*) getApplicationOrientation;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the application version
|
|
||||||
*
|
|
||||||
* @return version
|
|
||||||
*/
|
|
||||||
+ (NSString*) getApplicationVersion;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parsing XML file
|
|
||||||
* @param the name of XML file
|
|
||||||
* @return NSMutableDictionary the content of XML file
|
|
||||||
*/
|
|
||||||
+ (NSMutableDictionary*) getXMLInfoByFileName:(NSString*)fileName;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
/** @file PluginFactory.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PLUGINMANAGER_H__
|
|
||||||
#define __CCX_PLUGINMANAGER_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include "PluginFactory.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @class PluginManager
|
|
||||||
*/
|
|
||||||
class PluginManager
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~PluginManager();
|
|
||||||
/**
|
|
||||||
@brief Get singleton of PluginManager
|
|
||||||
*/
|
|
||||||
static PluginManager* getInstance();
|
|
||||||
/**
|
|
||||||
@brief Destory the instance of PluginManager
|
|
||||||
*/
|
|
||||||
static void end();
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief load the plugin by name and type
|
|
||||||
@param the name of plugin
|
|
||||||
@param the type of plugin
|
|
||||||
*/
|
|
||||||
PluginProtocol* loadPlugin(const char* name, int pluginType);
|
|
||||||
/**
|
|
||||||
@brief unload the plugin by name and type
|
|
||||||
@param the name of plugin
|
|
||||||
@param the type of plugin
|
|
||||||
*/
|
|
||||||
void unloadPlugin(const char* name, int pluginType = 0);
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
PluginManager(void);
|
|
||||||
std::map<std::string, PluginProtocol*> _pluginsMap;
|
|
||||||
// bool _isDebug;
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PLUGINMANAGER_H__ */
|
|
||||||
|
|
@ -1,126 +0,0 @@
|
||||||
/** @file PluginParam.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PLUGIN_PARAM_H__
|
|
||||||
#define __CCX_PLUGIN_PARAM_H__
|
|
||||||
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
/// \typedef std::map<std::string, std::string> StringMap
|
|
||||||
/// typedef YString.
|
|
||||||
typedef std::map<std::string, std::string> StringMap;
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class PluginProtocol;
|
|
||||||
/**
|
|
||||||
* @class PluginParam
|
|
||||||
*/
|
|
||||||
class PluginParam
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
@brief the default constructor of PluginParam
|
|
||||||
*/
|
|
||||||
PluginParam();
|
|
||||||
|
|
||||||
virtual ~PluginParam();
|
|
||||||
/**
|
|
||||||
@brief the constructor of PluginParam
|
|
||||||
@param the value is Integer
|
|
||||||
*/
|
|
||||||
PluginParam(int nValue);
|
|
||||||
/**
|
|
||||||
@brief the constructor of PluginParam
|
|
||||||
@param the value is float
|
|
||||||
*/
|
|
||||||
PluginParam(float fValue);
|
|
||||||
/**
|
|
||||||
@brief the constructor of PluginParam
|
|
||||||
@param the value is boolean
|
|
||||||
*/
|
|
||||||
PluginParam(bool bValue);
|
|
||||||
/**
|
|
||||||
@brief the default constructor of PluginParam
|
|
||||||
@param the value is char
|
|
||||||
*/
|
|
||||||
PluginParam(const char* strValue);
|
|
||||||
/**
|
|
||||||
@brief the default constructor of PluginParam
|
|
||||||
@param the value is StringMap
|
|
||||||
*/
|
|
||||||
PluginParam(StringMap strMapValue);
|
|
||||||
|
|
||||||
typedef enum{
|
|
||||||
kParamTypeNull = 0,
|
|
||||||
kParamTypeInt,
|
|
||||||
kParamTypeFloat,
|
|
||||||
kParamTypeBool,
|
|
||||||
kParamTypeString,
|
|
||||||
kParamTypeStringMap,
|
|
||||||
kParamTypeMap,
|
|
||||||
} ParamType;
|
|
||||||
/**
|
|
||||||
@brief get the ParamType of value
|
|
||||||
*/
|
|
||||||
inline ParamType getCurrentType() {
|
|
||||||
return _type;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the int value
|
|
||||||
*/
|
|
||||||
inline int getIntValue() {
|
|
||||||
return _intValue;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the float value
|
|
||||||
*/
|
|
||||||
inline float getFloatValue() {
|
|
||||||
return _floatValue;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the boolean value
|
|
||||||
*/
|
|
||||||
inline bool getBoolValue() {
|
|
||||||
return _boolValue;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the char value
|
|
||||||
*/
|
|
||||||
inline const char* getStringValue() {
|
|
||||||
return _strValue.c_str();
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the map of value
|
|
||||||
*/
|
|
||||||
inline std::map<std::string, PluginParam*> getMapValue() {
|
|
||||||
return _mapValue;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
@brief get the StringMap value
|
|
||||||
*/
|
|
||||||
inline StringMap getStrMapValue() {
|
|
||||||
return _strMapValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
friend class PluginProtocol;
|
|
||||||
/**
|
|
||||||
@brief the constructor of PluginParam
|
|
||||||
@param the map of value
|
|
||||||
*/
|
|
||||||
PluginParam(std::map<std::string, PluginParam*> mapValue);
|
|
||||||
|
|
||||||
private:
|
|
||||||
ParamType _type;
|
|
||||||
|
|
||||||
int _intValue;
|
|
||||||
float _floatValue;
|
|
||||||
bool _boolValue;
|
|
||||||
std::string _strValue;
|
|
||||||
std::map<std::string, PluginParam*> _mapValue;
|
|
||||||
StringMap _strMapValue;
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PLUGIN_PARAM_H__ */
|
|
||||||
|
|
@ -1,144 +0,0 @@
|
||||||
/** @file PluginProtocol.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_IPLUGIN_H__
|
|
||||||
#define __CCX_IPLUGIN_H__
|
|
||||||
|
|
||||||
#include "PluginParam.h"
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
|
|
||||||
#define CC_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
|
|
||||||
#elif _MSC_VER >= 1400 //vs 2005 or higher
|
|
||||||
#define CC_DEPRECATED_ATTRIBUTE __declspec(deprecated)
|
|
||||||
#else
|
|
||||||
#define CC_DEPRECATED_ATTRIBUTE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @class PluginProtocol
|
|
||||||
* @brief The super class for all plugins.
|
|
||||||
*/
|
|
||||||
class PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
virtual ~PluginProtocol() {};
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief set plugin name
|
|
||||||
*@param the name of plugin
|
|
||||||
*/
|
|
||||||
virtual void setPluginName(const char* name) = 0 ;
|
|
||||||
/**
|
|
||||||
*@brief get plugin name
|
|
||||||
*@return the name of plugin
|
|
||||||
*/
|
|
||||||
virtual const char* getPluginName() = 0 ;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief get the version of plugin
|
|
||||||
*@return the version of plugin
|
|
||||||
*/
|
|
||||||
virtual std::string getPluginVersion();
|
|
||||||
/**
|
|
||||||
*@brief get the version of sdk
|
|
||||||
*@return the version of sdk
|
|
||||||
*/
|
|
||||||
virtual std::string getSDKVersion();
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief switch debug plug-in on/off
|
|
||||||
*@param the value of on/off
|
|
||||||
*/
|
|
||||||
CC_DEPRECATED_ATTRIBUTE virtual void setDebugMode(bool bDebug);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void callFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return void
|
|
||||||
*/
|
|
||||||
virtual void callFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return string
|
|
||||||
*/
|
|
||||||
virtual std::string callStringFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return string
|
|
||||||
*/
|
|
||||||
virtual std::string callStringFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return int
|
|
||||||
*/
|
|
||||||
virtual int callIntFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return int
|
|
||||||
*/
|
|
||||||
virtual int callIntFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return bool
|
|
||||||
*/
|
|
||||||
virtual bool callBoolFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return bool
|
|
||||||
*/
|
|
||||||
virtual bool callBoolFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param PluginParam* param
|
|
||||||
*@return float
|
|
||||||
*/
|
|
||||||
virtual float callFloatFuncWithParam(const char* funcName, PluginParam* param, ...);
|
|
||||||
/**
|
|
||||||
*@brief methods for reflections
|
|
||||||
*@param function name
|
|
||||||
*@param std::vector<PluginParam*> params
|
|
||||||
*@return float
|
|
||||||
*/
|
|
||||||
virtual float callFloatFuncWithParam(const char* funcName, std::vector<PluginParam*> params);
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Check function the plugin support or not
|
|
||||||
@param the name of plugin
|
|
||||||
@return if the function support ,return true
|
|
||||||
else retur false
|
|
||||||
*/
|
|
||||||
virtual bool isFunctionSupported(std::string functionName);
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} //namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_IPLUGIN_H__ */
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
//
|
|
||||||
// PluginWrapper.h
|
|
||||||
// PluginProtocol
|
|
||||||
//
|
|
||||||
#import <UIKit/UIKit.h>
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#import "PluginApplicationDelegate.h"
|
|
||||||
@interface PluginWrapper : NSObject
|
|
||||||
|
|
||||||
@property (nonatomic, strong) NSMutableArray * arrayDelegate;
|
|
||||||
|
|
||||||
+ (PluginWrapper*) getInstance;
|
|
||||||
|
|
||||||
- (void) setDelegate:(id<PluginApplicationDelegate>)delegate;
|
|
||||||
|
|
||||||
//about user system
|
|
||||||
|
|
||||||
- (void)applicationDidEnterBackground:(UIApplication *)application ;
|
|
||||||
- (void)applicationWillEnterForeground:(UIApplication *)application ;
|
|
||||||
|
|
||||||
//about yap system
|
|
||||||
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation ;
|
|
||||||
|
|
||||||
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url;
|
|
||||||
|
|
||||||
|
|
||||||
//about push system
|
|
||||||
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken ;
|
|
||||||
|
|
||||||
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;
|
|
||||||
|
|
||||||
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo ;
|
|
||||||
|
|
||||||
- (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo completionHandler:(void(^)())completionHandler ;
|
|
||||||
|
|
||||||
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
/** @file ProtocolAdTracking.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_ADTRACKING_H__
|
|
||||||
#define __CCX_PROTOCOL_ADTRACKING_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/**
|
|
||||||
*@class ProtocolAdTracking
|
|
||||||
*@brief the interface of AdTracking
|
|
||||||
*/
|
|
||||||
class ProtocolAdTracking : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: onRegister
|
|
||||||
* @Description: Call this method if you want to track register events as happening during a section.
|
|
||||||
* @param userId user identifier
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
virtual void onRegister(const char* userId) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: onLogin
|
|
||||||
* @Description:Call this method if you want to track login events as happening during a section.
|
|
||||||
* @param userInfo The details of this parameters are already covered by document.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
virtual void onLogin(std::map<std::string, std::string> userInfo) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: onYap
|
|
||||||
* @Description: Call this method if you want to track yap events as happening during a section.
|
|
||||||
* @param productInfo The details of this parameters are already covered by document.
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
virtual void onYap(std::map<std::string, std::string> productInfo) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @Title: trackEvent
|
|
||||||
* @Description: Call this method if you want to track custom events with parameters as happening during a section.
|
|
||||||
* @param eventId The custom event name.
|
|
||||||
* @param paramMap The details of this parameters are already covered by document.
|
|
||||||
*/
|
|
||||||
virtual void trackEvent(const char* eventId, std::map<std::string, std::string>* paramMap = NULL) = 0;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* ----- #ifndef __CCX_PROTOCOL_ADTRACKING_H__ ----- */
|
|
||||||
|
|
@ -1,133 +0,0 @@
|
||||||
/** @file ProtocolAds.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_ADS_H__
|
|
||||||
#define __CCX_PROTOCOL_ADS_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> TAdsDeveloperInfo
|
|
||||||
/// typedef TAdsDeveloperInfo.
|
|
||||||
typedef std::map<std::string, std::string> TAdsDeveloperInfo;
|
|
||||||
/// \typedef std::map<std::string, std::string> TAdsInfo
|
|
||||||
/// typedef TAdsInfo.
|
|
||||||
typedef std::map<std::string, std::string> TAdsInfo;
|
|
||||||
/** @brief AdsResultCode enum, with inline docs */
|
|
||||||
typedef enum
|
|
||||||
{
|
|
||||||
kAdsReceived = 0, /**< enum the callback: the ad is received is at center. */
|
|
||||||
|
|
||||||
kAdsShown, /**< enum the callback: the advertisement dismissed. */
|
|
||||||
kAdsDismissed, /**< enum the callback: the advertisement dismissed. */
|
|
||||||
|
|
||||||
kPointsSpendSucceed, /**< enum the callback: the points spend succeed. */
|
|
||||||
kPointsSpendFailed, /**< enum the callback: the points spend failed. */
|
|
||||||
|
|
||||||
kNetworkError, /**< enum the callback of Network error at center. */
|
|
||||||
kUnknownError, /**< enum the callback of Unknown error. */
|
|
||||||
kOfferWallOnPointsChanged, /**< enum the callback of Changing the point of offerwall. */
|
|
||||||
kRewardedVideoWithReward,/**< enum the callback of receiving the reward of rewardedvideo. */
|
|
||||||
kInAppPurchaseFinished,/**< enum the callback of finishing YAP ad. */
|
|
||||||
kAdsClicked,/**< enum the callback of the advertisement clicked. */
|
|
||||||
kAdsExtension = 40000 /**< enum value is extension code . */
|
|
||||||
} AdsResultCode;
|
|
||||||
/** @brief AdsPos enum, with inline docs */
|
|
||||||
typedef enum {
|
|
||||||
kPosCenter = 0,/**< enum the toolbar is at center. */
|
|
||||||
kPosTop,/**< enum the toolbar is at top. */
|
|
||||||
kPosTopLeft,/**< enum the toolbar is at topleft. */
|
|
||||||
kPosTopRight,/**< enum the toolbar is at topright. */
|
|
||||||
kPosBottom,/**< enum the toolbar is at bottom. */
|
|
||||||
kPosBottomLeft,/**< enum the toolbar is at bottomleft. */
|
|
||||||
kPosBottomRight,/**< enum the toolbar is at bottomright. */
|
|
||||||
} AdsPos;
|
|
||||||
/** @brief AdsType enum, with inline docs */
|
|
||||||
typedef enum {
|
|
||||||
AD_TYPE_BANNER = 0,/**< enum value is banner ads . */
|
|
||||||
AD_TYPE_FULLSCREEN,/**< enum value is fullscreen ads . */
|
|
||||||
AD_TYPE_MOREAPP,/**< enum value is moreapp ads . */
|
|
||||||
AD_TYPE_OFFERWALL,/**< enum value is offerwall ads . */
|
|
||||||
AD_TYPE_REWARDEDVIDEO,/**< enum value is rewarded video ads . */
|
|
||||||
AD_TYPE_NATIVEEXPRESS,/**< enum value is Native express ads . */
|
|
||||||
AD_TYPE_NATIVEADVANCED,/**< enum value is Native advanced ads . */
|
|
||||||
} AdsType;
|
|
||||||
|
|
||||||
class ProtocolAds;
|
|
||||||
class AdsListener
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
*@brief The advertisement request result
|
|
||||||
*@param the id of callback
|
|
||||||
*@param the information of callback
|
|
||||||
*/
|
|
||||||
virtual void onAdsResult(AdsResultCode code, const char* msg) = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
class ProtocolAds : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief show adview
|
|
||||||
@param the type of ads
|
|
||||||
@param the idx of ads
|
|
||||||
*/
|
|
||||||
virtual void showAds(AdsType adsType, int idx = 1) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Hide the adview
|
|
||||||
@param the type of ads
|
|
||||||
@param the idx of ads
|
|
||||||
*/
|
|
||||||
virtual void hideAds(AdsType adsType, int idx = 1) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief preload the adview
|
|
||||||
@param the type of ads
|
|
||||||
@param the idx of ads
|
|
||||||
*/
|
|
||||||
virtual void preloadAds(AdsType adsType, int idx = 1)= 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief Query the points of player
|
|
||||||
*@return the point
|
|
||||||
*/
|
|
||||||
virtual float queryPoints() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@brief Spend the points.
|
|
||||||
Use this method to notify server spend points.
|
|
||||||
*@param points Need spend number of points
|
|
||||||
*/
|
|
||||||
virtual void spendPoints(int points) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief set the Ads listener
|
|
||||||
@param pListener The callback object for Ads result
|
|
||||||
*/
|
|
||||||
virtual void setAdsListener(AdsListener* listener) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief get pListener The callback object for Ads result
|
|
||||||
@return the listener
|
|
||||||
*/
|
|
||||||
virtual AdsListener* getAdsListener() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Is it supportive of this type of ads
|
|
||||||
@param the type of ads
|
|
||||||
@return if it is supportive ,return true
|
|
||||||
else retur false
|
|
||||||
*/
|
|
||||||
virtual bool isAdTypeSupported(AdsType adType) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_ADS_H__ */
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
/** @file ProtocolAnalytics.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_ANALYTICS_H__
|
|
||||||
#define __CCX_PROTOCOL_ANALYTICS_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
/// \typedef std::map<std::string, std::string> LogEventParamPair
|
|
||||||
/// typedef LogEventParamPair.
|
|
||||||
typedef std::pair< std::string, std::string > LogEventParamPair;
|
|
||||||
/// \typedef std::map<std::string, std::string> LogEventParamMap
|
|
||||||
/// typedef LogEventParamMap.
|
|
||||||
typedef std::map< std::string, std::string > LogEventParamMap;
|
|
||||||
typedef enum {
|
|
||||||
ANONYMOUS,/**< enum value is anonymous typek. */
|
|
||||||
REGISTED,/**< enum value is registed type. */
|
|
||||||
SINA_WEIBO,/**< enum value is sineweibo type. */
|
|
||||||
TENCENT_WEIBO,/**< enum value is tecentweibo type */
|
|
||||||
QQ,/**< enum value is qq type */
|
|
||||||
ND91,/**< enum value is nd91 type. */
|
|
||||||
} AccountType;
|
|
||||||
typedef enum {
|
|
||||||
LOGIN,/**< enum value is the login operate. */
|
|
||||||
LOGOUT,/**< enum value is the logout operate. */
|
|
||||||
REGISTER,/**< enum value is the register operate. */
|
|
||||||
} AccountOperate;
|
|
||||||
typedef enum {
|
|
||||||
MALE,/**< enum value is male. */
|
|
||||||
FEMALE,/**< enum value is female. */
|
|
||||||
UNKNOWN,/**< enum value is unknow. */
|
|
||||||
|
|
||||||
} AccountGender;
|
|
||||||
typedef enum {
|
|
||||||
GUIDE_LINE,/**< enum value is the guideline type.. */
|
|
||||||
MAIN_LINE,/**< enum value is the mainline type.. */
|
|
||||||
BRANCH_LINE,/**<enum value is the branchline type.. */
|
|
||||||
DAILY,/**< enum value is the daily type.. */
|
|
||||||
ACTIVITY,/**< enum value is the activity type. */
|
|
||||||
OTHER,/**< enum value is other type. */
|
|
||||||
} TaskType;
|
|
||||||
/**
|
|
||||||
*@class ProtocolAnalytics
|
|
||||||
*@brief the interface of Analytics
|
|
||||||
*/
|
|
||||||
class ProtocolAnalytics : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Start a new session.
|
|
||||||
*/
|
|
||||||
virtual void startSession() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Stop a session.
|
|
||||||
@warning This interface only worked on android
|
|
||||||
*/
|
|
||||||
virtual void stopSession() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Set the timeout for expiring a session.
|
|
||||||
@param millis In milliseconds as the unit of time.
|
|
||||||
@note It must be invoked before calling startSession.
|
|
||||||
*/
|
|
||||||
virtual void setSessionContinueMillis(long millis) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief log an error
|
|
||||||
@param errorId The identity of error
|
|
||||||
@param message Extern message for the error
|
|
||||||
*/
|
|
||||||
virtual void logError(const char* errorId, const char* message) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief log an event.
|
|
||||||
@param eventId The identity of event
|
|
||||||
@param paramMap Extern parameters of the event, use NULL if not needed.
|
|
||||||
*/
|
|
||||||
virtual void logEvent(const char* eventId, LogEventParamMap* paramMap = NULL) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Track an event begin.
|
|
||||||
@param eventId The identity of event
|
|
||||||
*/
|
|
||||||
virtual void logTimedEventBegin(const char* eventId) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Track an event end.
|
|
||||||
@param eventId The identity of event
|
|
||||||
*/
|
|
||||||
virtual void logTimedEventEnd(const char* eventId) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
@brief Whether to catch uncaught exceptions to server.
|
|
||||||
@warning This interface only worked on android.
|
|
||||||
*/
|
|
||||||
virtual void setCaptureUncaughtException(bool enabled) = 0;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_ANALYTICS_H__ */
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
/** @file ProtocolCrash.h
|
|
||||||
*/
|
|
||||||
#ifndef __CCX_PROTOCOL_CRASH_H__
|
|
||||||
#define __CCX_PROTOCOL_CRASH_H__
|
|
||||||
|
|
||||||
#include "PluginProtocol.h"
|
|
||||||
#include <map>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
class ProtocolCrash : public PluginProtocol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
/**
|
|
||||||
* set user identifier
|
|
||||||
*
|
|
||||||
* @param userInfo
|
|
||||||
*/
|
|
||||||
virtual void setUserIdentifier(const char* identifier) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The uploader captured in exception information
|
|
||||||
*
|
|
||||||
* @param message Set the custom information
|
|
||||||
* @param exception The exception
|
|
||||||
*/
|
|
||||||
virtual void reportException(const char* message, const char* exception) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* customize logging
|
|
||||||
*
|
|
||||||
* @param string Custom log
|
|
||||||
*/
|
|
||||||
virtual void leaveBreadcrumb(const char* breadcrumb) = 0;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}} // namespace anysdk { namespace framework {
|
|
||||||
|
|
||||||
#endif /* __CCX_PROTOCOL_CRASH_H__ */
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue