NIM CPP SDK  8.0.0
nim_cpp_talkex.h
Go to the documentation of this file.
1 
7 #ifndef _NIM_SDK_CPP_TALKEX_H_
8 #define _NIM_SDK_CPP_TALKEX_H_
9 
10 #include <string>
11 #include <functional>
12 #include "src/cpp_sdk/nim/helper/nim_talk_helper.h"
13 #include "src/cpp_sdk/nim/helper/nim_talkex_helper_collect.h"
14 #include "src/cpp_sdk/nim/helper/nim_talkex_helper_quick_comment.h"
15 #include "src/cpp_sdk/nim/helper/nim_talkex_helper_pin_message.h"
16 #include "src/cpp_sdk/nim/nim_sdk_cpp_wrapper_dll.h"
21 namespace nim
22 {
23 
27  class NIM_SDK_CPPWRAPPER_DLL_API TalkEx
28  {
29  public:
30  class NIM_SDK_CPPWRAPPER_DLL_API Collect
31  {
32  public:
33  using AddCollectCallback = std::function<void(int code, const CollectInfo&)>;
34  using RemoveCollectsCallback = std::function<void(int code, int count)>;
35  using UpdateCollectCallback = std::function<void(int, const CollectInfo&)>;
36  using QueryCollectsCallback = std::function<void(int, int,const CollectInfoList&)>;
43  static void AddCollect(const CollectInfo& collect_info, const AddCollectCallback& cb);
50  static void RemoveCollects(const RemoveCollectsParm& collect_list, const RemoveCollectsCallback& cb);
58  static void UpdateCollectExt(const MatchCollectParm& collect_match_param, const std::string& ext, const UpdateCollectCallback& cb);
65  static void QueryCollectList(const QueryCollectsParm& query_collect_list_param, const QueryCollectsCallback& cb);
66  };
67  class NIM_SDK_CPPWRAPPER_DLL_API QuickComment
68  {
69  public:
70  using AddQuickCommentCallback = std::function < void(int, const QuickCommentInfo&)>;
71  using RemoveQuickCommentCallback = std::function < void(int, const std::string& id)>;
72  using QueryQuickCommentCallback = std::function<void(int, const QueryQuickCommentsResponse&)>;
74  std::function<void( const std::string & session, NIMSessionType type,\
75  const std::string & msg_client_id, \
76  const QuickCommentInfo&)>;
78  std::function<void( const std::string&session,NIMSessionType type,\
79  const std::string& msg_client_id,\
80  const std::string& quick_comment_id,\
81  const std::string& ext)>;
87  static void UnregAllCb();
93  static void RegAddQuickCommentNotify(const AddQuickCommentNotifyCallback& cb);
94 
100  static void RegRemoveQuickCommentNotify(const RemoveQuickCommentNotifyCallback& cb);
101 
109  static void AddQuickComment(const IMMessage &msg, const QuickCommentInfo& info,const AddQuickCommentCallback& cb);
117  static void RemoveQuickComment(const IMMessage& msg, const RemoveQuickCommentParam& param, const RemoveQuickCommentCallback& cb);
118 
125  static void QueryQuickCommentList(const QueryQuickCommentsParam& query_param, const QueryQuickCommentCallback& cb);
126  };
127  class NIM_SDK_CPPWRAPPER_DLL_API PinMsg
128  {
129  public:
130  using PinMessageCallback = std::function<void(int code, const std::string& session, int to_type, const PinMessageInfo&)>;
131  using UnPinMessageCallback = std::function<void(int code, const std::string& session, int to_type, const std::string&)>;
132  using UpdatePinMessageCallback = std::function<void(int code, const std::string & session, int to_type, const PinMessageInfo&)>;
133  using QueryPinMessageCallback = std::function<void(int code, const std::string & session, int to_type, const QueryAllPinMessageResponse&)>;
134  using AddPinMessageNotifyCallback = std::function<void( const std::string & session, int to_type, const PinMessageInfo&)>;
135  using UnPinMessageNotifyCallback = std::function<void(const std::string& session, int to_type, const std::string& id)>;
136  using UpdatePinMessageNotifyCallback = std::function<void(const std::string & session, int to_type, const PinMessageInfo&)>;
144  static void AddPinMessage(const IMMessage& msg,const PinMessageInfo& pin_info, const PinMessageCallback& cb);
145 
152  static void UnPinMessage(const ModifyPinMessageParam& modify_param, const UnPinMessageCallback& cb);
153 
160  static void UpdatePinMessage(const ModifyPinMessageParam& modify_param, const UpdatePinMessageCallback& cb);
161 
169  static void QueryAllPinMessage(const std::string& session,int to_type, const QueryPinMessageCallback& cb);
170 
175  static void UnregAllCb();
176 
182  static void RegAddPinMessage(const AddPinMessageNotifyCallback& cb);
183 
189  static void RegUnPinMessage(const UnPinMessageNotifyCallback& cb);
190 
196  static void RegUpdatePinMessage(const UpdatePinMessageNotifyCallback& cb);
197  };
198  };
199 }
200 
201 #endif //_NIM_SDK_CPP_TALKEX_H_
nim::TalkEx::Collect::QueryCollectsCallback
std::function< void(int, int, const CollectInfoList &)> QueryCollectsCallback
Definition: nim_cpp_talkex.h:36
nim::TalkEx::QuickComment::AddQuickCommentNotifyCallback
std::function< void(const std::string &session, NIMSessionType type, const std::string &msg_client_id, const QuickCommentInfo &)> AddQuickCommentNotifyCallback
Definition: nim_cpp_talkex.h:76
nim::TalkEx::QuickComment::RemoveQuickCommentNotifyCallback
std::function< void(const std::string &session, NIMSessionType type, const std::string &msg_client_id, const std::string &quick_comment_id, const std::string &ext)> RemoveQuickCommentNotifyCallback
Definition: nim_cpp_talkex.h:81
nim::TalkEx::Collect::AddCollectCallback
std::function< void(int code, const CollectInfo &)> AddCollectCallback
Definition: nim_cpp_talkex.h:33
nim::TalkEx::Collect::UpdateCollectCallback
std::function< void(int, const CollectInfo &)> UpdateCollectCallback
Definition: nim_cpp_talkex.h:35
nim::TalkEx::PinMsg
Definition: nim_cpp_talkex.h:127
nim::TalkEx
聊天功能;主要包括收藏、快捷回复、PinMessage、ThreadMessage、置顶会话
Definition: nim_cpp_talkex.h:27
nim::TalkEx::Collect::RemoveCollectsCallback
std::function< void(int code, int count)> RemoveCollectsCallback
Definition: nim_cpp_talkex.h:34
nim::TalkEx::QuickComment
Definition: nim_cpp_talkex.h:67
nim::CollectInfoList
收藏列表
Definition: nim_talkex_helper_collect.h:38
nim::QueryAllPinMessageResponse
查询Pin Message应答参数定义
Definition: nim_talkex_helper_pin_message.h:58
nim
namespace nim
Definition: callback_proxy.h:11
nim::QueryQuickCommentsParam
查询快捷回复参数定义
Definition: nim_talkex_helper_quick_comment.h:56
nim::QueryCollectsParm
分页查询收藏列表参数
Definition: nim_talkex_helper_collect.h:74
nim::QuickCommentInfo
快捷回复属性
Definition: nim_talkex_helper_quick_comment.h:26
nim::RemoveQuickCommentParam
删除快捷回复参数定义
Definition: nim_talkex_helper_quick_comment.h:47
nim::TalkEx::QuickComment::QueryQuickCommentCallback
std::function< void(int, const QueryQuickCommentsResponse &)> QueryQuickCommentCallback
Definition: nim_cpp_talkex.h:72
nim::TalkEx::Collect
Definition: nim_cpp_talkex.h:30
nim::RemoveCollectsParm
收藏内容参数
Definition: nim_talkex_helper_collect.h:54
nim::MatchCollectParm
收藏匹配参数
Definition: nim_talkex_helper_collect.h:45
nim::TalkEx::QuickComment::RemoveQuickCommentCallback
std::function< void(int, const std::string &id)> RemoveQuickCommentCallback
Definition: nim_cpp_talkex.h:71
NIMSessionType
NIMSessionType
Definition: nim_session_def.h:17
nim::QueryQuickCommentsResponse
查询快捷回复参数定义
Definition: nim_talkex_helper_quick_comment.h:75
nim::CollectInfo
收藏内容属性
Definition: nim_talkex_helper_collect.h:24
nim::ModifyPinMessageParam
修改、取消Pin Message参数定义
Definition: nim_talkex_helper_pin_message.h:48
nim::PinMessageInfo
Pin消息属性
Definition: nim_talkex_helper_pin_message.h:26
nim::IMMessage
Definition: nim_talk_helper.h:236
nim::TalkEx::QuickComment::AddQuickCommentCallback
std::function< void(int, const QuickCommentInfo &)> AddQuickCommentCallback
Definition: nim_cpp_talkex.h:70