Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
Public Slots | Signals | Public Member Functions | Protected Types | Protected Slots | Protected Member Functions | Private Member Functions | List of all members
CConnect Class Referenceabstract

Connect interface. More...

#include <Connect.h>

Inheritance diagram for CConnect:
CConnectDesktop CConnectSSH CConnectFreeRDP CConnectLibVNCServer CConnectPlayer CConnectVnc

Public Slots

virtual int Connect ()
 Start connect.
 
virtual int Disconnect ()
 Disconnect.
 

Signals

void sigConnected ()
 Emitted when the plugin is successfully connected.
 
void sigDisconnect ()
 Notify the user to call disconnect.
 
void sigDisconnected ()
 Successful disconnection signal.
 
void sigError (const int nError, const QString &szError=QString())
 Triggered when an error is generated.
 
void sigInformation (const QString &szInfo)
 Triggering from a background thread displays information in the main thread without blocking the background thread.
 
void sigShowMessageBox (const QString &szTitle, const QString &szMessage, 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 sigBlockShowMessageBox (const QString &szTitle, const QString &szMessage, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton &nRet, bool &checkBox, QString checkBoxContext=QString())
 Block background threads and display message dialogs in foreground threads (QMessageBox)
 
void sigBlockInputDialog (const QString &szTitle, const QString &szLable, const QString &szMessage, QString &szText)
 Block background threads and display input dialogs in foreground threads (QInputDialog)
 
void sigBlockShowWidget (const QString &className, int &nRet, void *pContext)
 Blocks the background thread and displays the window in the foreground thread.
 

Public Member Functions

 CConnect (CConnecter *pConnecter)
 

Protected Types

enum class  OnInitReturnValue { Fail = -1 , Success = 0 , UseOnProcess = Success , NotUseOnProcess = 1 }
 

Protected Slots

virtual void slotTimeOut ()
 a non-Qt event loop (that is, normal loop processing), It call OnProcess(), and start timer.
 

Protected Member Functions

virtual OnInitReturnValue OnInit ()=0
 Specific plug-in realizes connection initialization.
 
virtual int OnClean ()=0
 Clean.
 
virtual int OnProcess ()
 Specific operation processing of plug-in connection.
 

Private Member Functions

int SetConnecter (CConnecter *pConnecter)
 

Detailed Description

Connect interface.

It is implemented by the Protocol plugin. It starts a timer by default to start a non-Qt event loop (that is, normal loop processing) . See Connect(), slotTimeOut(), OnProcess() for details. Of course, it still supports Qt events (the signal-slot mechanism of QObject).

Note
  • The interface only is implemented by plug-in.
  • If it's asynchronous (with a background thread), its instance is in a background thread.
  • The plug-in needs to implement the following interface.
See also
CConnecterThread CFrmViewer

Definition at line 44 of file Connect.h.

Member Enumeration Documentation

◆ OnInitReturnValue

enum class CConnect::OnInitReturnValue
strongprotected

Definition at line 94 of file Connect.h.

Constructor & Destructor Documentation

◆ CConnect()

CConnect::CConnect ( CConnecter pConnecter)
explicit
Parameters
pConnecter
parent

◆ ~CConnect()

CConnect::~CConnect ( )
overridevirtual

Definition at line 14 of file Connect.cpp.

Member Function Documentation

◆ Connect

int CConnect::Connect ( )
virtualslot

Start connect.

Based on the OnInit() return value, decide whether to start the timer to support no-qt event

Note
  • If the connection is asynchronous, sigConnected() is triggered after the connect is success.
  • If the connection is synchronous, sigConnected() is triggered after this function is successfully called.
Returns
  • = 0: success
  • < 0: error
See also
sigConnected()
OnInit() OnProcess() slotTimeOut()

Definition at line 77 of file Connect.cpp.

◆ Disconnect

int CConnect::Disconnect ( )
virtualslot

Disconnect.

Returns
0: success; other error
See also
sigDisconnected()

Definition at line 89 of file Connect.cpp.

◆ OnClean()

virtual int CConnect::OnClean ( )
protectedpure virtual

◆ OnInit()

virtual OnInitReturnValue CConnect::OnInit ( )
protectedpure virtual

Specific plug-in realizes connection initialization.

Returns
See also
Connect()

Implemented in CConnectFreeRDP, CConnectLibVNCServer, CConnectPlayer, and CConnectVnc.

◆ OnProcess()

int CConnect::OnProcess ( )
protectedvirtual

Specific operation processing of plug-in connection.

Returns
  • >= 0: continue, Interval call time (msec)
  • = -1: stop
  • < -1: error
See also
Connect() slotTimeOut()

Reimplemented in CConnectFreeRDP, CConnectLibVNCServer, and CConnectVnc.

Definition at line 127 of file Connect.cpp.

◆ SetConnecter()

int CConnect::SetConnecter ( CConnecter pConnecter)
private

Definition at line 19 of file Connect.cpp.

◆ sigBlockInputDialog

void CConnect::sigBlockInputDialog ( const QString &  szTitle,
const QString &  szLable,
const QString &  szMessage,
QString &  szText 
)
signal

Block background threads and display input dialogs in foreground threads (QInputDialog)

See also
CConnecter::slotBlockInputDialog() SetConnecter

◆ sigBlockShowMessageBox

void CConnect::sigBlockShowMessageBox ( const QString &  szTitle,
const QString &  szMessage,
QMessageBox::StandardButtons  buttons,
QMessageBox::StandardButton &  nRet,
bool &  checkBox,
QString  checkBoxContext = QString() 
)
signal

Block background threads and display message dialogs in foreground threads (QMessageBox)

Parameters
title
message
buttons
nRet
checkBox
checkBoxContext
See also
CConnecter::slotBlockShowMessageBox() SetConnecter

◆ sigBlockShowWidget

void CConnect::sigBlockShowWidget ( const QString &  className,
int &  nRet,
void *  pContext 
)
signal

Blocks the background thread and displays the window in the foreground thread.

Parameters
classNameshow windows class name The class must have follower public functions: Q_INVOKABLE void SetContext(void* pContext); Q_INVOKABLE void SetConnecter(CConnecter *pConnecter);
nRetIf className is QDialog derived class, QDialog::exec() return value. Otherwise, ignore
pContextpass context to CConnecter::slotBlockShowWidget()
See also
CConnecter::slotBlockShowWidget() SetConnecter

◆ sigConnected

void CConnect::sigConnected ( )
signal

Emitted when the plugin is successfully connected.

Emitted only by plugins

See also
Connect

◆ sigDisconnect

void CConnect::sigDisconnect ( )
signal

Notify the user to call disconnect.

Emitted only by plugins Emitted when you need to disconnect from the plug-in. For example, the peer disconnect or reset the connection or the connection is error

◆ sigDisconnected

void CConnect::sigDisconnected ( )
signal

Successful disconnection signal.

Triggered only by plugins

See also
Disconnect

◆ sigInformation

void CConnect::sigInformation ( const QString &  szInfo)
signal

Triggering from a background thread displays information in the main thread without blocking the background thread.

Note
It differs from sigShowMessageBox in that sigShowMessageBox is displayed in a dialog box
See also
sigShowMessageBox SetConnecter CConnecter::sigInformation()

◆ sigShowMessageBox

void CConnect::sigShowMessageBox ( const QString &  szTitle,
const QString &  szMessage,
const QMessageBox::Icon &  icon = QMessageBox::Information 
)
signal

Trigger the display of a message dialog (QMessageBox) in the main thread from a background thread without blocking the background thread.

Note
It differs from sigInformation in that sigInformation is not displayed in a dialog box
See also
sigInformation SetConnecter CConnecter::sigShowMessageBox()

◆ slotTimeOut

void CConnect::slotTimeOut ( )
protectedvirtualslot

a non-Qt event loop (that is, normal loop processing), It call OnProcess(), and start timer.

If CConnect don not have a non-Qt event loop, can override it, or OnInit() return >0

See also
Connect() OnProcess()

Definition at line 97 of file Connect.cpp.


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