玉兔远程控制 0.1.0-alpha.2
载入中...
搜索中...
未找到
信号 | Public 成员函数 | Protected 类型 | Protected 槽 | Protected 成员函数 | Private 成员函数 | 所有成员列表
CBackend类 参考abstract

后端接口。它由协议插件实现。 它默认启动一个定时器来开启一个非 Qt 事件循环(就是普通的循环处理)。 详见: Start()slotTimeOut()OnProcess() 。 当然,它仍然支持 Qt 事件(QObject 的 信号 - 槽 机制)。 更多...

#include <Backend.h>

类 CBackend 继承关系图:
Inheritance graph
[图例]
CBackend 的协作图:
Collaboration graph
[图例]

信号

void sigRunning ()
 当插件开始成功后触发。仅由插件触发
 
void sigStop ()
 需要通知用户停止时触发。仅由插件触发。 当从插件中需要停止时触发。例如:对端断开连接、重置连接或者连接出错。
 
void sigFinished ()
 停止成功信号。仅由插件触发
 
void sigError (const int nError, const QString &szError=QString())
 当有错误产生时触发
 
void sigInformation (const QString &szInfo)
 从后台线程中触发在主线程中显示信息,不阻塞后台线程
 
void sigShowMessageBox (const QString &szTitle, const QString &szMessage, const QMessageBox::Icon &icon=QMessageBox::Information)
 从后台线程中触发在主线程中显示消息对话框(QMessageBox),不阻塞后台线程
 
void sigBlockShowMessageBox (const QString &szTitle, const QString &szMessage, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton &nRet, bool &checkBox, QString checkBoxContext=QString())
 阻塞后台线程,并在前台线程中显示消息对话框(QMessageBox)
 
void sigBlockInputDialog (const QString &szTitle, const QString &szLable, const QString &szMessage, QString &szText)
 阻塞后台线程,并在前台线程中显示输入对话框 (QInputDialog)
 
void sigBlockShowWidget (const QString &className, int &nRet, void *pContext)
 阻塞后台线程,并在前台线程中显示窗口。
 

Public 成员函数

 CBackend (COperate *pOperate=nullptr)
 
virtual int Start ()
 开始。根据 OnInit() 返回值来决定是否开始定时器来支持非 qt 事件
 
virtual int Stop ()
 停止
 
virtual int WakeUp ()
 Wake up.
 

Protected 类型

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

Protected 槽

virtual void slotTimeOut ()
 一个非 Qt 事件处理,它调用 OnProcess(),并根据其返回值开始新的定时器。 如果是不是一个非 Qt 事件循环(就是普通的循环处理), 可以重载它,或者 OnInit() 返回值大于 0
 

Protected 成员函数

virtual OnInitReturnValue OnInit ()=0
 初始化
 
virtual int OnClean ()=0
 清理
 
virtual int OnProcess ()
 具体操作处理
 

Private 成员函数

int SetConnect (COperate *pOperate)
 

详细描述

后端接口。它由协议插件实现。 它默认启动一个定时器来开启一个非 Qt 事件循环(就是普通的循环处理)。 详见: Start()slotTimeOut()OnProcess() 。 当然,它仍然支持 Qt 事件(QObject 的 信号 - 槽 机制)。

注解
  • 这个接口仅由插件实现。
  • 如果是异步的(有后台线程),它的实例在后台线程中。
  • 具体的插件需要实现下面接口:
参见
CBackendThread::run() CFrmViewer

在文件 Backend.h41 行定义.

成员枚举类型说明

◆ OnInitReturnValue

enum class CBackend::OnInitReturnValue
strongprotected

在文件 Backend.h85 行定义.

构造及析构函数说明

◆ ~CBackend()

CBackend::~CBackend ( )
virtual

在文件 Backend.cpp17 行定义.

成员函数说明

◆ OnClean()

virtual int CBackend::OnClean ( )
protectedpure virtual

◆ OnInit()

virtual OnInitReturnValue CBackend::OnInit ( )
protectedpure virtual

初始化

返回
参见
Start()

CBackendFileTransfer, CBackendFreeRDP, CBackendLibVNCServer, CBackendPlayer, CBackendSSH , 以及 CBackendVnc 内被实现.

◆ OnProcess()

int CBackend::OnProcess ( )
protectedvirtual

具体操作处理

返回
  • >= 0: 继续。再次调用间隔时间,单位毫秒
  • = -1: 停止
  • < -1: 错误
参见
Start() slotTimeOut()

CBackendFileTransfer, CBackendFreeRDP, CBackendLibVNCServer, CBackendSSH , 以及 CBackendVnc 重载.

在文件 Backend.cpp135 行定义.

◆ SetConnect()

int CBackend::SetConnect ( COperate pOperate)
private

在文件 Backend.cpp22 行定义.

◆ sigBlockInputDialog

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

阻塞后台线程,并在前台线程中显示输入对话框 (QInputDialog)

参见
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

阻塞后台线程,并在前台线程中显示消息对话框(QMessageBox)

参见
COperate::slotBlockShowMessageBox() SetConnect

◆ sigBlockShowWidget

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

阻塞后台线程,并在前台线程中显示窗口。

参见
COperate::slotBlockShowWidget() SetConnect

◆ sigFinished

void CBackend::sigFinished ( )
signal

停止成功信号。仅由插件触发

参见
Stop

◆ sigInformation

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

从后台线程中触发在主线程中显示信息,不阻塞后台线程

注解
它与 sigShowMessageBox 的区别是 sigShowMessageBox 用对话框显示
参见
sigShowMessageBox SetConnect COperate::sigInformation()

◆ sigShowMessageBox

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

从后台线程中触发在主线程中显示消息对话框(QMessageBox),不阻塞后台线程

注解
它与 sigInformation 区别是,sigInformation 不用对话框显示
参见
sigInformation SetConnect COperate::sigShowMessageBox()

◆ slotTimeOut

void CBackend::slotTimeOut ( )
protectedvirtualslot

一个非 Qt 事件处理,它调用 OnProcess(),并根据其返回值开始新的定时器。 如果是不是一个非 Qt 事件循环(就是普通的循环处理), 可以重载它,或者 OnInit() 返回值大于 0

参见
Start() OnProcess()

在文件 Backend.cpp105 行定义.

◆ Start()

int CBackend::Start ( )
virtual

开始。根据 OnInit() 返回值来决定是否开始定时器来支持非 qt 事件

注解
  • 如果是异步的,开始成功后触发 sigRunning()
  • 如果是同步的,则在此函数成功调用后,触发 sigRunning()
返回
  • = 0: success
  • < 0: error
参见
sigRunning()
OnInit() OnProcess() slotTimeOut()

在文件 Backend.cpp80 行定义.

◆ Stop()

int CBackend::Stop ( )
virtual

停止

返回
0: success; other error
参见
sigFinished()

在文件 Backend.cpp92 行定义.

◆ WakeUp()

int CBackend::WakeUp ( )
virtual

Wake up.

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

CBackendFreeRDP, CBackendLibVNCServer, CBackendSSH, CBackendVnc , 以及 CBackendDesktop 重载.

在文件 Backend.cpp100 行定义.


该类的文档由以下文件生成: