Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
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:

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 slotSystemCombination ()
 
void slotConnected ()
 
void slotRecordVideo (bool bRecord)
 

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 sigServerName (const QString &szName)
 
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 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
 

Properties

double ZoomFactor
 

Private Member Functions

int ReSize (int width, int height)
 
void paintDesktop ()
 
int TranslationMousePoint (QPointF inPos, QPointF &outPos)
 
QRectF GetAspectRationRect ()
 

Private Attributes

QImage m_Desktop
 
QSize m_DesktopSize
 
ADAPT_WINDOWS m_AdaptWindows
 
double m_dbZoomFactor
 
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 48 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 61 of file FrmViewer.h.

◆ LED_STATE

enum CFrmViewer::LED_STATE

Definition at line 90 of file FrmViewer.h.

Constructor & Destructor Documentation

◆ CFrmViewer()

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

Definition at line 25 of file FrmViewer.cpp.

◆ ~CFrmViewer()

CFrmViewer::~CFrmViewer ( )
overridevirtual

Definition at line 49 of file FrmViewer.cpp.

Member Function Documentation

◆ GetAdaptWindows()

CFrmViewer::ADAPT_WINDOWS CFrmViewer::GetAdaptWindows ( )

Definition at line 307 of file FrmViewer.cpp.

◆ GetAspectRationRect()

QRectF CFrmViewer::GetAspectRationRect ( )
private

Definition at line 54 of file FrmViewer.cpp.

◆ GetDesktopSize()

QSize CFrmViewer::GetDesktopSize ( )

Definition at line 260 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 265 of file FrmViewer.cpp.

◆ GrabImage()

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

Definition at line 517 of file FrmViewer.cpp.

◆ keyPressEvent()

void CFrmViewer::keyPressEvent ( QKeyEvent *  event)
overrideprotectedvirtual

Definition at line 235 of file FrmViewer.cpp.

◆ keyReleaseEvent()

void CFrmViewer::keyReleaseEvent ( QKeyEvent *  event)
overrideprotectedvirtual

Definition at line 242 of file FrmViewer.cpp.

◆ mouseMoveEvent()

void CFrmViewer::mouseMoveEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Definition at line 204 of file FrmViewer.cpp.

◆ mousePressEvent()

void CFrmViewer::mousePressEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Definition at line 171 of file FrmViewer.cpp.

◆ mouseReleaseEvent()

void CFrmViewer::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Definition at line 188 of file FrmViewer.cpp.

◆ paintDesktop()

void CFrmViewer::paintDesktop ( )
private

Definition at line 82 of file FrmViewer.cpp.

◆ paintEvent()

void CFrmViewer::paintEvent ( QPaintEvent *  event)
overrideprotectedvirtual

Definition at line 126 of file FrmViewer.cpp.

◆ ReSize()

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

Definition at line 279 of file FrmViewer.cpp.

◆ slotConnected

void CFrmViewer::slotConnected ( )
slot

Definition at line 325 of file FrmViewer.cpp.

◆ slotRecordVideo

void CFrmViewer::slotRecordVideo ( bool  bRecord)
slot

Definition at line 527 of file FrmViewer.cpp.

◆ slotSetAdaptWindows

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

Definition at line 287 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 312 of file FrmViewer.cpp.

◆ slotSetName

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

Update desktop name.

Parameters
szName

Definition at line 330 of file FrmViewer.cpp.

◆ slotSetZoomFactor

int CFrmViewer::slotSetZoomFactor ( double  newZoomFactor)
slot

Definition at line 270 of file FrmViewer.cpp.

◆ slotSystemCombination

void CFrmViewer::slotSystemCombination ( )
slot

Definition at line 249 of file FrmViewer.cpp.

◆ slotUpdateCursor

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

Update cursor.

Parameters
cursor

Definition at line 375 of file FrmViewer.cpp.

◆ slotUpdateCursorPosition

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

Update cursor position.

Parameters
pos

Definition at line 380 of file FrmViewer.cpp.

◆ slotUpdateLedState

void CFrmViewer::slotUpdateLedState ( unsigned int  state)
slot

Definition at line 432 of file FrmViewer.cpp.

◆ slotUpdateRect [1/2]

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

Definition at line 336 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 348 of file FrmViewer.cpp.

◆ TranslationMousePoint()

int CFrmViewer::TranslationMousePoint ( QPointF  inPos,
QPointF &  outPos 
)
private

Definition at line 134 of file FrmViewer.cpp.

◆ wheelEvent()

void CFrmViewer::wheelEvent ( QWheelEvent *  event)
overrideprotectedvirtual

Definition at line 221 of file FrmViewer.cpp.

Member Data Documentation

◆ m_AdaptWindows

ADAPT_WINDOWS CFrmViewer::m_AdaptWindows
private

Definition at line 163 of file FrmViewer.h.

◆ m_bRecordVideo

bool CFrmViewer::m_bRecordVideo
private

Definition at line 179 of file FrmViewer.h.

◆ m_dbZoomFactor

double CFrmViewer::m_dbZoomFactor
private

Definition at line 164 of file FrmViewer.h.

◆ m_Desktop

QImage CFrmViewer::m_Desktop
private

Definition at line 160 of file FrmViewer.h.

◆ m_DesktopSize

QSize CFrmViewer::m_DesktopSize
private

Definition at line 161 of file FrmViewer.h.

Property Documentation

◆ ZoomFactor

double CFrmViewer::ZoomFactor
readwrite

Definition at line 51 of file FrmViewer.h.


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