Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
ConnectDesktop.h
1// Author: Kang Lin <kl222@126.com>
2
3#ifndef __CCONNECTDESKTOP_H_2024_09_27__
4#define __CCONNECTDESKTOP_H_2024_09_27__
5
6#pragma once
7
8#include <QPoint>
9#include <QMouseEvent>
10#include <QKeyEvent>
11#include <QWheelEvent>
12#include <QMimeData>
13#include <QMessageBox>
14#if HAVE_QT6_MULTIMEDIA
15 #include <QMediaCaptureSession>
16#endif
17#if HAVE_QT6_RECORD
18 #include <QVideoFrameInput>
19 #include <QAudioBufferInput>
20 #include <QAudioBufferOutput>
21 #include <QMediaRecorder>
22 #include "ParameterRecord.h"
23#endif
24
25#include "FrmViewer.h"
26#include "Connect.h"
27
29
41class CLIENT_EXPORT CConnectDesktop : public CConnect
42{
43 Q_OBJECT
44
45public:
59 explicit CConnectDesktop(CConnecter* pConnecter,
60 bool bDirectConnection = true);
61 virtual ~CConnectDesktop() override;
62
63public Q_SLOTS:
64#if HAVE_QT6_RECORD
65 virtual int Disconnect() override;
66#endif
71 virtual void slotClipBoardChanged() = 0;
72
73private:
74 int SetConnecter(CConnecter* pConnecter);
75 int SetViewer(CFrmViewer* pView, bool bDirectConnection);
76
77Q_SIGNALS:
78 void sigSetDesktopSize(int width, int height);
79 void sigServerName(const QString& szName);
80
90 void sigUpdateRect(const QRect& r, const QImage& image);
95 void sigUpdateRect(const QImage& image);
96 void sigUpdateCursor(const QCursor& cursor);
97 void sigUpdateCursorPosition(const QPoint& pos);
98 void sigUpdateLedState(unsigned int state);
99 void sigSetClipboard(QMimeData* data);
100
101public Q_SLOTS:
102 // \~chinese 以下函数在 CFrmView 线程(主线程)中调用
103 // \~english The following functions are called in the CFrmView thread(main thread)
104 virtual void slotMousePressEvent(QMouseEvent* event, QPoint pos);
105 virtual void slotMouseReleaseEvent(QMouseEvent* event, QPoint pos);
106 virtual void slotMouseMoveEvent(QMouseEvent* event, QPoint pos);
107 virtual void slotWheelEvent(QWheelEvent* event, QPoint pos);
108 virtual void slotKeyPressEvent(QKeyEvent *event);
109 virtual void slotKeyReleaseEvent(QKeyEvent *event);
110
111protected:
116 virtual int WakeUp();
117 // \~chinese 以下函数在 Connect 线程(后台线程)中调用
118 // \~english The following functions are called in the Connect thread(background thread)
119 virtual void mousePressEvent(QMouseEvent *event);
120 virtual void mouseReleaseEvent(QMouseEvent *event);
121 virtual void mouseMoveEvent(QMouseEvent *event);
122 virtual void wheelEvent(QWheelEvent *event);
123 virtual void keyPressEvent(QKeyEvent *event);
124 virtual void keyReleaseEvent(QKeyEvent *event);
125
126 // QObject interface
127public:
128 virtual bool event(QEvent *event) override;
129
130#if HAVE_QT6_RECORD
132private Q_SLOTS:
133 // connect menu
134 virtual void slotRecord(bool bRecord);
135 virtual void slotRecordPause(bool bPause);
136 // connect CFrmView
137 void slotRecordVideo(const QImage& img);
138Q_SIGNALS:
139 void sigRecordVideo(bool bRecord);
140private:
141 void RecordVideo(QRecordVideoEvent *event);
142 CParameterRecord* m_pParameterRecord;
143
144protected:
145 QVideoFrameInput m_VideoFrameInput;
146 QAudioBufferInput m_AudioBufferInput;
147 QAudioBufferOutput m_AudioBufferOutput;
148 QMediaRecorder m_Recorder;
149#endif
150#if HAVE_QT6_MULTIMEDIA
151 QMediaCaptureSession m_CaptureSession;
152#endif
153};
154
155#endif // __CCONNECTDESKTOP_H_2024_09_27__
Remote desktop connect interface.
void sigUpdateRect(const QImage &image)
Notify the CFrmView update image.
void sigUpdateRect(const QRect &r, const QImage &image)
Notify the CFrmView update image.
virtual void slotClipBoardChanged()=0
Be called when the clip board change.
Connect interface.
Definition Connect.h:45
virtual int Disconnect()
Disconnect.
Definition Connect.cpp:89
Connecter interface.
Definition Connecter.h:62
A widget which displays output image from a CConnectDesktop and sends input keypresses and mouse acti...
Definition FrmViewer.h:49