Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
Connecter.h
1// Author: Kang Lin <kl222@126.com>
2
3#ifndef CCONNECTER_H
4#define CCONNECTER_H
5
6#pragma once
7
8#include <QObject>
9#include <QDir>
10#include <QtPlugin>
11#include <QDataStream>
12#include <QDialog>
13#include <QIcon>
14#include <QMimeData>
15#include <QSettings>
16#include <QMessageBox>
17#include <QMenu>
18
19#include "client_export.h"
20#include "ParameterClient.h"
21
22class CPluginClient;
23
61class CLIENT_EXPORT CConnecter : public QObject
62{
63 Q_OBJECT
64
65public:
87 explicit CConnecter(CPluginClient *plugin);
88 virtual ~CConnecter();
89
91 virtual const QString Id();
93 virtual const QString Name();
95 virtual const QString Description();
97 virtual const QString Protocol() const;
99 virtual qint16 Version() = 0;
101 virtual const QIcon Icon() const;
102
115 virtual QWidget* GetViewer() = 0;
133 virtual int OpenDialogSettings(QWidget* parent = nullptr);
137 virtual QMenu* GetMenu(QWidget* parent = nullptr);
138
139public Q_SLOTS:
154 virtual int Connect() = 0;
170 virtual int DisConnect() = 0;
171
172Q_SIGNALS:
209 void sigUpdateName(const QString& szName);
227 void sigError(const int nError, const QString &szError);
240 void sigInformation(const QString& szInfo);
255 void sigShowMessageBox(const QString& title, const QString& message,
256 const QMessageBox::Icon& icon = QMessageBox::Information);
257
258private:
264 Q_INVOKABLE virtual int Initial() = 0;
269 Q_INVOKABLE virtual int Clean() = 0;
276 Q_INVOKABLE virtual int SetParameterClient(CParameterClient* pPara);
277protected:
291 virtual int SetParameter(CParameter* p);
292 CParameter* GetParameter();
293
294protected:
295 Q_INVOKABLE CPluginClient* GetPlugClient() const;
296
297 static QObject* createObject(const QString &className, QObject* parent = NULL);
298
299private:
316 virtual QDialog* OnOpenDialogSettings(QWidget* parent = nullptr) = 0;
317
318protected:
323 virtual int Load(QSettings &set);
328 virtual int Save(QSettings &set);
335 Q_INVOKABLE virtual int Load(QString szFile = QString());
344 Q_INVOKABLE virtual int Save(QString szFile = QString());
345
346private Q_SLOTS:
347 void slotShowServerName();
348 void slotUpdateName();
349
367 virtual void slotBlockShowWidget(const QString& className, int &nRet, void* pContext);
378 virtual void slotBlockShowMessageBox(const QString& szTitle,
379 const QString& szMessage,
380 QMessageBox::StandardButtons buttons,
381 QMessageBox::StandardButton& nRet,
382 bool &checkBox,
383 QString szCheckBoxContext = QString());
389 virtual void slotBlockInputDialog(const QString& szTitle,
390 const QString& szLable,
391 const QString& szMessage,
392 QString& szText
393 );
394
395private Q_SLOTS:
398 virtual void slotSetClipboard(QMimeData *data);
399private:
400Q_SIGNALS:
401 void sigClipBoardChanged();
402
403protected:
404 QMenu m_Menu;
405 QAction* m_pSettings;
406private Q_SLOTS:
407 virtual void slotSettings();
408
409private:
410 CPluginClient* m_pPluginClient;
411
412 // The owner is a derived class of this class
413 CParameter* m_pParameter;
414};
415
416#endif // CCONNECTER_H
Connecter interface.
Definition Connecter.h:62
void sigUpdateName(const QString &szName)
virtual Q_INVOKABLE int Initial()=0
Initial parameters and resource.
virtual int DisConnect()=0
Close connect.
void sigConnected()
Successful connection signal.
virtual Q_INVOKABLE int Clean()=0
Clean parameters and resource.
virtual QDialog * OnOpenDialogSettings(QWidget *parent=nullptr)=0
Open settgins dialog.
CConnecter(CPluginClient *plugin)
virtual qint16 Version()=0
Version.
virtual QWidget * GetViewer()=0
Get Viewer.
void sigDisconnected()
Successful disconnection signal.
void sigDisconnect()
Notify the user to disconnect.
void sigError(const int nError, const QString &szError)
Triggered when an error is generated.
void sigShowMessageBox(const QString &title, const QString &message, const QMessageBox::Icon &icon=QMessageBox::Information)
Trigger the display of a message dialog (QMessageBox) in the main thread from a background thread wit...
virtual int Connect()=0
Start connect.
void sigInformation(const QString &szInfo)
Show information in main windows.
void sigUpdateParameters(CConnecter *pConnecter)
Update parameters, notify application to save or show parameters.
The parameters of client.
Parameter interface.
Definition Parameter.h:169
The plugin interface.