Rabbit Remote Control 0.1.0-bate14
Loading...
Searching...
No Matches
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
Clean.
void slotConnectProxyServer(QString szHost, quint16 nPort)
[connect local socket server]
virtual int WakeUp() override
Wake up backend thread(background thread).
virtual void slotClipBoardChanged() override
Be called when the clip board change.
virtual OnInitReturnValue OnInit() override
virtual int OnProcess() override
Specific operation processing of plug-in connection.
Data is forwarded over a local socket and SSH tunnel.