floo2
bmx_user_service.h
1 //-------------------------------------------------------------------------------------------------
2 // File : bmx_user_service.h
3 // Author : Eric Liang <eric@bmxlabs.com>
4 // Purpose : bmx user service define file.
5 // Created : 12 Nov 2018 by Eric Liang <eric@bmxlabs.com>
6 //-------------------------------------------------------------------------------------------------
7 //
8 // Copyright (C) 2018-2019 MaxIM.Top
9 //
10 // You may obtain a copy of the licence at http://www.maxim.top/LICENCE-MAXIM.md
11 //
12 //-------------------------------------------------------------------------------------------------
13 
14 #ifndef bmx_user_service_h
15 #define bmx_user_service_h
16 
17 #include <functional>
18 #include "bmx_user_profile.h"
19 #include "bmx_device.h"
20 
21 namespace floo {
22 
23 class BMXUserServiceListener;
24 
28 class EXPORT_API BMXUserService {
29 public:
30  virtual ~BMXUserService() {}
31 
32  typedef std::function<void(int percent)> Callback;
33 
39  virtual BMXErrorCode bindDevice(const std::string& token) = 0;
45  virtual BMXErrorCode getDeviceList(BMXDeviceList& deviceList) = 0;
46 
52  virtual BMXErrorCode deleteDevice(int32_t device_sn) = 0;
53 
60  virtual BMXErrorCode getProfile(BMXUserProfilePtr& profile, bool forceRefresh) = 0;
61 
67  virtual BMXErrorCode setNickname(const std::string& nickname) = 0;
68 
75  virtual BMXErrorCode uploadAvatar(const std::string& avatarPath, Callback callback) = 0;
76 
84  virtual BMXErrorCode downloadAvatar(BMXUserProfilePtr profile, bool thumbnail = true, Callback callback = [](int){}) = 0;
85 
91  virtual BMXErrorCode setPublicInfo(const std::string& publicInfo) = 0;
92 
98  virtual BMXErrorCode setPrivateInfo(const std::string& privateInfo) = 0;
99 
105  virtual BMXErrorCode setAddFriendAuthMode(BMXUserProfile::AddFriendAuthMode mode) = 0;
106 
112  virtual BMXErrorCode setAuthQuestion(const BMXUserProfile::AuthQuestion& authQuestion) = 0;
113 
119  virtual BMXErrorCode setEnablePush(bool enable) = 0;
120 
126  virtual BMXErrorCode setEnablePushDetaile(bool enable) = 0;
127 
133  virtual BMXErrorCode setPushNickname(const std::string& nickname) = 0;
134 
140  virtual BMXErrorCode setPushAlias(const std::string& alias, const std::string& bmxPushToken) = 0;
141 
147  virtual BMXErrorCode setNotificationSound(bool enable) = 0;
148 
154  virtual BMXErrorCode setNotificationVibrate(bool enable) = 0;
155 
161  virtual BMXErrorCode setAutoDownloadAttachment(bool enable) = 0;
162 
168  virtual BMXErrorCode setAutoAcceptGroupInvite(bool enable) = 0;
169 
174  virtual void addUserListener(BMXUserServiceListener* listener) = 0;
175 
180  virtual void removeUserListener(BMXUserServiceListener* listener) = 0;
181 
182 protected:
183  BMXUserService() {}
184 };
185 
186 }
187 
188 #endif /* bmx_user_service_h */
用户Service
Definition: bmx_user_service.h:28
添加好友时的校验问题
Definition: bmx_user_profile.h:44
AddFriendAuthMode
对方申请加好友时的验证方式
Definition: bmx_user_profile.h:30
用户状态监听者
Definition: bmx_user_service_listener.h:27