C++SDK  1.0.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_
NAMESPACE_TEE3_BEGIN typedef std::string String
Definition: common.h:10
String UserId
Definition: common.h:13
Definition: mchat.h:16
int Result
Definition: combase.h:13
UserId fromId
Definition: mchat.h:18
Definition: room.h:17
#define RT_API_EXPORT
Definition: defines.h:188
unsigned int uint32
Definition: defines.h:393
Definition: room.h:366
String fromName
Definition: mchat.h:19
uint32 timestamp
Definition: mchat.h:17
virtual ~IListener()
Definition: mchat.h:59
std::vector< Message > MessagesType
Definition: mchat.h:25
Definition: mchat.h:39
String message
Definition: mchat.h:20
Definition: audiocapture.h:5
virtual ~IMChat()
Definition: mchat.h:117
Definition: mchat.h:32