玉兔远程控制 0.1.0-bate11
载入中...
搜索中...
未找到
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
46 void slotConnectProxyServer(QString szHost, quint16 nPort);
47#if defined(HAVE_UNIX_DOMAIN_SOCKET) && defined(Q_OS_UNIX)
48 void slotConnectProxyServer(QString szFile);
49#endif
50
51private:
52 virtual OnInitReturnValue OnInit() override;
53 virtual int OnClean() override;
54 virtual int OnProcess() override;
55 virtual int WakeUp() override;
56
57 int OnSize();
58
59private:
60 rfbClient* m_pClient;
61 QImage m_Image;
62
63private:
64 CParameterLibVNCServer* m_pParameter;
65 QTcpSocket m_tcpSocket;
66 QTcpServer m_Server;
67 QTcpSocket* m_pConnect;
68
69 Channel::CEvent m_Event;
70#ifdef HAVE_LIBSSH
71 CSSHTunnelThread* m_pThread;
72#endif
73
74 CSecurityLevel::Levels m_SecurityLevel;
75};
76
77#endif // CCONNECTLIBVNC_H
virtual int OnClean() override
清理
void slotConnectProxyServer(QString szHost, quint16 nPort)
[connect local socket server]
virtual int WakeUp() override
唤醒后台线程。
virtual void slotClipBoardChanged() override
当剪切板发生改变时调用
virtual OnInitReturnValue OnInit() override
virtual int OnProcess() override
插件连接的具体操作处理。因为此插件是非Qt事件,所以在此函数中等待。
实现通过本地 SOCKET 与 SSH 隧道转发数据。适用于库没有实现传输层接口,只有 socket 的情况。