NIM 跨平台 C++ SDK
载入中...
搜索中...
未找到
nim_cpp_session.h
浏览该文件的文档.
1
7#ifndef _NIM_SDK_CPP_SESSION_H_
8#define _NIM_SDK_CPP_SESSION_H_
9
10#include <functional>
11#include <string>
19namespace nim {
20
27public:
29 typedef std::function<int32_t(const std::string&)> BadgeCountCallback;
31 typedef std::function<void(NIMResCode, const SessionData&, int)> ChangeCallback;
33 typedef std::function<void(int, const SessionDataList&)> QuerySessionListCallabck;
40 typedef std::function<void(NIMResCode, const std::list<SessionData>& session_data_list, int unread_count)>
44 typedef std::function<void(NIMResCode, const SessionData&)> QuerySessionDataCallback;
46 typedef std::function<void(const StickTopSession&)> SetToStickTopSessionNotifyCallback;
47 typedef std::function<void(const std::string& session_id, nim::NIMSessionType)>
51 typedef std::function<void(const StickTopSession&)> UpdateStickTopSessionNotifyCallback;
53 typedef std::function<void(NIMResCode, const StickTopSession&)> SetToStickTopSessionCallback;
54 typedef std::function<void(NIMResCode, const std::string& session_id, nim::NIMSessionType)>
58 typedef std::function<void(NIMResCode, const StickTopSession&)> UpdateStickTopSessionCallback;
61
62 typedef std::function<void(NIMResCode, const SessionRoamMsgHasMoreTagInfo& info)>
65 typedef std::function<void(NIMResCode, const std::list<SessionRoamMsgHasMoreTagInfo>& info_list)>
69 typedef std::function<void(NIMResCode)> UpdateHasmoreRoammsgCallback;
71 typedef std::function<void(NIMResCode)> DeleteHasmoreRoammsgCallback;
72 typedef std::function<void(NIMResCode, nim::NIMSessionType, const std::string& session_id)>
88 static void RegChangeCb(const ChangeCallback& cb, const std::string& json_extension = "");
89
99 static void RegBadgeCountCb(const BadgeCountCallback& cb, const std::string& json_extension = "");
100
108 static void QueryLastFewSessionAsync(int limit, const QuerySessionListCallabck& cb, const std::string& json_extension = "");
109
117 static void QueryAllRecentSessionAsync(const QuerySessionListCallabck& cb, const std::string& json_extension = "");
118
130 static void QueryAllRecentSessionAsnc(NIMMessageType last_msg_excluded_type,
131 const QuerySessionListCallabck& cb,
132 const std::string& json_extension = "");
133
144 static void QueryAllRecentSessionAsyncEx(const std::list<NIMMessageType>& last_msg_excluded_type,
145 const QuerySessionListCallabck& cb,
146 const std::string& json_extension = "");
147
162 static bool DeleteRecentSession(nim::NIMSessionType to_type,
163 const std::string& id,
165 const std::string& json_extension = "");
166
181 static bool DeleteRecentSessionEx(nim::NIMSessionType to_type, const std::string& id, const DeleteRecentSessionCallabck& cb, bool delete_roaming);
182
197 static bool DeleteSessionRoamingMessage(nim::NIMSessionType to_type,
198 const std::string& id,
200 const std::string& json_extension = "");
201
211 static void DeleteAllRecentSession(const DeleteAllRecentSessionCallabck& cb, const std::string& json_extension = "");
212
227 static bool SetUnreadCountZeroAsync(nim::NIMSessionType to_type,
228 const std::string& id,
230 const std::string& json_extension = "");
231
247 static bool SetMultiUnreadCountZeroAsync(bool super_team,
248 const std::list<MultiUnreadCountZeroInfo>& unread_zero_info_list,
250
267 static bool SetSessionTop(enum NIMSessionType to_type,
268 const std::string& id,
269 bool top,
270 const ChangeCallback& cb,
271 const std::string& json_extension = "");
272
289 static bool SetSessionExtendData(enum NIMSessionType to_type,
290 const std::string& id,
291 const std::string& data,
292 const ChangeCallback& cb,
293 const std::string& json_extension = "");
294
304 static bool SetAllUnreadCountZeroAsync(const SetUnreadCountZeroCallback& cb, const std::string& json_extension = "");
305
320 static void QuerySessionDataById(NIMSessionType to_type,
321 const std::string& id,
322 const QuerySessionDataCallback& cb,
323 const std::string& json_extension = "");
324
330 static void RegSetToStickTopSessionNotifyCB(const SetToStickTopSessionNotifyCallback& cb);
331
337 static void RegCancelStickTopSessionNotifyCB(const CancelStickTopSessionNotifyCallback& cb);
338
344 static void RegUpdateStickTopSessionNotifyCB(const UpdateStickTopSessionNotifyCallback& cb);
345
354 static void QueryStickTopSessionList(const QueryStickTopSessionListCallback& cb);
355
370 static void SetToStickTopSession(const std::string& session_id,
371 nim::NIMSessionType to_type,
372 const std::string& ext,
374
389 static void UpdateToStickTopSession(const std::string& session_id,
390 nim::NIMSessionType to_type,
391 const std::string& ext,
393
404 static void CancelToStickTopSession(const std::string& session_id, nim::NIMSessionType to_type, const CancelStickTopSessionCallback& cb);
405
418 static void QueryHasmoreRoammsg(const std::string& session_id, nim::NIMSessionType to_type, const QueryHasmoreRoammsgCallback& cb);
419
425 static void QueryAllHasmoreRoammsg(const QueryAllHasmoreRoammsgCallback& cb);
426
433 static void UpdateHasmoreRoammsg(const IMMessage& msg, const UpdateHasmoreRoammsgCallback& cb);
434
442 static void DeleteHasmoreRoammsg(const std::string& session_id, nim::NIMSessionType to_type, const DeleteHasmoreRoammsgCallback& cb);
443
448 static void UnregSessionCb();
449};
450
451} // namespace nim
452
453#endif //_NIM_SDK_CPP_SESSION_H_
会话列表管理功能,主要包括查询会话列表、删除会话列表等功能
Definition: nim_cpp_session.h:26
ChangeCallback DeleteAllRecentSessionCallabck
删除全部会话
Definition: nim_cpp_session.h:37
ChangeCallback SetUnreadCountZeroCallback
会话未读消息数清零回调
Definition: nim_cpp_session.h:39
std::function< void(const std::string &session_id, nim::NIMSessionType)> CancelStickTopSessionNotifyCallback
取消置顶会话通知回调
Definition: nim_cpp_session.h:49
ChangeCallback DeleteRecentSessionCallabck
删除会话回调
Definition: nim_cpp_session.h:35
std::function< void(int, const SessionDataList &)> QuerySessionListCallabck
查询会话列表回调
Definition: nim_cpp_session.h:33
std::function< void(const StickTopSession &)> UpdateStickTopSessionNotifyCallback
更新置顶会话通知回调
Definition: nim_cpp_session.h:51
std::function< int32_t(const std::string &)> BadgeCountCallback
app角标未读计数通知回调 (仅iOS有效)
Definition: nim_cpp_session.h:29
std::function< void(NIMResCode, nim::NIMSessionType, const std::string &session_id)> DeleteSessionRoammsgCallback
删除会话是漫游消息未拉取信息回调
Definition: nim_cpp_session.h:74
std::function< void(NIMResCode, const std::string &session_id, nim::NIMSessionType)> CancelStickTopSessionCallback
取消置顶会话回调
Definition: nim_cpp_session.h:56
std::function< void(NIMResCode, const std::list< SessionData > &session_data_list, int unread_count)> SetMultiUnreadCountZeroCallback
多条会话未读消息数清零回调
Definition: nim_cpp_session.h:42
std::function< void(NIMResCode, const StickTopSession &)> UpdateStickTopSessionCallback
更新置顶会话回调
Definition: nim_cpp_session.h:58
std::function< void(NIMResCode)> UpdateHasmoreRoammsgCallback
更新会话是漫游消息未拉取信息回调
Definition: nim_cpp_session.h:69
std::function< void(NIMResCode, const std::list< SessionRoamMsgHasMoreTagInfo > &info_list)> QueryAllHasmoreRoammsgCallback
查询所有“漫游消息未拉取完全”的会话的回调
Definition: nim_cpp_session.h:67
std::function< void(NIMResCode, const SessionData &)> QuerySessionDataCallback
会话信息查询结果回调
Definition: nim_cpp_session.h:44
std::function< void(NIMResCode)> DeleteHasmoreRoammsgCallback
删除会话是漫游消息未拉取信息回调
Definition: nim_cpp_session.h:71
std::function< void(NIMResCode, const SessionRoamMsgHasMoreTagInfo &info)> QueryHasmoreRoammsgCallback
查询会话的漫游消息是否拉取完整的回调
Definition: nim_cpp_session.h:64
std::function< void(NIMResCode, const StickTopSessionList &)> QueryStickTopSessionListCallback
查询置顶会话列表回调
Definition: nim_cpp_session.h:60
std::function< void(NIMResCode, const StickTopSession &)> SetToStickTopSessionCallback
置顶会话回调
Definition: nim_cpp_session.h:53
std::function< void(NIMResCode, const SessionData &, int)> ChangeCallback
会话变更通知回调
Definition: nim_cpp_session.h:31
std::function< void(const StickTopSession &)> SetToStickTopSessionNotifyCallback
置顶会话通知回调
Definition: nim_cpp_session.h:46
namespace nim
NIMMessageType
Definition: nim_msglog_def.h:301
定义导出宏
#define NIM_SDK_CPPWRAPPER_DLL_API
Definition: nim_sdk_cpp_wrapper.h:38
NIMSessionType
Definition: nim_session_def.h:16
Session 辅助方法和数据结构定义
Talk 辅助方法和数据结构定义
NIMResCode
Definition: public_defines.h:21
Definition: nim_session_def.h:58
Definition: nim_talk_helper.h:339
会话数据
Definition: nim_session_helper.h:49
会话列表数据
Definition: nim_session_helper.h:102
Definition: nim_session_helper.h:119
Definition: nim_session_helper.h:135