Rabbit Remote Control 0.1.0-bate14
Loading...
Searching...
No Matches
CFrmViewer Class Reference

A widget which displays output image from a CConnectDesktop and sends input keypresses and mouse activity to the CConnectDesktop. More...

#include <FrmViewer.h>

Inheritance diagram for CFrmViewer:
Collaboration diagram for CFrmViewer:

Public Types

enum class  ADAPT_WINDOWS {
  Disable = 0 , Auto = 1 , Original = 2 , OriginalCenter = 3 ,
  Zoom = 4 , ZoomToWindow = 5 , KeepAspectRationToWindow = 6
}
 The ADAPT_WINDOWS enum. More...
enum  LED_STATE { Unknown = -1 , ScrollLock = 1 , NumLock = 1 << 1 , CapsLock = 1 << 2 }

Public Slots

void slotSetAdaptWindows (CFrmViewer::ADAPT_WINDOWS aw=ADAPT_WINDOWS::Original)
int slotSetZoomFactor (double newZoomFactor)
void slotSetDesktopSize (int width, int height)
 Update desktop size.
void slotSetName (const QString &szName)
 Update desktop name.
void slotUpdateRect (const QRect &r, const QImage &image)
 Update image.
void slotUpdateRect (const QImage &image)
void slotUpdateCursor (const QCursor &cursor)
 Update cursor.
void slotUpdateCursorPosition (const QPoint &pos)
 Update cursor position.
void slotUpdateLedState (unsigned int state)
void slotRunning ()
 Enable mouse and keyboard.
void slotEnableInputMethod (bool bEnable)
 Enable input method.
void slotRecordVideo (bool bRecord, qreal nRate=0)
void slotRecordVideo ()

Signals

void sigMousePressEvent (QMouseEvent *event, QPoint pos)
void sigMouseReleaseEvent (QMouseEvent *event, QPoint pos)
void sigMouseMoveEvent (QMouseEvent *event, QPoint pos)
void sigMouseMoveEvent (QMouseEvent *event)
void sigWheelEvent (QWheelEvent *event, QPoint pos)
void sigKeyPressEvent (QKeyEvent *event)
void sigKeyReleaseEvent (QKeyEvent *event)
void sigInputMethodEvent (QInputMethodEvent *event)
void sigServerName (const QString &szName)
void sigViewerFocusIn (QWidget *pView)
 The view is focus.
void sigRecordVideo (const QImage &img)

Public Member Functions

 CFrmViewer (QWidget *parent=nullptr)
ADAPT_WINDOWS GetAdaptWindows ()
double GetZoomFactor () const
 Adjust the zoom factor.
QSize GetDesktopSize ()
virtual QImage GrabImage (int x=0, int y=0, int w=-1, int h=-1)

Protected Member Functions

virtual void paintEvent (QPaintEvent *event) override
virtual void focusInEvent (QFocusEvent *event) override
virtual void focusOutEvent (QFocusEvent *event) override
virtual void mousePressEvent (QMouseEvent *event) override
virtual void mouseReleaseEvent (QMouseEvent *event) override
virtual void mouseMoveEvent (QMouseEvent *event) override
virtual void wheelEvent (QWheelEvent *event) override
virtual void keyPressEvent (QKeyEvent *event) override
virtual void keyReleaseEvent (QKeyEvent *event) override
virtual void inputMethodEvent (QInputMethodEvent *event) override
virtual QVariant inputMethodQuery (Qt::InputMethodQuery query) const override

Properties

double ZoomFactor

Private Member Functions

int ReSize (int width, int height)
void paintDesktop ()
int PointToRemote (const QPointF &inPos, QPointF &outPos)
int PointFromRemote (const QPointF &inPos, QPointF &outPos)
QRectF GetAspectRationRect ()

Private Attributes

QImage m_Desktop
QSize m_DesktopSize
ADAPT_WINDOWS m_AdaptWindows
double m_dbZoomFactor
QTimer m_TimerRecordVideo
bool m_bRecordVideo

Detailed Description

A widget which displays output image from a CConnectDesktop and sends input keypresses and mouse activity to the CConnectDesktop.

See also
CConnecter CConnectDesktop

Definition at line 47 of file FrmViewer.h.

Member Enumeration Documentation

◆ ADAPT_WINDOWS

enum class CFrmViewer::ADAPT_WINDOWS
strong

The ADAPT_WINDOWS enum.

Enumerator
Disable 

Disable adapt windows.

Original 

Original desktop size, the left-top of the desktop is aligned with the left-top of the window.

OriginalCenter 

Original desktop size, the center of the desktop is aligned with the center of the window.

Zoom 

zoom windows = desktop size * factor

ZoomToWindow 

Desktop adapt to windows.

KeepAspectRationToWindow 

Keep desktop aspectration adapt to windows.

Definition at line 60 of file FrmViewer.h.

◆ LED_STATE

enum CFrmViewer::LED_STATE

Definition at line 89 of file FrmViewer.h.

Constructor & Destructor Documentation

◆ CFrmViewer()

Client FrmViewer static Key Client FrmViewer InputMethod CFrmViewer::CFrmViewer ( QWidget * parent = nullptr)
explicit

Definition at line 27 of file FrmViewer.cpp.

◆ ~CFrmViewer()

CFrmViewer::~CFrmViewer ( )
overridevirtual

Definition at line 56 of file FrmViewer.cpp.

Member Function Documentation

◆ focusInEvent()

void CFrmViewer::focusInEvent ( QFocusEvent * event)
overrideprotectedvirtual

Definition at line 651 of file FrmViewer.cpp.

◆ focusOutEvent()

void CFrmViewer::focusOutEvent ( QFocusEvent * event)
overrideprotectedvirtual

Definition at line 657 of file FrmViewer.cpp.

◆ GetAdaptWindows()

CFrmViewer::ADAPT_WINDOWS CFrmViewer::GetAdaptWindows ( )

Definition at line 392 of file FrmViewer.cpp.

◆ GetAspectRationRect()

QRectF CFrmViewer::GetAspectRationRect ( )
private

Definition at line 61 of file FrmViewer.cpp.

◆ GetDesktopSize()

QSize CFrmViewer::GetDesktopSize ( )

Definition at line 345 of file FrmViewer.cpp.

◆ GetZoomFactor()

double CFrmViewer::GetZoomFactor ( ) const

Adjust the zoom factor.

After the adjustment is completed, you need to call SetAdaptWindows(FrmViewer::Zoom) to zoom the window size.

Returns

Definition at line 350 of file FrmViewer.cpp.

◆ GrabImage()

QImage CFrmViewer::GrabImage ( int x = 0,
int y = 0,
int w = -1,
int h = -1 )
virtual

Definition at line 615 of file FrmViewer.cpp.

◆ inputMethodEvent()

void CFrmViewer::inputMethodEvent ( QInputMethodEvent * event)
overrideprotectedvirtual

Definition at line 300 of file FrmViewer.cpp.

◆ inputMethodQuery()

QVariant CFrmViewer::inputMethodQuery ( Qt::InputMethodQuery query) const
overrideprotectedvirtual

Definition at line 314 of file FrmViewer.cpp.

◆ keyPressEvent()

void CFrmViewer::keyPressEvent ( QKeyEvent * event)
overrideprotectedvirtual

Definition at line 286 of file FrmViewer.cpp.

◆ keyReleaseEvent()

void CFrmViewer::keyReleaseEvent ( QKeyEvent * event)
overrideprotectedvirtual

Definition at line 293 of file FrmViewer.cpp.

◆ mouseMoveEvent()

void CFrmViewer::mouseMoveEvent ( QMouseEvent * event)
overrideprotectedvirtual

Definition at line 250 of file FrmViewer.cpp.

◆ mousePressEvent()

void CFrmViewer::mousePressEvent ( QMouseEvent * event)
overrideprotectedvirtual

Definition at line 210 of file FrmViewer.cpp.

◆ mouseReleaseEvent()

void CFrmViewer::mouseReleaseEvent ( QMouseEvent * event)
overrideprotectedvirtual

Definition at line 233 of file FrmViewer.cpp.

◆ paintDesktop()

void CFrmViewer::paintDesktop ( )
private

Definition at line 89 of file FrmViewer.cpp.

◆ paintEvent()

void CFrmViewer::paintEvent ( QPaintEvent * event)
overrideprotectedvirtual

Definition at line 133 of file FrmViewer.cpp.

◆ PointFromRemote()

int CFrmViewer::PointFromRemote ( const QPointF & inPos,
QPointF & outPos )
private

Definition at line 179 of file FrmViewer.cpp.

◆ PointToRemote()

int CFrmViewer::PointToRemote ( const QPointF & inPos,
QPointF & outPos )
private

Definition at line 141 of file FrmViewer.cpp.

◆ ReSize()

int CFrmViewer::ReSize ( int width,
int height )
private

Definition at line 364 of file FrmViewer.cpp.

◆ sigViewerFocusIn

void CFrmViewer::sigViewerFocusIn ( QWidget * pView)
signal

The view is focus.

Parameters
pView

◆ slotEnableInputMethod

void CFrmViewer::slotEnableInputMethod ( bool bEnable)
slot

Enable input method.

Definition at line 339 of file FrmViewer.cpp.

◆ slotRecordVideo [1/2]

void CFrmViewer::slotRecordVideo ( )
slot

Definition at line 646 of file FrmViewer.cpp.

◆ slotRecordVideo [2/2]

void CFrmViewer::slotRecordVideo ( bool bRecord,
qreal nRate = 0 )
slot

Definition at line 625 of file FrmViewer.cpp.

◆ slotRunning

void CFrmViewer::slotRunning ( )
slot

Enable mouse and keyboard.

Definition at line 410 of file FrmViewer.cpp.

◆ slotSetAdaptWindows

void CFrmViewer::slotSetAdaptWindows ( CFrmViewer::ADAPT_WINDOWS aw = ADAPT_WINDOWS::Original)
slot

Definition at line 372 of file FrmViewer.cpp.

◆ slotSetDesktopSize

void CFrmViewer::slotSetDesktopSize ( int width,
int height )
slot

Update desktop size.

Parameters
width
height
Note
The plugin is use CConnectDesktop::sigSetDesktopSize

Definition at line 397 of file FrmViewer.cpp.

◆ slotSetName

void CFrmViewer::slotSetName ( const QString & szName)
slot

Update desktop name.

Parameters
szName

Definition at line 415 of file FrmViewer.cpp.

◆ slotSetZoomFactor

int CFrmViewer::slotSetZoomFactor ( double newZoomFactor)
slot

Definition at line 355 of file FrmViewer.cpp.

◆ slotUpdateCursor

void CFrmViewer::slotUpdateCursor ( const QCursor & cursor)
slot

Update cursor.

Parameters
cursor

Definition at line 458 of file FrmViewer.cpp.

◆ slotUpdateCursorPosition

void CFrmViewer::slotUpdateCursorPosition ( const QPoint & pos)
slot

Update cursor position.

Parameters
pos

Definition at line 469 of file FrmViewer.cpp.

◆ slotUpdateLedState

void CFrmViewer::slotUpdateLedState ( unsigned int state)
slot

Definition at line 530 of file FrmViewer.cpp.

◆ slotUpdateRect [1/2]

void CFrmViewer::slotUpdateRect ( const QImage & image)
slot

Definition at line 421 of file FrmViewer.cpp.

◆ slotUpdateRect [2/2]

void CFrmViewer::slotUpdateRect ( const QRect & r,
const QImage & image )
slot

Update image.

Parameters
rimage rect
imageimage

Definition at line 433 of file FrmViewer.cpp.

◆ wheelEvent()

void CFrmViewer::wheelEvent ( QWheelEvent * event)
overrideprotectedvirtual

Definition at line 271 of file FrmViewer.cpp.

Member Data Documentation

◆ m_AdaptWindows

ADAPT_WINDOWS CFrmViewer::m_AdaptWindows
private

Definition at line 181 of file FrmViewer.h.

◆ m_bRecordVideo

bool CFrmViewer::m_bRecordVideo
private

Definition at line 200 of file FrmViewer.h.

◆ m_dbZoomFactor

double CFrmViewer::m_dbZoomFactor
private

Definition at line 182 of file FrmViewer.h.

◆ m_Desktop

QImage CFrmViewer::m_Desktop
private

Definition at line 178 of file FrmViewer.h.

◆ m_DesktopSize

QSize CFrmViewer::m_DesktopSize
private

Definition at line 179 of file FrmViewer.h.

◆ m_TimerRecordVideo

QTimer CFrmViewer::m_TimerRecordVideo
private

Definition at line 199 of file FrmViewer.h.

Property Documentation

◆ ZoomFactor

double CFrmViewer::ZoomFactor
readwrite

Definition at line 50 of file FrmViewer.h.


The documentation for this class was generated from the following files: