连接者应用接口。
更多...
#include <Connecter.h>
|
void | sigConnected () |
| 连接成功信号。仅由插件触发。 应用程序需要在此时设置视图属性 Enabled 为 true 。允许接收键盘和鼠标事件
|
|
void | sigDisconnect () |
| 通知用户断开连接。仅由插件触发。 当从插件中需要要断开连接时触发。例如:对端断开连接、重置连接或者连接出错。 当应用接收到此信号后,调用 DisConnect() 关闭连接。
|
|
void | sigDisconnected () |
| 断开连接成功信号。仅由插件触发
|
|
void | sigUpdateName (const QString &szName) |
|
void | sigUpdateParameters (CConnecter *pConnecter) |
| 更新参数,通知应用程序保存或显示参数
|
|
void | sigError (const int nError, const QString &szError) |
| 当有错误产生时触发。
|
|
void | sigInformation (const QString &szInfo) |
| 中主窗口中显示信息
|
|
void | sigShowMessageBox (const QString &title, const QString &message, const QMessageBox::Icon &icon=QMessageBox::Information) |
| 从后台线程中触发在主线程中显示消息对话框(QMessageBox),不阻塞后台线程
|
|
void | sigClipBoardChanged () |
|
|
static QObject * | createObject (const QString &className, QObject *parent=NULL) |
|
|
void | slotShowServerName () |
|
void | slotUpdateName () |
|
virtual void | slotBlockShowWidget (const QString &className, int &nRet, void *pContext) |
| 阻塞后台线程,并在前台线程中显示窗口。
|
|
virtual void | slotBlockShowMessageBox (const QString &szTitle, const QString &szMessage, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton &nRet, bool &checkBox, QString szCheckBoxContext=QString()) |
| 阻塞后台线程,并在前台线程中显示消息对话框(QMessageBox)
|
|
virtual void | slotBlockInputDialog (const QString &szTitle, const QString &szLable, const QString &szMessage, QString &szText) |
| Block background threads and display input dialogs in foreground threads (QInputDialog)
|
|
virtual void | slotSetClipboard (QMimeData *data) |
|
virtual void | slotSettings () |
|
连接者应用接口。
- 注解
- 此接口仅由是用户使用。它由插件实现。
- 它的实例在主线程中。
序列图:
已经提供以下类型的基本实现:
- 桌面类连接:
1.1. 用于连接是阻塞模型(一个后台线程处理一个连接): CConnecterThread
1.2. 用于连接是非阻塞模型(一个后台线程处理多个连接): CConnecterConnect
- 工具类:
2.1. 用于连接是非阻塞模型(在主线程): CConnecterConnect
- 控制台类连接:CConnecterTerminal
- 参见
- CPluginClient
在文件 Connecter.h 第 61 行定义.
◆ CConnecter()
◆ ~CConnecter()
CConnecter::~CConnecter |
( |
| ) |
|
|
virtual |
◆ Clean()
virtual Q_INVOKABLE int CConnecter::Clean |
( |
| ) |
|
|
privatepure virtual |
◆ Connect
virtual int CConnecter::Connect |
( |
| ) |
|
|
pure virtualslot |
◆ createObject()
QObject * CConnecter::createObject |
( |
const QString & |
className, |
|
|
QObject * |
parent = NULL |
|
) |
| |
|
staticprotected |
◆ Description()
const QString CConnecter::Description |
( |
| ) |
|
|
virtual |
◆ DisConnect
virtual int CConnecter::DisConnect |
( |
| ) |
|
|
pure virtualslot |
◆ GetMenu()
QMenu * CConnecter::GetMenu |
( |
QWidget * |
parent = nullptr | ) |
|
|
virtual |
◆ GetParameter()
◆ GetPlugClient()
◆ GetViewer()
virtual QWidget * CConnecter::GetViewer |
( |
| ) |
|
|
pure virtual |
◆ Icon()
const QIcon CConnecter::Icon |
( |
| ) |
const |
|
virtual |
◆ Id()
const QString CConnecter::Id |
( |
| ) |
|
|
virtual |
◆ Initial()
virtual Q_INVOKABLE int CConnecter::Initial |
( |
| ) |
|
|
privatepure virtual |
◆ Load() [1/2]
int CConnecter::Load |
( |
QSettings & |
set | ) |
|
|
protectedvirtual |
◆ Load() [2/2]
int CConnecter::Load |
( |
QString |
szFile = QString() | ) |
|
|
protectedvirtual |
◆ Name()
const QString CConnecter::Name |
( |
| ) |
|
|
virtual |
◆ OnOpenDialogSettings()
virtual QDialog * CConnecter::OnOpenDialogSettings |
( |
QWidget * |
parent = nullptr | ) |
|
|
privatepure virtual |
◆ OpenDialogSettings()
int CConnecter::OpenDialogSettings |
( |
QWidget * |
parent = nullptr | ) |
|
|
virtual |
打开设置对话框
- 参数
-
- 返回
- DialogCode
- QDialog::Accepted: 接收
- QDialog::Rejected: 拒绝
- -1: 错误
在文件 Connecter.cpp 第 93 行定义.
◆ Protocol()
const QString CConnecter::Protocol |
( |
| ) |
const |
|
virtual |
◆ Save() [1/2]
int CConnecter::Save |
( |
QSettings & |
set | ) |
|
|
protectedvirtual |
◆ Save() [2/2]
int CConnecter::Save |
( |
QString |
szFile = QString() | ) |
|
|
protectedvirtual |
◆ SetParameter()
◆ SetParameterClient()
◆ sigConnected
void CConnecter::sigConnected |
( |
| ) |
|
|
signal |
连接成功信号。仅由插件触发。 应用程序需要在此时设置视图属性 Enabled 为 true 。允许接收键盘和鼠标事件
- 参见
- MainWindow::slotConnected() GetViewer() CFrmViewer::CFrmViewer
{
if(!p) return;
slotLoadConnecterMenu();
slotInformation(tr(
"Connected to ") + p->
Name());
qDebug(log) <<
"MainWindow::slotConnected()" << p->
Name();
}
virtual const QString Name()
Name
void slotConnected()
[MainWindow slotConnected]
◆ sigDisconnected
void CConnecter::sigDisconnected |
( |
| ) |
|
|
signal |
断开连接成功信号。仅由插件触发
- 参见
- Disconnect()
◆ sigInformation
void CConnecter::sigInformation |
( |
const QString & |
szInfo | ) |
|
|
signal |
◆ sigShowMessageBox
void CConnecter::sigShowMessageBox |
( |
const QString & |
title, |
|
|
const QString & |
message, |
|
|
const QMessageBox::Icon & |
icon = QMessageBox::Information |
|
) |
| |
|
signal |
◆ sigUpdateName
void CConnecter::sigUpdateName |
( |
const QString & |
szName | ) |
|
|
signal |
◆ sigUpdateParameters
void CConnecter::sigUpdateParameters |
( |
CConnecter * |
pConnecter | ) |
|
|
signal |
◆ slotBlockInputDialog
void CConnecter::slotBlockInputDialog |
( |
const QString & |
szTitle, |
|
|
const QString & |
szLable, |
|
|
const QString & |
szMessage, |
|
|
QString & |
szText |
|
) |
| |
|
privatevirtualslot |
Block background threads and display input dialogs in foreground threads (QInputDialog)
- 参见
- CConnecter::sigBlockInputDialog() SetConnecter
在文件 Connecter.cpp 第 312 行定义.
◆ slotBlockShowMessageBox
void CConnecter::slotBlockShowMessageBox |
( |
const QString & |
szTitle, |
|
|
const QString & |
szMessage, |
|
|
QMessageBox::StandardButtons |
buttons, |
|
|
QMessageBox::StandardButton & |
nRet, |
|
|
bool & |
checkBox, |
|
|
QString |
szCheckBoxContext = QString() |
|
) |
| |
|
privatevirtualslot |
◆ slotBlockShowWidget
void CConnecter::slotBlockShowWidget |
( |
const QString & |
className, |
|
|
int & |
nRet, |
|
|
void * |
pContext |
|
) |
| |
|
privatevirtualslot |
◆ slotSetClipboard
void CConnecter::slotSetClipboard |
( |
QMimeData * |
data | ) |
|
|
privatevirtualslot |
◆ slotSettings
void CConnecter::slotSettings |
( |
| ) |
|
|
privatevirtualslot |
◆ slotShowServerName
void CConnecter::slotShowServerName |
( |
| ) |
|
|
privateslot |
◆ slotUpdateName
void CConnecter::slotUpdateName |
( |
| ) |
|
|
privateslot |
◆ Version()
virtual qint16 CConnecter::Version |
( |
| ) |
|
|
pure virtual |
◆ m_Menu
◆ m_pParameter
◆ m_pPluginClient
◆ m_pSettings
QAction* CConnecter::m_pSettings |
|
protected |
该类的文档由以下文件生成:
- /home/runner/work/RabbitRemoteControl/RabbitRemoteControl/Client/Connecter.h
- /home/runner/work/RabbitRemoteControl/RabbitRemoteControl/Client/Connecter.cpp