玉兔远程控制 0.1.0-bate16
载入中...
搜索中...
未找到
BackendLibVNCServer.h
1#ifndef CCONNECTLIBVNC_H
2#define CCONNECTLIBVNC_H
3
4#pragma once
5
6#include "BackendDesktop.h"
7#include "rfb/rfbclient.h"
8#include <QTcpSocket>
9#include <QTcpServer>
10#include "OperateLibVNCServer.h"
11#include "Event.h"
12
13#ifdef HAVE_LIBSSH
14#include "SSHTunnelThread.h"
15#endif
16
17class CBackendLibVNCServer : public CBackendDesktop
18{
19 Q_OBJECT
20
21public:
22 explicit CBackendLibVNCServer(COperateLibVNCServer* pOperate);
23 virtual ~CBackendLibVNCServer() override;
24
25 static rfbBool cb_resize(rfbClient* client);
26 static void cb_update (rfbClient *client, int x, int y, int w, int h);
27 static void cb_kbd_leds(rfbClient* client, int value, int pad);
28 static void cb_bell(struct _rfbClient* client);
29 static void cb_text_chat(rfbClient* client, int value, char *text);
30 static void cb_got_selection(rfbClient *client, const char *text, int len);
31 static rfbCredential* cb_get_credential(rfbClient* cl, int credentialType);
32 static char* cb_get_password(rfbClient* client);
33 static rfbBool cb_cursor_pos(rfbClient* client, int x, int y);
34 static void cb_got_cursor_shape(rfbClient* client, int xhot, int yhot, int width, int height, int bytesPerPixel);
35
36protected:
37 virtual void slotClipBoardChanged() override;
38 virtual void mousePressEvent(QMouseEvent* event) override;
39 virtual void mouseReleaseEvent(QMouseEvent* event) override;
40 virtual void mouseMoveEvent(QMouseEvent* event) override;
41 virtual void wheelEvent(QWheelEvent* event) override;
42 virtual void keyPressEvent(QKeyEvent *event) override;
43 virtual void keyReleaseEvent(QKeyEvent *event) override;
44 virtual void InputMethodEvent(QInputMethodEvent *event) override;
45
46protected Q_SLOTS:
47 void slotConnectProxyServer(QString szHost, quint16 nPort);
48#if defined(HAVE_UNIX_DOMAIN_SOCKET) && defined(Q_OS_UNIX)
49 void slotConnectProxyServer(QString szFile);
50#endif
51
52private:
53 virtual OnStartReturnValue OnStart() override;
54 virtual int OnStop() override;
55 virtual int OnProcess() override;
56 virtual int WakeUp() override;
57
58 int OnSize();
59
60private:
61 rfbClient* m_pClient;
62 QImage m_Image;
63
64private:
65 CParameterLibVNCServer* m_pParameter;
66 QTcpSocket m_tcpSocket;
67 QTcpServer m_Server;
68 QTcpSocket* m_pConnect;
69
70 Channel::CEvent m_Event;
71#ifdef HAVE_LIBSSH
72 CSSHTunnelThread* m_pThread;
73#endif
74
75 CSecurityLevel::Levels m_SecurityLevel;
76};
77
78#endif // CCONNECTLIBVNC_H
virtual OnStartReturnValue OnStart() override
void slotConnectProxyServer(QString szHost, quint16 nPort)
[connect local socket server]
virtual int WakeUp() override
唤醒后台线程。
virtual int OnStop() override
清理
virtual void slotClipBoardChanged() override
当剪切板发生改变时调用
virtual int OnProcess() override
插件连接的具体操作处理。因为此插件是非Qt事件,所以在此函数中等待。
实现通过本地 SOCKET 与 SSH 隧道转发数据。适用于库没有实现传输层接口,只有 socket 的情况。