Blame view

LiveChat/SDK/include/gotye/Gotye.h 2.37 KB
9f17d59e   陈明泉   no message
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
  /****************************************************************************
   Copyright(c) 2013-2014, Shanghai AiLiao Information Technology Co.,Ltd
  
   http://www.gotye.com.cn
   
   @author:	liugan
   @date:		2014-06-20
   @version:	v3.0
   @filename:	Gotye.h
   @description:
   This header file includes some common macro definitions providing convenience
   for integration with GotyeAPI.
   Include "GotyeAPI.h" instead of this.
  ****************************************************************************/
  
  #ifndef __GOTYE_H__
  #define __GOTYE_H__
  
  #include <iostream>
  
  #include <ciso646>
  #ifdef _LIBCPP_VERSION
  #if _LIBCPP_VERSION>=1002 ///< libc++ version must be c++11
  #define GotyeFunction           std::function
  #else
  #error "libc++ version not support this api"
  #endif
  #else
  #if defined(WIN32)||defined(_WINPHONE)
  #include <functional>
  #else
  #include <tr1/functional>
  #endif
  
  #ifndef nullptr
  #define nullptr                 NULL
  #endif
  #define GotyeFunction           std::tr1::function
  #endif
  
  typedef GotyeFunction<void()>   GotyeFunc0;
  
  #define NS_GOTYEAPI_BEGIN       namespace gotyeapi {		///< gotyeapi namespace begin
  #define NS_GOTYEAPI_END         }							///< gotyeapi namespace end
  #define USING_NS_GOTYEAPI       using namespace gotyeapi	///< using namespace gotyeapi
  
  #define IIOS        ///< interface for iOS
  #define IANDROID    ///< interface for Android
  
  #define Optional                {}	///< mark interface as optional
  
  #define NETSTATE_OFFLINE        -1  ///< offline, API will reconnect when network becomes valid
  #define NETSTATE_BELOWLINE       0  ///< not login or logout already
  #define NETSTATE_ONLINE          1  ///< online
  
  #define	SYNCSUCCESS(stat)		(GotyeStatusCodeOK==(stat))					///< sync calling success
  #define	ASYNSUCCESS(stat)		(GotyeStatusCodeWaitingCallback==(stat))	///< async calling success
  
  #define apiist                  gotyeapi::GotyeAPI::getInstance() ///< get the instance of GotyeAPI
  
  #define REC_MAXDURATION			60000   ///< maximum recording duration(millisecond)
  #define REC_DEFAULTDURATION     10000   ///< default recording duration(millisecond)
  
  #define DEFAULT_COUNT           (10)    ///< default count of history message list
  
  #define SEX_IGNORE              (GotyeUserGender)(-1)   ///< ignore sex condition for searching users
  
  #define CSSTATUS_OFFLINE        (0)
  #define CSSTATUS_ONLINE         (1)
  #define CSSTATUS_BUSY           (2)
  
  
  #endif/* defined(__GOTYE_H__) */