/* DO NOT EDIT THIS FILE - it is machine generated */
#ifndef FUNCELL_GAMESDKPROXY_H
#define FUNCELL_GAMESDKPROXY_H
#include <string.h>
#include <string>
#include "cocos2d.h"

using namespace std;

extern "C" {
/**
 * 初始化回调
 */
class IFuncellInitCallBack {
public:
	virtual void onInitSuccess() = 0;
	virtual void onInitFailure(const char *msg) = 0;
};

/**
 * 登录成功后返回的数据类
 */
class FuncellSession {
	const char *mChannelCode; //渠道标识
	const char *mUserID; //平台用户ID
	const char *mUsername; //平台用户名
	const char *mToken; //平台token
	const char *mProductCode; //游戏标识
	const char *mChannelUserId; //渠道用户ID
	const char *mChannelUserName; //渠道用户名
public:
	void setChannelCode(const char* channelCode) {
		mChannelCode = channelCode;
	}
	void setUserId(const char* userId) {
		mUserID = userId;
	}
	void setUsername(const char* username) {
		mUsername = username;
	}
	void setToken(const char* token) {
		mToken = token;
	}
	void setProductCode(const char* productCode) {
		mProductCode = productCode;
	}
	void setChannelUserId(const char* channelUserId) {
		mChannelUserId = channelUserId;
	}
	void setChannelUserName(const char* channelUserName) {
		mChannelUserName = channelUserName;
	}

	const char* getChannelCode() {
		char *result = new char[strlen(mChannelCode) + 1];
		strcpy(result, mChannelCode);
		return result;
	}
	const char* getUserId() {
		char *result = new char[strlen(mUserID) + 1];
		strcpy(result, mUserID);
		return result;
	}
	const char* getUsername() {
		char *result = new char[strlen(mUsername) + 1];
		strcpy(result, mUsername);
		return result;
	}
	const char* getToken() {
		char *result = new char[strlen(mToken) + 1];
		strcpy(result, mToken);
		return result;
	}
	const char* getProductCode() {
		char *result = new char[strlen(mProductCode) + 1];
		strcpy(result, mProductCode);
		return result;
	}
	const char* getChannelUserId() {
		char *result = new char[strlen(mChannelUserId) + 1];
		strcpy(result, mChannelUserId);
		return result;
	}

	const char* getChannelUserName() {
		char *result = new char[strlen(mChannelUserName) + 1];
		strcpy(result, mChannelUserName);
		return result;
	}

};

/**
 * 用户登录，登出回调
 */
class IFuncellSessionCallBack {
public:
	virtual void onLoginSuccess(FuncellSession *session) = 0;
	virtual void onLoginCancel() = 0;
	virtual void onLoginFailed(char *paramString) = 0;
	virtual void onLogout() = 0;
};

class RoleInfo {
	char *mRoleName; // 角色名称
	char *mRoleId; // 角色ID
	char *mRoleLevel; // 角色等级
	char *mServerName; // 服务器名称
	char *mServerId; // 服务器ID
	char *mVipLevel; // VIP等级
	char *mGameGoldBalance; // 游戏玩家金币余额
	char *mGameUnionName; // 公会名字
public:
	void setRoleName(char* RoleName) {
		mRoleName = RoleName;
	}
	void setRoleId(char* RoleId) {
		mRoleId = RoleId;
	}
	void setRoleLevel(char* RoleLevel) {
		mRoleLevel = RoleLevel;
	}
	void setServerName(char* ServerName) {
		mServerName = ServerName;
	}
	void setServerId(char* ServerId) {
		mServerId = ServerId;
	}
	void setVipLevel(char* VipLevel) {
		mVipLevel = VipLevel;
	}
	void setGameGoldBalance(char* GameGoldBalance) {
		mGameGoldBalance = GameGoldBalance;
	}
	void setGameUnionName(char* GameUnionName) {
		mGameUnionName = GameUnionName;
	}

	const char* getRoleName() {
		char *result = new char[strlen(mRoleName) + 1];
		strcpy(result, mRoleName);
		return result;
	}
	const char* getRoleId() {
		char *result = new char[strlen(mRoleId) + 1];
		strcpy(result, mRoleId);
		return result;
	}
	const char* getRoleLevel() {
		char *result = new char[strlen(mRoleLevel) + 1];
		strcpy(result, mRoleLevel);
		return result;
	}
	const char* getServerName() {
		char *result = new char[strlen(mServerName) + 1];
		strcpy(result, mServerName);
		return result;
	}
	const char* getServerId() {
		char *result = new char[strlen(mServerId) + 1];
		strcpy(result, mServerId);
		return result;
	}
	const char* getVipLevel() {
		char *result = new char[strlen(mVipLevel) + 1];
		strcpy(result, mVipLevel);
		return result;
	}
	const char* getGameGoldBalance() {
		char *result = new char[strlen(mGameGoldBalance) + 1];
		strcpy(result, mGameGoldBalance);
		return result;
	}
	const char* getGameUnionName() {
		char *result = new char[strlen(mGameUnionName) + 1];
		strcpy(result, mGameUnionName);
		return result;
	}
};

class FuncellPayParams{
	const char *mItemName;//商品名称 ：60钻石
	const char *mItemId;//商品ID ：com.xx.item
	int mItemCount;//商品数量 ：60钻石，对应为60
	const char *mItemDescription;//商品描述
	int mItemAmount;//商品价格
	const char *mExtrasParams;//自定义透传参数
	const char *mItemType;//商品类型 ：-钻石- 元宝..
	const char *mOrderId;//游戏订单号
	RoleInfo *mRoleInfo;//用户角色信息
public:
	void setItemName(const char* ItemName) {
		mItemName = ItemName;
	}
	void setItemId(const char* ItemId) {
		mItemId = ItemId;
	}
	void setItemCount(const int ItemCount) {
		mItemCount = ItemCount;
	}
	void setItemDescription(const char* ItemDescription) {
		mItemDescription = ItemDescription;
	}
	void setItemAmount(const int ItemAmount) {
		mItemAmount = ItemAmount;
	}
	void setExtrasParams(const char* ExtrasParams) {
		mExtrasParams = ExtrasParams;
	}
	void setItemType(const char* ItemType) {
		mItemType = ItemType;
	}
	void setOrderId(const char* OrderId) {
		mOrderId = OrderId;
	}
	void setRoleInfo(RoleInfo* RoleInfo) {
		mRoleInfo = RoleInfo;
	}

	const char* getItemName() {
		char *result = new char[strlen(mItemName) + 1];
		strcpy(result, mItemName);
		return result;
	}
	const char* getItemId() {
		char *result = new char[strlen(mItemId) + 1];
		strcpy(result, mItemId);
		return result;
	}
	const int getItemCount() {
		return mItemCount;
	}
	const char* getItemDescription() {
		char *result = new char[strlen(mItemDescription) + 1];
		strcpy(result, mItemDescription);
		return result;
	}
	const int getItemAmount() {
		return mItemAmount;
	}
	const char* getExtrasParams() {
		char *result = new char[strlen(mExtrasParams) + 1];
		strcpy(result, mExtrasParams);
		return result;
	}
	const char* getItemType() {
		char *result = new char[strlen(mItemType) + 1];
		strcpy(result, mItemType);
		return result;
	}
	const char* getOrderId() {
		char *result = new char[strlen(mOrderId) + 1];
		strcpy(result, mOrderId);
		return result;
	}
	RoleInfo* getRoleInfo(){
		return mRoleInfo;
	}
};

/**
 * 支付回调
 */
class IFuncellPayCallBack {
public:
	virtual void onSuccess(char *cpOrder, char *sdkOrder,char *extrasParams) = 0;
	virtual void onFail(char *paramString) = 0;
	virtual void onCancel(char *paramString) = 0;
};

/**
 * 游戏退出回调
 */
class IFuncellExitCallBack {
public:
	virtual void onChannelExit() = 0;
	virtual void onGameExit() = 0;
};


enum FuncellDataTypes{
	DATA_LOGIN,DATA_CREATE_ROLE,DATA_ROLE_LEVELUP,DATA_SERVER_ROLE_INFO
};

class FuncellGameSdkProxy {
public:

	static void Init(IFuncellInitCallBack *initCallBack,
			IFuncellSessionCallBack *sessionCallBack,
			IFuncellPayCallBack *payCallBack);

	static void Login();

	static void Logout();

	static void Pay(FuncellPayParams *PayParams);

	static int GetExitUI();

	static void Exit(IFuncellExitCallBack *exitCallBack);

	static void SetDatas(FuncellDataTypes dataType,char *json);
};

}
#endif
