Rabbit Remote Control 0.0.37
Loading...
Searching...
No Matches
Backend.h
1// Author: Kang Lin <kl222@126.com>
2
3#pragma once
4
5#include <QObject>
6#include "Operate.h"
7
41class PLUGIN_EXPORT CBackend : public QObject
42{
43 Q_OBJECT
44public:
45 explicit CBackend(COperate *pOperate = nullptr);
46 virtual ~CBackend();
47
48public:
70 virtual int Start();
78 virtual int Stop();
82 virtual int WakeUp();
83
84protected:
85 enum class OnInitReturnValue {
86 Fail = -1,
87 Success = 0,
88 UseOnProcess = Success,
89 NotUseOnProcess = 1,
90 };
107 [[nodiscard]] virtual OnInitReturnValue OnInit() = 0;
114 virtual int OnClean() = 0;
130 [[nodiscard]] virtual int OnProcess();
131
132protected Q_SLOTS:
146 virtual void slotTimeOut();
147
148Q_SIGNALS:
165 void sigStop();
177 void sigError(const int nError, const QString &szError = QString());
190 void sigInformation(const QString& szInfo);
206 void sigShowMessageBox(const QString& szTitle, const QString& szMessage,
207 const QMessageBox::Icon& icon = QMessageBox::Information);
208
226 void sigBlockShowMessageBox(const QString& szTitle,
227 const QString& szMessage,
228 QMessageBox::StandardButtons buttons,
229 QMessageBox::StandardButton& nRet,
230 bool &checkBox,
231 QString checkBoxContext = QString());
241 void sigBlockInputDialog(const QString& szTitle,
242 const QString& szLable,
243 const QString& szMessage,
244 QString& szText
245 );
263 void sigBlockShowWidget(const QString& className, int &nRet, void* pContext);
264
265private:
266 int SetConnect(COperate* pOperate);
267};
Backend interface.
Definition Backend.h:42
void sigInformation(const QString &szInfo)
Triggering from a background thread displays information in the main thread without blocking the back...
void sigStop()
Notify the user to stop.
virtual OnInitReturnValue OnInit()=0
Initialization.
virtual int OnClean()=0
Clean.
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 sigError(const int nError, const QString &szError=QString())
Triggered when an error is generated.
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 sigRunning()
Emitted when the plugin is successfully started.
void sigFinished()
Successful stopped signal.
void sigBlockShowWidget(const QString &className, int &nRet, void *pContext)
Blocks the background thread and displays the window in the foreground thread.
void sigBlockInputDialog(const QString &szTitle, const QString &szLable, const QString &szMessage, QString &szText)
Block background threads and display input dialogs in foreground threads (QInputDialog)
Operate interface.
Definition Operate.h:50