app.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // Tencent is pleased to support the open source community by making Mars available.
  2. // Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved.
  3. // Licensed under the MIT License (the "License"); you may not use this file except in
  4. // compliance with the License. You may obtain a copy of the License at
  5. // http://opensource.org/licenses/MIT
  6. // Unless required by applicable law or agreed to in writing, software distributed under the License is
  7. // distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  8. // either express or implied. See the License for the specific language governing permissions and
  9. // limitations under the License.
  10. /*
  11. * appcomm.h
  12. *
  13. * Created on: 2016年3月3日
  14. * Author: caoshaokun
  15. */
  16. #ifndef APPCOMM_INTERFACE_APPCOMM_H_
  17. #define APPCOMM_INTERFACE_APPCOMM_H_
  18. #include <string>
  19. #include <stdint.h>
  20. #include "mars/comm/comm_data.h"
  21. namespace mars {
  22. namespace app {
  23. struct AccountInfo {
  24. AccountInfo():uin(0), is_logoned(false){}
  25. int64_t uin;
  26. std::string username;
  27. bool is_logoned;
  28. };
  29. typedef enum {
  30. PlatformType_UNSET = 0,
  31. PlatformType_iOS = 1,
  32. PlatformType_Android = 2,
  33. PlatformType_Windows = 3,
  34. PlatformType_OSX = 4,
  35. PlatformType_WEB = 5
  36. } PlatformType;
  37. struct DeviceInfo {
  38. //clientid
  39. std::string clientid;
  40. //platform ios/android/web/osx/windows etc
  41. PlatformType platform;
  42. std::string packagename;
  43. int pushtype;
  44. //设备型号
  45. std::string device;
  46. //设备版本号
  47. std::string deviceversion;
  48. //设备名称 某某的iphone
  49. std::string phonename;
  50. std::string language;
  51. std::string carriername;
  52. std::string appversion;
  53. std::string sdkversion;
  54. };
  55. extern mars::comm::ProxyInfo GetProxyInfo(const std::string& _host);
  56. extern std::string GetAppFilePath();
  57. extern AccountInfo GetAccountInfo();
  58. extern std::string GetUserName();
  59. extern std::string GetRecentUserName();
  60. extern unsigned int GetClientVersion();
  61. extern DeviceInfo GetDeviceInfo();
  62. }}
  63. #endif /* APPCOMM_INTERFACE_APPCOMM_H_ */