Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes | Private Slots | Private Member Functions | Private Attributes | List of all members
CConnecterThread Class Reference

It starts a background thread by default. More...

#include <ConnecterThread.h>

Inheritance diagram for CConnecterThread:
CConnecterConnect CConnecter CConnecterFreeRDP CConnecterLibVNCServer CConnecterPlayer CConnecterVnc

Public Slots

virtual int Connect () override
 Start a background thread, and create an instance of CConnect .
 
virtual int DisConnect () override
 emit sigConnected() in CConnectThread::run()
 
virtual void slotScreenShot ()
 
- Public Slots inherited from CConnecterConnect
virtual int Connect () override
 
virtual int DisConnect () override
 emit sigDisconnected() in here
 
- Public Slots inherited from CConnecter
virtual int Connect ()=0
 Start connect.
 
virtual int DisConnect ()=0
 Close connect.
 

Public Member Functions

 CConnecterThread (CPluginClient *plugin)
 
virtual int Initial () override
 Initial parameters and resource.
 
virtual int Clean () override
 Clean parameters and resource.
 
virtual QWidget * GetViewer () override
 Get Viewer.
 
- Public Member Functions inherited from CConnecterConnect
 CConnecterConnect (CPluginClient *plugin)
 
virtual const QString Id () override
 Identity.
 
virtual const QString Name () override
 Display order:
 
virtual const QString Description () override
 Description.
 
virtual CConnectInstanceConnect ()=0
 New connect.
 
virtual CParameterBaseGetParameter ()
 Get parameter.
 
virtual int SetParameter (CParameterBase *p)
 
- Public Member Functions inherited from CConnecter
 CConnecter (CPluginClient *plugin)
 
virtual const QString Protocol () const
 Protocol.
 
virtual qint16 Version ()=0
 Version.
 
virtual const QIcon Icon () const
 Icon.
 
virtual int OpenDialogSettings (QWidget *parent=nullptr)
 Open settings dialog.
 
virtual QMenu * GetMenu (QWidget *parent=nullptr)
 Get operate menu.
 

Protected Member Functions

virtual QString ServerName () override
 Current connect server name (remote desktop name, if not present, then IP:PORT).
 
- Protected Member Functions inherited from CConnecter
virtual int SetParameter (CParameter *p)
 Set parameters.
 
CParameterGetParameter ()
 
Q_INVOKABLE CPluginClientGetPlugClient () const
 
virtual Q_INVOKABLE int Load (QString szFile=QString())
 Load parameters from file.
 
virtual Q_INVOKABLE int Save (QString szFile=QString())
 Save parameters to file.
 

Protected Attributes

QAction * m_pMenuZoom
 
QAction * m_pZoomToWindow
 
QAction * m_pZoomAspectRatio
 
QAction * m_pZoomOriginal
 
QAction * m_pZoomIn
 
QAction * m_pZoomOut
 
QSpinBox * m_psbZoomFactor
 
QAction * m_pScreenShot
 
- Protected Attributes inherited from CConnecter
QMenu m_Menu
 
QAction * m_pSettings
 

Private Slots

void slotValueChanged (int v)
 emit by zoom menu in the class
 

Private Member Functions

virtual int Load (QSettings &set) override
 Load parameters.
 
virtual int Save (QSettings &set) override
 Save parameters.
 

Private Attributes

CConnectThreadm_pThread
 
CFrmViewerm_pFrmViewer
 
CFrmScrollm_pScroll
 

Additional Inherited Members

- Signals inherited from CConnecterConnect
void sigOpenConnect (CConnecterConnect *)
 
void sigCloseconnect (CConnecterConnect *)
 
- Signals inherited from CConnecter
void sigConnected ()
 Successful connection signal.
 
void sigDisconnect ()
 Notify the user to disconnect.
 
void sigDisconnected ()
 Successful disconnection signal.
 
void sigUpdateName (const QString &szName)
 
void sigUpdateParameters (CConnecter *pConnecter)
 Update parameters, notify application to save or show parameters.
 
void sigError (const int nError, const QString &szError)
 Triggered when an error is generated.
 
void sigInformation (const QString &szInfo)
 Show information in main windows.
 
void sigShowMessageBox (const QString &title, const QString &message, const QMessageBox::Icon &icon=QMessageBox::Information)
 Trigger the display of a message dialog (QMessageBox) in the main thread from a background thread without blocking the background thread.
 
void sigClipBoardChanged ()
 
- Static Protected Member Functions inherited from CConnecter
static QObject * createObject (const QString &className, QObject *parent=NULL)
 

Detailed Description

It starts a background thread by default.

It implements a background thread to handle a connection. Can be used with plugins whose plugin interface derives from CPluginClient for connection is blocking model.

Principle: Start a background thread (CConnectThread) in Connect() . Call InstanceConnect() in the thread to instantiate CConnect, and start the timer in CConnect::Connect(). This timer is called in the background thread. Through the operation of the timer, start a non-Qt event loop (that is, normal loop processing. May block), See CConnect. And CConnect supports the Qt event (the signal-slot mechanism of QObject. no-block).

Sequen diagram:

Note
The interface only is implemented by plug-in
The specific plug-in needs to implement the following interface.
  1. Implement InstanceConnect() . Generate a connection object. The connection object runs in a background thread.
See also
CConnect CConnectThread CConnecter CPluginClient CFrmViewer

Definition at line 56 of file ConnecterThread.h.

Constructor & Destructor Documentation

◆ ~CConnecterThread()

CConnecterThread::~CConnecterThread ( )
virtual

Definition at line 26 of file ConnecterThread.cpp.

Member Function Documentation

◆ Clean()

int CConnecterThread::Clean ( )
overridevirtual

Clean parameters and resource.

See also
CClient::DeleteConnecter

Implements CConnecter.

Reimplemented in CConnecterFreeRDP, CConnecterLibVNCServer, CConnecterPlayer, and CConnecterVnc.

Definition at line 145 of file ConnecterThread.cpp.

◆ Connect

int CConnecterThread::Connect ( )
overridevirtualslot

Start a background thread, and create an instance of CConnect .

See also
CConnectThread

Definition at line 162 of file ConnecterThread.cpp.

◆ DisConnect

int CConnecterThread::DisConnect ( )
overridevirtualslot

◆ GetViewer()

QWidget * CConnecterThread::GetViewer ( )
overridevirtual

Get Viewer.

Returns
QWidget*: the ownership is a instance of this class or its derivative class
See also
sigConnected CFrmViewer::CFrmViewer

Implements CConnecter.

Definition at line 157 of file ConnecterThread.cpp.

◆ Initial()

int CConnecterThread::Initial ( )
overridevirtual

Initial parameters and resource.

See also
CClient::CreateConnecter

Implements CConnecter.

Reimplemented in CConnecterFreeRDP, CConnecterLibVNCServer, CConnecterPlayer, and CConnecterVnc.

Definition at line 31 of file ConnecterThread.cpp.

◆ Load()

int CConnecterThread::Load ( QSettings &  set)
overrideprivatevirtual

Load parameters.

Reimplemented from CConnecter.

Definition at line 203 of file ConnecterThread.cpp.

◆ Save()

int CConnecterThread::Save ( QSettings &  set)
overrideprivatevirtual

Save parameters.

Reimplemented from CConnecter.

Definition at line 226 of file ConnecterThread.cpp.

◆ ServerName()

QString CConnecterThread::ServerName ( )
overrideprotectedvirtual

Current connect server name (remote desktop name, if not present, then IP:PORT).

eg: Server name or Ip:Port

Returns
Current connect server name.

Reimplemented from CConnecterConnect.

Reimplemented in CConnecterVnc.

Definition at line 190 of file ConnecterThread.cpp.

◆ slotScreenShot

void CConnecterThread::slotScreenShot ( )
virtualslot

Definition at line 277 of file ConnecterThread.cpp.

◆ slotValueChanged

void CConnecterThread::slotValueChanged ( int  v)
privateslot

emit by zoom menu in the class

Definition at line 270 of file ConnecterThread.cpp.

Member Data Documentation

◆ m_pFrmViewer

CFrmViewer* CConnecterThread::m_pFrmViewer
private

Definition at line 106 of file ConnecterThread.h.

◆ m_pMenuZoom

QAction* CConnecterThread::m_pMenuZoom
protected

Definition at line 110 of file ConnecterThread.h.

◆ m_psbZoomFactor

QSpinBox* CConnecterThread::m_psbZoomFactor
protected

Definition at line 116 of file ConnecterThread.h.

◆ m_pScreenShot

QAction* CConnecterThread::m_pScreenShot
protected

Definition at line 117 of file ConnecterThread.h.

◆ m_pScroll

CFrmScroll* CConnecterThread::m_pScroll
private

Definition at line 107 of file ConnecterThread.h.

◆ m_pThread

CConnectThread* CConnecterThread::m_pThread
private

Definition at line 105 of file ConnecterThread.h.

◆ m_pZoomAspectRatio

QAction* CConnecterThread::m_pZoomAspectRatio
protected

Definition at line 112 of file ConnecterThread.h.

◆ m_pZoomIn

QAction* CConnecterThread::m_pZoomIn
protected

Definition at line 114 of file ConnecterThread.h.

◆ m_pZoomOriginal

QAction* CConnecterThread::m_pZoomOriginal
protected

Definition at line 113 of file ConnecterThread.h.

◆ m_pZoomOut

QAction* CConnecterThread::m_pZoomOut
protected

Definition at line 115 of file ConnecterThread.h.

◆ m_pZoomToWindow

QAction* CConnecterThread::m_pZoomToWindow
protected

Definition at line 111 of file ConnecterThread.h.


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