Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
ConnectVnc.h
1// Author: Kang Lin <kl222@126.com>
2
3#ifndef CCONNECTVNC_H
4#define CCONNECTVNC_H
5
6#pragma once
7
8#include <QEventLoop>
9
10#include "ConnectDesktop.h"
11#include "Channel.h"
12#include "ParameterVnc.h"
13
14#include "ParameterConnecter.h"
15#include "../InStreamChannel.h"
16#include "../OutStreamChannel.h"
17
18#include "rfb/CConnection.h"
19#include "rfb/UserPasswdGetter.h"
20#include "rfb/UserMsgBox.h"
21
24 : public CConnectDesktop,
25 public rfb::CConnection
26{
27 Q_OBJECT
28
29public:
30 explicit CConnectVnc(CConnecterThread* pConnecter);
31 virtual ~CConnectVnc() override;
32
33public Q_SLOTS:
34 virtual void slotConnected();
35 virtual void slotDisConnected();
36 virtual void slotReadyRead();
37 virtual void slotClipBoardChanged() override;
38
39 void slotChannelError(int nErr, const QString &szErr);
40
41public:
42 // rfb::CConnection callback methods
43 virtual void initDone() override;
44 virtual void authSuccess() override;
45 virtual void resizeFramebuffer() override;
46
47 virtual void getUserPasswd(bool secure, std::string* user, std::string* password) override;
48 virtual int getX509File(std::string *ca, std::string *crl) override;
49 virtual bool showMsgBox(rfb::MsgBoxFlags flags, const char* title, const char* text) override;
50
51 // CMsgHandler interface
52public:
53 virtual void setName(const char *name) override;
54 virtual void framebufferUpdateStart() override;
55 virtual void framebufferUpdateEnd() override;
56 virtual void setColourMapEntries(int firstColour, int nColours, uint16_t* rgbs) override;
57 virtual void bell() override;
58 virtual void setLEDState(unsigned int state) override;
59 virtual void setCursor(int width, int height, const rfb::Point& hotspot,
60 const uint8_t* data) override;
61 virtual void setCursorPos(const rfb::Point &pos) override;
62 virtual void fence(uint32_t flags, unsigned int len, const uint8_t data[]) override;
63
64 virtual void handleClipboardRequest() override;
65 virtual void handleClipboardAnnounce(bool available) override;
66 virtual void handleClipboardData(const char *data) override;
67
68protected:
69 virtual void mousePressEvent(QMouseEvent *event) override;
70 virtual void mouseReleaseEvent(QMouseEvent *event) override;
71 virtual void mouseMoveEvent(QMouseEvent *event) override;
72 virtual void wheelEvent(QWheelEvent *event) override;
73 virtual void keyPressEvent(QKeyEvent *event) override;
74 virtual void keyReleaseEvent(QKeyEvent *event) override;
75
76 // CConnect interface
77protected:
78 // Please call SetParamter before call Connect
79 virtual OnInitReturnValue OnInit() override;
80 virtual int OnClean() override;
81 virtual int OnProcess() override;
82 // CConnectDesktop interface
83 virtual int WakeUp() override;
84
85private:
86 QSharedPointer<CChannel> m_DataChannel;
87 QSharedPointer<rdr::InStream> m_InStream;
88 QSharedPointer<rdr::OutStream> m_OutStream;
89
90 quint32 TranslateRfbKey(quint32 inkey,bool modifier);
91 QString ConnectInformation();
92
93private:
94 CParameterVnc* m_pPara;
95 int SetPara();
96 void autoSelectFormatAndEncoding();
97 void updatePixelFormat();
98
99 int SocketInit();
100 int SetChannelConnect(QSharedPointer<CChannel> channel);
101
102 int IceInit();
103 int SSHInit();
104
105};
106
107#endif // CCONNECTVNC_H
Remote desktop connect interface.
virtual int OnClean() override
Clean.
quint32 TranslateRfbKey(quint32 inkey, bool modifier)
CConnectVnc::TranslateRfbKey.
virtual int OnProcess() override
Specific operation processing of plug-in connection.
virtual int WakeUp() override
Wake up Connect thread(background thread)
virtual OnInitReturnValue OnInit() override
Specific plug-in realizes connection initialization.
It starts a background thread by default.