NIM PC Cross Platform SDK
nim_cpp_sysmsg.h
Go to the documentation of this file.
1
7#ifndef _NIM_SDK_CPP_SYSMSG_H_
8#define _NIM_SDK_CPP_SYSMSG_H_
9
10#include <functional>
11#include <list>
12#include <string>
16
21namespace nim {
22
26class NIM_SDK_CPPWRAPPER_DLL_API SystemMsg {
27public:
29 typedef std::function<void(const SysMessage&)> ReceiveSysmsgCallback;
31 typedef std::function<void(const SendMessageArc&)> SendCustomSysmsgCallback;
33 typedef std::function<void(int, int, const std::list<SysMessage>&)> QueryMsgCallback;
35 typedef std::function<void(NIMResCode res_code, int unread_count)> NotifySysmsgResCallback;
45 typedef std::function<void(NIMResCode, int64_t, int)> NotifySingleSysmsgCallback;
50
58 static void RegSysmsgCb(const ReceiveSysmsgCallback& cb, const std::string& json_extension = "");
59
67 static void RegSendCustomSysmsgCb(const SendCustomSysmsgCallback& cb, const std::string& json_extension = "");
68
74 static void SendCustomNotificationMsg(const std::string& json_msg);
75
91 static std::string CreateCustomNotificationMsg(const std::string& receiver_id,
92 const NIMSysMsgType type,
93 const std::string& client_msg_id,
94 const std::string& content,
95 const SysMessageSetting& msg_setting,
96 int64_t timetag = 0);
97
106 static bool QueryMsgAsync(int limit_count, int64_t last_time, const QueryMsgCallback& cb, const std::string& json_extension = "");
107
115 static void QueryUnreadCount(const QuerySysmsgUnreadCallback& cb, const std::string& json_extension = "");
116
130 static bool SetStatusAsync(int64_t msg_id, nim::NIMSysMsgStatus status, const SetStatusCallback& cb, const std::string& json_extension = "");
131
140 static void ReadAllAsync(const ReadAllCallback& cb, const std::string& json_extension = "");
141
151 static bool DeleteAsync(int64_t msg_id, const DeleteCallback& cb, const std::string& json_extension = "");
152
161 static void DeleteAllAsync(const DeleteAllCallback& cb, const std::string& json_extension = "");
162
176 static void SetStatusByTypeAsync(NIMSysMsgType type, NIMSysMsgStatus status, const BatchSetCallback& cb, const std::string& json_extension = "");
177
187 static void DeleteByTypeAsync(NIMSysMsgType type, const BatchSetCallback& cb, const std::string& json_extension = "");
188
193 static void UnregSysmsgCb();
194};
195
196} // namespace nim
197
198#endif //_NIM_SDK_CPP_SYSMSG_H_
系统消息接口;主要包括查询系统消息、删除系统消息等功能
Definition: nim_cpp_sysmsg.h:26
NotifySysmsgResCallback QuerySysmsgUnreadCallback
查询系统消息自定义通知未读数回调模板
Definition: nim_cpp_sysmsg.h:37
NotifySysmsgResCallback BatchSetCallback
批量调整系统消息自定义通知回调模板
Definition: nim_cpp_sysmsg.h:43
std::function< void(NIMResCode res_code, int unread_count)> NotifySysmsgResCallback
修改系统消息自定义通知回调模板
Definition: nim_cpp_sysmsg.h:35
std::function< void(int, int, const std::list< SysMessage > &)> QueryMsgCallback
查询系统消息自定义通知回调模板
Definition: nim_cpp_sysmsg.h:33
std::function< void(NIMResCode, int64_t, int)> NotifySingleSysmsgCallback
修改(单条)系统消息自定义通知回调模板
Definition: nim_cpp_sysmsg.h:45
NotifySysmsgResCallback ReadAllCallback
设置系统消息自定义通知已读状态回调模板
Definition: nim_cpp_sysmsg.h:39
std::function< void(const SysMessage &)> ReceiveSysmsgCallback
收到自定义通知回执回调模板
Definition: nim_cpp_sysmsg.h:29
std::function< void(const SendMessageArc &)> SendCustomSysmsgCallback
发送自定义通知回调模板
Definition: nim_cpp_sysmsg.h:31
NotifySysmsgResCallback DeleteAllCallback
删除全部系统消息自定义通知回调模板
Definition: nim_cpp_sysmsg.h:41
NotifySingleSysmsgCallback SetStatusCallback
设置系统消息自定义通知状态回调模板
Definition: nim_cpp_sysmsg.h:47
NotifySingleSysmsgCallback DeleteCallback
删除系统消息自定义通知回调模板
Definition: nim_cpp_sysmsg.h:49
namespace nim
NIMResCode
Definition: nim_chatroom_res_code_def.h:15
Message 通用辅助方法和数据结构定义
定义导出宏
NIMSysMsgStatus
Definition: nim_sysmsg_def.h:159
NIMSysMsgType
Definition: nim_sysmsg_def.h:175
sysmsg 辅助方法和数据结构定义
发送消息回执
Definition: nim_msg_helper.h:24
系统消息和自定义通知数据
Definition: nim_sysmsg_helper.h:103
系统消息和自定义通知属性设置
Definition: nim_sysmsg_helper.h:23