Backend interface.
More...
#include <Backend.h>
|
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.
|
|
|
| CBackend (COperate *pOperate=nullptr) |
|
virtual int | Start () |
| Start.
|
|
virtual int | Stop () |
| Stop.
|
|
virtual int | WakeUp () |
| Wake up.
|
|
|
enum class | OnInitReturnValue { Fail = -1
, Success = 0
, UseOnProcess = Success
, NotUseOnProcess = 1
} |
|
|
virtual void | slotTimeOut () |
| a non-Qt event loop (that is, normal loop processing), It call OnProcess(), and start timer.
|
|
|
virtual OnInitReturnValue | OnInit ()=0 |
| Initialization.
|
|
virtual int | OnClean ()=0 |
| Clean.
|
|
virtual int | OnProcess () |
| Specific operation processing of plug-in.
|
|
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.
◆ OnInitReturnValue
enum class CBackend::OnInitReturnValue |
|
strongprotected |
◆ ~CBackend()
◆ OnClean()
virtual int CBackend::OnClean |
( |
| ) |
|
|
protectedpure virtual |
◆ OnInit()
virtual OnInitReturnValue CBackend::OnInit |
( |
| ) |
|
|
protectedpure virtual |
◆ OnProcess()
int CBackend::OnProcess |
( |
| ) |
|
|
protectedvirtual |
◆ SetConnect()
int CBackend::SetConnect |
( |
COperate * |
pOperate | ) |
|
|
private |
◆ sigBlockInputDialog
void CBackend::sigBlockInputDialog |
( |
const QString & |
szTitle, |
|
|
const QString & |
szLable, |
|
|
const QString & |
szMessage, |
|
|
QString & |
szText |
|
) |
| |
|
signal |
◆ 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
-
className | show windows class name The class must have follower public functions: Q_INVOKABLE void SetContext(void* pContext); |
nRet | If className is QDialog derived class, QDialog::exec() return value. Otherwise, ignore |
pContext | pass 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 |
◆ Start()
◆ Stop()
◆ WakeUp()
The documentation for this class was generated from the following files:
- /home/runner/work/RabbitRemoteControl/RabbitRemoteControl/Src/Backend.h
- /home/runner/work/RabbitRemoteControl/RabbitRemoteControl/Src/Backend.cpp