Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
Connect.h
1// Author: Kang Lin <kl222@126.com>
2
3#ifndef CCONNECT_H
4#define CCONNECT_H
5
6#pragma once
7
8#include <QMessageBox>
9#include "Connecter.h"
10
44class CLIENT_EXPORT CConnect : public QObject
45{
46 Q_OBJECT
47
48public:
58 explicit CConnect(CConnecter* pConnecter);
59 virtual ~CConnect() override;
60
61public Q_SLOTS:
83 virtual int Connect();
91 virtual int Disconnect();
92
93protected:
94 enum class OnInitReturnValue {
95 Fail = -1,
96 Success = 0,
97 UseOnProcess = Success,
98 NotUseOnProcess = 1,
99 };
116 virtual OnInitReturnValue OnInit() = 0;
123 virtual int OnClean() = 0;
139 virtual int OnProcess();
140
141protected Q_SLOTS:
155 virtual void slotTimeOut();
156
157Q_SIGNALS:
186 void sigError(const int nError, const QString &szError = QString());
199 void sigInformation(const QString& szInfo);
215 void sigShowMessageBox(const QString& szTitle, const QString& szMessage,
216 const QMessageBox::Icon& icon = QMessageBox::Information);
217
235 void sigBlockShowMessageBox(const QString& szTitle,
236 const QString& szMessage,
237 QMessageBox::StandardButtons buttons,
238 QMessageBox::StandardButton& nRet,
239 bool &checkBox,
240 QString checkBoxContext = QString());
250 void sigBlockInputDialog(const QString& szTitle,
251 const QString& szLable,
252 const QString& szMessage,
253 QString& szText
254 );
273 void sigBlockShowWidget(const QString& className, int &nRet, void* pContext);
274
275private:
276 int SetConnecter(CConnecter* pConnecter);
277};
278
279#endif // CCONNECT_H
Connect interface.
Definition Connect.h:45
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 back...
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 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 wit...
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 sigConnected()
Emitted when the plugin is successfully connected.
void sigDisconnect()
Notify the user to call disconnect.
virtual OnInitReturnValue OnInit()=0
Specific plug-in realizes connection initialization.
CConnect(CConnecter *pConnecter)
virtual int OnClean()=0
Clean.
void sigDisconnected()
Successful disconnection signal.
void sigBlockShowWidget(const QString &className, int &nRet, void *pContext)
Blocks the background thread and displays the window in the foreground thread.
Connecter interface.
Definition Connecter.h:62