cn.tee3.avd_SDK-C++  2.1.0
mchat.h
浏览该文件的文档.
1 #ifndef RT_Chat_H_
2 #define RT_Chat_H_
3 
4 #include "common.h"
5 #include "room.h"
6 
7 namespace tee3 {
8  namespace avd {
9  class IRoom;
10 
16  struct Message {
21  };
25  typedef std::vector<Message> MessagesType;
26 
32  class RT_API_EXPORT IMChat : public IModule {
33  public:
39  class IListener {
40  public:
42 
49  virtual void onPublicMessage(const Message& message) = 0;
57  virtual void onPrivateMessage(const Message& message) = 0;
58  protected:
59  virtual ~IListener() {
60  }
61  };
62 
69  static IMChat* getChat(IRoom* room);
70 
77  virtual Result setListener(IListener* listener) = 0;
84  virtual Result sendPublicMessage(const String& message) = 0;
92  virtual Result sendPrivateMessage(const String& message, const UserId& toId) = 0;
93 
103  virtual Result getPublicHistoryMessage(bool latest, uint32 begindex, uint32& ncount, MessagesType& msgs) = 0;
114  virtual Result getPrivateHistoryMessage(const UserId& userId, bool latest, uint32 begindex, uint32& ncount, MessagesType& msgs) = 0;
115 
116  protected:
117  virtual ~IMChat() {
118  }
119  };
120 
121  } // namespace avd
122 } // namespace tee3
123 #endif//RT_Chat_H_
String message
消息内容
Definition: mchat.h:20
String UserId
用户号类型,唯一标识房间内一个用户,长度不大于Max_UserId定义;由应用层定义传递给AVD SDK,要求保证房间...
Definition: common.h:13
int Result
返回值类型
Definition: combase.h:9
uint32 timestamp
消息时间戳,对应用层是本地时间,传输中用GMT时间
Definition: mchat.h:17
#define RT_API_EXPORT
Definition: defines.h:186
房间模块接口类
Definition: room.h:349
unsigned int uint32
Definition: defines.h:391
String fromName
消息发送者名
Definition: mchat.h:19
std::string String
tee3定义的String类型
Definition: common.h:10
房间中聊天模块回调接口.
Definition: mchat.h:39
virtual ~IListener()
Definition: mchat.h:59
UserId fromId
消息发送者Id
Definition: mchat.h:18
房间接口类
Definition: room.h:17
聊天消息结构.
Definition: mchat.h:16
std::vector< Message > MessagesType
聊天消息列表类型.
Definition: mchat.h:25
房间中聊天模块接口.
Definition: mchat.h:32
Definition: audiocapture.h:5
virtual ~IMChat()
Definition: mchat.h:117