18 #ifndef __easemob__emconversation__ 19 #define __easemob__emconversation__ 24 #include "message/emmessage.h" 25 #include "embaseobject.h" 30 class EMConversationPrivate;
31 class EMConversationManager;
73 const std::string& conversationId()
const;
81 EMConversationType conversationType ()
const;
90 bool removeMessage(
const std::string &msgId);
100 bool removeMessage(
const EMMessagePtr msg);
110 bool insertMessage(
const EMMessagePtr msg);
120 bool appendMessage(
const EMMessagePtr msg);
130 bool updateMessage(
const EMMessagePtr msg);
138 bool clearAllMessages();
147 bool markMessageAsRead(
const std::string &msgId,
bool isRead =
true);
155 bool markAllMessagesAsRead(
bool isRead =
true);
163 int unreadMessagesCount()
const;
171 int messagesCount()
const;
179 EMMessagePtr loadMessage(
const std::string &msgId)
const;
187 EMMessagePtr latestMessage()
const;
195 EMMessagePtr latestMessageFromOthers()
const;
209 EMMessageList loadMoreMessages(
const std::string &refMsgId,
int count, EMMessageSearchDirection direction = UP);
220 EMMessageList loadMoreMessages(int64_t timeStamp,
int count, EMMessageSearchDirection direction = UP);
233 EMMessageList loadMoreMessages(EMMessageBody::EMMessageBodyType type, int64_t timeStamp = -1,
int count = -1,
const std::string &from =
"", EMMessageSearchDirection direction = UP);
246 EMMessageList loadMoreMessages(
const std::string& keywords, int64_t timeStamp = -1,
int count = -1,
const std::string &from =
"", EMMessageSearchDirection direction = UP);
259 EMMessageList loadMoreMessages(int64_t startTimeStamp, int64_t endTimeStamp,
int maxCount);
267 const std::string& extField()
const;
275 bool setExtField(
const std::string &ext);
277 friend EMConversationManager;
278 friend EMChatManager;
290 EMConversation(
const std::string &conversationId, EMConversationType type,
const std::string& ext =
"");
298 EMConversationPrivate *mPrivate;
301 typedef std::shared_ptr<EMConversation> EMConversationPtr;
302 typedef std::vector<EMConversationPtr> EMConversationList;
EMConversationType
Definition: emconversation.h:42
EMMessageSearchDirection
Definition: emconversation.h:53
Definition: emconversation.h:35
Definition: emattributevalue.h:28
Definition: embaseobject.h:28