C++SDK  1.0.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 tee3{
8  namespace avd{
9 
10 #define REMOTE_READY 0
11 #define REMOTE_RESULT_SUCCESS 1
12 #define REMOTE_RESULT_FAIL 2
13 #define REMOTE_RESULT_WAITING 3
14 #define REMOTE_MOD_CONTRL 10
16 #define REMOTE_MOD_CONTROL_END 11
17 #define REMOTE_MOD_ALL 12
18 
19 #define REMOTE_ROLER_CONTROLLER 1000
21 #define REMOTE_ROLER_BE_CONTROLLED 1001
22 
23 #define REMOTE_REQUEST_CONTROL 1002
25 #define REMOTE_REQUEST_NO_CONTROL 1003
26 #define REMOTE_RESPON_ACCEPT REMOTE_RESULT_SUCCESS
28 #define REMOTE_RESPON_REJECT REMOTE_RESULT_FAIL
29 #define REMOTE_RESPON_REJECT_APLLAYING 1005
30 
31 #define REMOTE_STATUS_CONTROL_OTHER 2003
33 #define REMOTE_STATUS_CONTROL_BY_OTHER 2004
34 
35 #define REMOTE_PUBLISH_SCREEN 3000
37 #define REMOTE_ATTACH_SCREEN 3001
38 
39 #define REMOTE_INVITE_TIMEOUT 4000
41 #define REMOTE_APPLY_TIMEOUT 4001
42 
43 
45  std::string pubScreenuserId;
46  int screentSt;
47  int width;
48  int height;
49  ContrllerEndScreenInfo() :screentSt(REMOTE_READY), width(0), height(0){}
50 
51  };
52  struct RemoteInfo{
53  std::string controllerUserId;
54  std::string beControledUserId;
55  std::string attachuserid;
58  int remtest;
60  clear();
61  }
62  void clear(){
63  controllerUserId.clear();
64  beControledUserId.clear();
65  attachuserid.clear();
66  iscontroller = false;
67  remtest = REMOTE_READY;
68  }
69  };
70  }
71 }
72 namespace tee3 {
73  namespace avd {
74 
75  class IRemoteCtrllor;
76  class IRemoteEnd;
78  public:
79  class IListener{
80  public:
81  virtual ~IListener() {
82  }
83  };
84  static IRemoteCtrl* getRemoteCtrlModule(IRoom* room);
85  virtual void setRemoteMode(int mode) = 0;
86  virtual int getRemoteMode() = 0;
87  virtual IRemoteCtrllor* getCtrollor() = 0;
88  virtual IRemoteEnd* getRemoteEnd() = 0;
89  virtual Result setListener(IListener* listen) = 0;
90  virtual ~IRemoteCtrl(){}
91  };
94  public:
95  class IListener {
96  public:
104  virtual void onApplyCtrlResult(std::string fromuserid,std::string touserid,Result rv) = 0;
112  virtual void onCancelCtrlResult(std::string fromuserid, std::string touserid, Result rv) = 0;
119  virtual void onStopCtrlbyControlEnd(std::string controluid, std::string controlendId) = 0;
120 
128  virtual void onInvitNotify(std::string contruid, std::string conendId, int rt) = 0;
129 
130  protected:
131  virtual ~IListener() {
132  }
133  };
134 
135  virtual Result setListener(IRemoteCtrllor::IListener* listener) = 0;
136 
142  virtual Result ApplyCtrl(std::string controledUserId) = 0;
143 
149  virtual Result CancelCtrl(std::string controledUserId) = 0;
150 
155  virtual int getCurStauts() = 0;
156 
161  virtual int getRole() = 0;
162 
167  virtual std::string getToken() = 0;
168 
178  virtual Result SendMouseCmd(int mousetype, int xpos, int ypos, int wndwidth, int wndheight, std::string touserId = "") = 0;
179 
186  virtual Result SendKeyBoardCmd(std::vector<uint32> ctrlkey, std::vector<uint32> keyvalue, std::string touserId = "") = 0;
187 
192  virtual void clearStatus() = 0;
193 
194  /*获取远程控制的信息
195  *note 获取相关控制的信息
196  */
197  virtual RemoteInfo getRemoteInfo() = 0;
198  virtual ~IRemoteCtrllor() {
199  }
200  };
201 
204  public:
205  class IListener {
206  public:
214  virtual void onApplyCtrlNotify(std::string fromuserid, std::string touserid,int st) = 0;
215 
223  virtual void onCancelCtrlNotify(std::string fromuserid, std::string touserid, int st) = 0;
224 
232  virtual void onInvitResult(std::string contruid, std::string conendId, int st) = 0;
233 
234  protected:
235  virtual ~IListener() {
236  }
237  };
238 
239  virtual Result setListener(IRemoteEnd::IListener* listener) = 0;
240 
247  virtual Result DoApplyCtrl(std::string fromuserid,int rt) = 0;
248 
255  virtual Result DoCancelCtrl(std::string fromuserid, int rt) = 0;
256 
261  virtual Result terminalCtrl() = 0;
267  virtual void SetPubScreenInfo(int top, int left, int width, int height) = 0;
268 
273  virtual int getCurStauts() = 0;
274 
279  virtual int getRole() = 0;
280 
284  virtual std::string getToken() = 0;
285 
291  virtual Result controllerLeave(std::string userid) = 0;
292 
297  virtual Result InviteController(std::string ctrluserid) = 0;
298 
302  virtual void clearStatus() = 0;
303 
304  /*获取远程控制的信息
305  *
306  */
307  virtual RemoteInfo getRemoteInfo() = 0;
308  virtual ~IRemoteEnd(){}
309  };
310 
311  } // namespace avd
312 } // namespace tee3
313 #endif//RT_REMOTE_CTRL_H_
Definition: mremotectrl.h:93
virtual ~IRemoteEnd()
Definition: mremotectrl.h:308
Definition: mremotectrl.h:52
int remtest
Definition: mremotectrl.h:58
virtual ~IRemoteCtrllor()
Definition: mremotectrl.h:198
Definition: mremotectrl.h:77
void clear()
Definition: mremotectrl.h:62
int Result
Definition: combase.h:13
Definition: room.h:17
#define RT_API_EXPORT
Definition: defines.h:188
Definition: room.h:366
virtual ~IListener()
Definition: mremotectrl.h:81
int width
Definition: mremotectrl.h:47
std::string controllerUserId
Definition: mremotectrl.h:53
virtual ~IListener()
Definition: mremotectrl.h:131
std::string attachuserid
Definition: mremotectrl.h:55
int screentSt
Definition: mremotectrl.h:46
bool iscontroller
Definition: mremotectrl.h:56
std::string beControledUserId
Definition: mremotectrl.h:54
ContrllerEndScreenInfo remoteScreenInfo
Definition: mremotectrl.h:57
#define REMOTE_READY
Definition: mremotectrl.h:10
RemoteInfo()
Definition: mremotectrl.h:59
Definition: mremotectrl.h:44
ContrllerEndScreenInfo()
Definition: mremotectrl.h:49
virtual ~IRemoteCtrl()
Definition: mremotectrl.h:90
Definition: mremotectrl.h:205
std::string pubScreenuserId
Definition: mremotectrl.h:45
virtual ~IListener()
Definition: mremotectrl.h:235
Definition: audiocapture.h:5
Definition: mremotectrl.h:95
Definition: mremotectrl.h:203
int height
Definition: mremotectrl.h:48
Definition: mremotectrl.h:79