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

Backend interface. More...

#include <Backend.h>

Inheritance diagram for CBackend:
Inheritance graph
[legend]
Collaboration diagram for CBackend:
Collaboration graph
[legend]

Signals

void sigRunning ()
 Emitted when the plugin is successfully started.
 
void sigStop ()
 Notify the user to stop.
 
void sigFinished ()
 Successful stopped 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

 CBackend (COperate *pOperate=nullptr)
 
virtual int Start ()
 Start.
 
virtual int Stop ()
 Stop.
 
virtual int WakeUp ()
 Wake up.
 

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
 Initialization.
 
virtual int OnClean ()=0
 Clean.
 
virtual int OnProcess ()
 Specific operation processing of plug-in.
 

Private Member Functions

int SetConnect (COperate *pOperate)
 

Detailed Description

Backend 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 Start(), 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
CBackendThread::run() CFrmViewer

Definition at line 41 of file Backend.h.

Member Enumeration Documentation

◆ OnInitReturnValue

enum class CBackend::OnInitReturnValue
strongprotected

Definition at line 85 of file Backend.h.

Constructor & Destructor Documentation

◆ ~CBackend()

CBackend::~CBackend ( )
virtual

Definition at line 17 of file Backend.cpp.

Member Function Documentation

◆ OnClean()

virtual int CBackend::OnClean ( )
protectedpure virtual

◆ OnInit()

virtual OnInitReturnValue CBackend::OnInit ( )
protectedpure virtual

Initialization.

Returns
See also
Start()

Implemented in CBackendFileTransfer, CBackendFreeRDP, CBackendLibVNCServer, CBackendPlayer, CBackendSSH, and CBackendVnc.

◆ OnProcess()

int CBackend::OnProcess ( )
protectedvirtual

Specific operation processing of plug-in.

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

Reimplemented in CBackendFileTransfer, CBackendFreeRDP, CBackendLibVNCServer, CBackendSSH, and CBackendVnc.

Definition at line 135 of file Backend.cpp.

◆ SetConnect()

int CBackend::SetConnect ( COperate pOperate)
private

Definition at line 22 of file Backend.cpp.

◆ sigBlockInputDialog

void CBackend::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
COperate::slotBlockInputDialog() SetConnect

◆ sigBlockShowMessageBox

void CBackend::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
COperate::slotBlockShowMessageBox() SetConnect

◆ sigBlockShowWidget

void CBackend::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);
nRetIf className is QDialog derived class, QDialog::exec() return value. Otherwise, ignore
pContextpass context to COperate::slotBlockShowWidget()
See also
COperate::slotBlockShowWidget() SetConnect

◆ sigFinished

void CBackend::sigFinished ( )
signal

Successful stopped signal.

Triggered only by plugins

See also
Stop

◆ sigInformation

void CBackend::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 SetConnect COperate::sigInformation()

◆ sigRunning

void CBackend::sigRunning ( )
signal

Emitted when the plugin is successfully started.

Emitted only by plugins

See also
Start()

◆ sigShowMessageBox

void CBackend::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 SetConnect COperate::sigShowMessageBox()

◆ sigStop

void CBackend::sigStop ( )
signal

Notify the user to stop.

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

◆ slotTimeOut

void CBackend::slotTimeOut ( )
protectedvirtualslot

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

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

See also
Start() OnProcess()

Definition at line 105 of file Backend.cpp.

◆ Start()

int CBackend::Start ( )
virtual

Start.

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

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

Definition at line 80 of file Backend.cpp.

◆ Stop()

int CBackend::Stop ( )
virtual

Stop.

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

Definition at line 92 of file Backend.cpp.

◆ WakeUp()

int CBackend::WakeUp ( )
virtual

Wake up.

When it is block(a non-Qt event loop)

Reimplemented in CBackendFreeRDP, CBackendLibVNCServer, CBackendSSH, CBackendVnc, and CBackendDesktop.

Definition at line 100 of file Backend.cpp.


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