rtc.avd_SDK-C++  3.2.0
mremotectrl.h
浏览该文件的文档.
1 #ifndef RT_REMOTE_CTRL_H_
2 #define RT_REMOTE_CTRL_H_
3 
4 #include "common.h"
5 #include "room.h"
6 
7 namespace rtc {
8 
9 #define REMOTE_READY 0
10 #define REMOTE_RESULT_SUCCESS 1
11 #define REMOTE_RESULT_FAIL 2
12 #define REMOTE_RESULT_WAITING 3
13 #define REMOTE_MOD_CONTRL 10
15 #define REMOTE_MOD_CONTROL_END 11
16 #define REMOTE_MOD_ALL 12
17 
18 #define REMOTE_ROLER_CONTROLLER 1000
20 #define REMOTE_ROLER_BE_CONTROLLED 1001
21 
22 #define REMOTE_REQUEST_CONTROL 1002
24 #define REMOTE_REQUEST_NO_CONTROL 1003
25 #define REMOTE_RESPON_ACCEPT REMOTE_RESULT_SUCCESS
27 #define REMOTE_RESPON_REJECT REMOTE_RESULT_FAIL
28 #define REMOTE_RESPON_REJECT_APLLAYING 1005
29 
30 #define REMOTE_STATUS_CONTROL_OTHER 2003
32 #define REMOTE_STATUS_CONTROL_BY_OTHER 2004
33 
34 #define REMOTE_PUBLISH_SCREEN 3000
36 #define REMOTE_ATTACH_SCREEN 3001
37 
38 #define REMOTE_INVITE_TIMEOUT 4000
40 #define REMOTE_APPLY_TIMEOUT 4001
41 
42 
44  std::string pubScreenuserId;
45  int screentSt;
46  int width;
47  int height;
49 
50  };
51  struct RemoteInfo{
52  std::string controllerUserId;
53  std::string beControledUserId;
54  std::string attachuserid;
57  int remtest;
59  clear();
60  }
61  void clear(){
62  controllerUserId.clear();
63  beControledUserId.clear();
64  attachuserid.clear();
65  iscontroller = false;
67  }
68  };
69 
70 }
71 namespace rtc {
72 
73 
74  class IRemoteCtrllor;
75  class IRemoteEnd;
77  public:
78  class IListener {
79  public:
80  virtual ~IListener() {
81  }
82  };
83  static IRemoteCtrl* getRemoteCtrlModule(IRoom* room);
84  virtual void setRemoteMode(int mode) = 0;
85  virtual int getRemoteMode() = 0;
86  virtual IRemoteCtrllor* getCtrollor() = 0;
87  virtual IRemoteEnd* getRemoteEnd() = 0;
88  virtual Result setListener(IListener* listen) = 0;
89  virtual ~IRemoteCtrl() {}
90  };
93  public:
94  class IListener {
95  public:
103  virtual void onApplyCtrlResult(std::string fromuserid, std::string touserid, Result rv) = 0;
111  virtual void onCancelCtrlResult(std::string fromuserid, std::string touserid, Result rv) = 0;
118  virtual void onStopCtrlbyControlEnd(std::string controluid, std::string controlendId) = 0;
119 
127  virtual void onInvitNotify(std::string contruid, std::string conendId, int rt) = 0;
128 
129  protected:
130  virtual ~IListener() {
131  }
132  };
133 
134  virtual Result setListener(IRemoteCtrllor::IListener* listener) = 0;
135 
141  virtual Result ApplyCtrl(std::string controledUserId) = 0;
142 
148  virtual Result CancelCtrl(std::string controledUserId) = 0;
149 
154  virtual int getCurStauts() = 0;
155 
160  virtual int getRole() = 0;
161 
166  virtual std::string getToken() = 0;
167 
177  virtual Result SendMouseCmd(int mousetype, int xpos, int ypos, int wndwidth, int wndheight, std::string touserId = "") = 0;
178 
185  virtual Result SendKeyBoardCmd(std::vector<uint32> ctrlkey, std::vector<uint32> keyvalue, std::string touserId = "") = 0;
186 
191  virtual void clearStatus() = 0;
192 
193  /*获取远程控制的信息
194  *note 获取相关控制的信息
195  */
196  virtual RemoteInfo getRemoteInfo() = 0;
197  virtual ~IRemoteCtrllor() {
198  }
199  };
200 
203  public:
204  class IListener {
205  public:
213  virtual void onApplyCtrlNotify(std::string fromuserid, std::string touserid,int st) = 0;
214 
222  virtual void onCancelCtrlNotify(std::string fromuserid, std::string touserid, int st) = 0;
223 
231  virtual void onInvitResult(std::string contruid, std::string conendId, int st) = 0;
232 
233  protected:
234  virtual ~IListener() {
235  }
236  };
237 
238  virtual Result setListener(IRemoteEnd::IListener* listener) = 0;
239 
246  virtual Result DoApplyCtrl(std::string fromuserid,int rt) = 0;
247 
254  virtual Result DoCancelCtrl(std::string fromuserid, int rt) = 0;
255 
260  virtual Result terminalCtrl() = 0;
266  virtual void SetPubScreenInfo(int top, int left, int width, int height) = 0;
267 
272  virtual int getCurStauts() = 0;
273 
278  virtual int getRole() = 0;
279 
283  virtual std::string getToken() = 0;
284 
290  virtual Result controllerLeave(std::string userid) = 0;
291 
296  virtual Result InviteController(std::string ctrluserid) = 0;
297 
301  virtual void clearStatus() = 0;
302 
303  /*获取远程控制的信息
304  *
305  */
306  virtual RemoteInfo getRemoteInfo() = 0;
307  virtual ~IRemoteEnd(){}
308  };
309 
310 } // namespace rtc
311 #endif//RT_REMOTE_CTRL_H_
virtual ~IRemoteCtrl()
Definition: mremotectrl.h:89
Definition: annotationobject.h:71
Definition: mremotectrl.h:76
Definition: mremotectrl.h:51
virtual ~IListener()
Definition: mremotectrl.h:130
void clear()
Definition: mremotectrl.h:61
int width
Definition: mremotectrl.h:46
int Result
返回值类型
Definition: combase.h:13
房间模块接口类
Definition: room.h:382
#define RT_API_EXPORT
Definition: defines.h:216
int height
Definition: mremotectrl.h:47
ContrllerEndScreenInfo()
Definition: mremotectrl.h:48
int remtest
Definition: mremotectrl.h:57
Definition: mremotectrl.h:202
int screentSt
Definition: mremotectrl.h:45
Definition: mremotectrl.h:204
std::string beControledUserId
Definition: mremotectrl.h:53
virtual ~IListener()
Definition: mremotectrl.h:234
Definition: mremotectrl.h:94
#define REMOTE_READY
Definition: mremotectrl.h:9
virtual ~IListener()
Definition: mremotectrl.h:80
房间接口类
Definition: room.h:16
RemoteInfo()
Definition: mremotectrl.h:58
std::string controllerUserId
Definition: mremotectrl.h:52
virtual ~IRemoteEnd()
Definition: mremotectrl.h:307
std::string pubScreenuserId
Definition: mremotectrl.h:44
bool iscontroller
Definition: mremotectrl.h:55
Definition: mremotectrl.h:78
ContrllerEndScreenInfo remoteScreenInfo
Definition: mremotectrl.h:56
Definition: mremotectrl.h:43
std::string attachuserid
Definition: mremotectrl.h:54
Definition: mremotectrl.h:92
virtual ~IRemoteCtrllor()
Definition: mremotectrl.h:197