IClientMessage.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*********************************************************************************
  2. *Author: Yongjun Zhao(赵永军)
  3. *Description:
  4. *History:
  5. Date: 2016.02.17/Yongjun Zhao
  6. Action:Create
  7. **********************************************************************************/
  8. #pragma once
  9. #include "XTypes.h"
  10. typedef struct SClientMessageInfo
  11. {
  12. UI_HANDLE hUser; // 消息接收者
  13. //URL = https://app.xmeye.net/advert?app=apptest&advertUse=logo1&imgWidth=1080&imgHeight=1920
  14. char serverIP[64]; // 默认:"app.xmeye.net"
  15. int nServerPort;
  16. char serverUrl[64]; // 比如:"/xmfamily/"(前后需要加分隔符'/',也可以多级目录)
  17. int bDownloadVideoAd;
  18. int bDownloadImageAd;
  19. // 缓存广告和保存临时文件,比如“/sdcard/myapp/adtemppath/”
  20. char tempFilePath[512];
  21. // 显示窗口的大小(一般为屏幕的宽、高)
  22. int nViewWidth;
  23. int nViewHeight;
  24. // 默认为简体中文,;目前支持简体中文、英两种语言;
  25. // 与本地翻译类型一样
  26. char language[32];
  27. char appId[64]; // Android的包名或IOS的Boundle Idtentifier
  28. char advertUse[64]; // 广告用途,如开机广告(字段在后台app设置广告的时候设值)
  29. SClientMessageInfo();
  30. }SClientMessageInfo;
  31. // 初始化函数
  32. int CM_Init(const SClientMessageInfo *pInfo);
  33. // 更新广告,自定义消息等(调用后会更新广告等到本地)
  34. void CM_UpdateMessage();
  35. // 获取视频广告路径,本地没有视频时没有返回""
  36. const char *CM_GetVideoPath();
  37. // 获取图片广告路径,本地没有图片时没有返回""
  38. const char *CM_GetPicPath();
  39. // 获取点击图片后跳转的URL
  40. const char *CM_GetADUrl();
  41. // 获取广告播放时长
  42. int CM_GetTimeLong();
  43. // 更新广告 版本2
  44. void CM_UpdateADV2();
  45. const char *CM_GetADContent();
  46. const char *CM_GetValue(const char *szKey, const char *szDefault = "");
  47. int CM_GetIntValue(const char *szKey, int nDelfault = 0);
  48. //////////////////////////系统消息功能接口/////////////////////////////
  49. // 更新当前最新的系统消息
  50. // < 0失败 >=0成功
  51. // 获取当前最新消息,EMSG_CM_ON_GET_SYS_MSG返回结果
  52. int CM_UpdateSysMsg(UI_HANDLE hUser);
  53. int CM_NoShowMsg(uint64 nMsgId); // 不再显示当前最新消息
  54. // 获取系统
  55. // < 0失败 >=0成功
  56. // 获取当前最新消息,EMSG_CM_ON_GET_SYS_MSG_LIST返回结果
  57. int CM_GetSysMsgList(UI_HANDLE hUser);
  58. /////////////////////////////////////////////////////////////////////