Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members

manage plugins and connecter More...

#include <Client.h>

Inheritance diagram for CClient:

Classes

class  Handle
 The Handle CConnecter class. More...
 

Public Member Functions

 CClient (QObject *parent=nullptr)
 
virtual CConnecterCreateConnecter (const QString &id)
 New CConnecter pointer, the owner is caller.
 
virtual int DeleteConnecter (CConnecter *p)
 Delete CConnecter.
 
virtual CConnecterLoadConnecter (const QString &szFile)
 New CConnecter pointer from file, the owner is caller.
 
virtual int SaveConnecter (QString szFile, CConnecter *pConnecter)
 Accept connecter parameters to file.
 
virtual QList< QWidget * > GetSettingsWidgets (QWidget *parent)
 Get parameter settings widget.
 
virtual int LoadSettings (QString szFile=QString())
 Load Client parameters from file.
 
virtual int SaveSettings (QString szFile=QString())
 Save Client parameters to file.
 
virtual int EnumPlugins (Handle *handle)
 Enum plugins.
 
virtual int EnumPlugins (std::function< int(const QString &id, CPluginClient *pPlug)> cb)
 Enum plugins.
 
const QString Details () const
 
virtual bool eventFilter (QObject *watched, QEvent *event) override
 

Private Slots

void slotHookKeyboardChanged ()
 

Private Member Functions

int LoadPlugins ()
 
int FindPlugins (QDir dir, QStringList filters)
 
int AppendPlugin (CPluginClient *plugin)
 

Private Attributes

QMap< QString, CPluginClient * > m_Plugins
 
qint8 m_FileVersion
 
QSharedPointer< QTranslator > m_Translator
 
QSharedPointer< CHookm_Hook
 
CParameterClientm_pParameterClient
 
QString m_szDetails
 

Detailed Description

manage plugins and connecter

See also
CPluginClient CConnecter

Definition at line 48 of file Client.h.

Constructor & Destructor Documentation

◆ ~CClient()

CClient::~CClient ( )
virtual

Definition at line 52 of file Client.cpp.

Member Function Documentation

◆ AppendPlugin()

int CClient::AppendPlugin ( CPluginClient plugin)
private

Definition at line 175 of file Client.cpp.

◆ CreateConnecter()

CConnecter * CClient::CreateConnecter ( const QString &  id)
virtual

New CConnecter pointer, the owner is caller.

[CClient CreateConnecter]

The caller must be call CConnecter::sigDisconnected() to delete it, when it isn't need. The caller must connect CConnecter::sigDisconnected, then delete it(Use DeleteConnecter() )

Parameters
idPlugin ID
See also
DeleteConnecter

Definition at line 202 of file Client.cpp.

◆ DeleteConnecter()

int CClient::DeleteConnecter ( CConnecter p)
virtual

Delete CConnecter.

[CClient CreateConnecter]

Definition at line 256 of file Client.cpp.

◆ Details()

const QString CClient::Details ( ) const

Definition at line 408 of file Client.cpp.

◆ EnumPlugins() [1/2]

int CClient::EnumPlugins ( Handle handle)
virtual

Enum plugins.

Definition at line 380 of file Client.cpp.

◆ EnumPlugins() [2/2]

virtual int CClient::EnumPlugins ( std::function< int(const QString &id, CPluginClient *pPlug)>  cb)
virtual

Enum plugins.

Note
It is need c++ standard 11
Parameters
cbProcess plugins callback function
idplugin id
pPlugCPluginClient pointer

◆ eventFilter()

bool CClient::eventFilter ( QObject *  watched,
QEvent *  event 
)
overridevirtual

Definition at line 424 of file Client.cpp.

◆ FindPlugins()

int CClient::FindPlugins ( QDir  dir,
QStringList  filters 
)
private

Definition at line 108 of file Client.cpp.

◆ GetSettingsWidgets()

QList< QWidget * > CClient::GetSettingsWidgets ( QWidget *  parent)
virtual

Get parameter settings widget.

Returns
Parameter widget. The QWidget owner is caller.
Note
The widget must be a derivative of CParameterUI. Eg: CFrmParameterClient

Usage:

void MainWindow::on_actionSettings_triggered()
{
CParameterDlgSettings set(&m_Parameter, m_Client.GetSettingsWidgets(this), this);
if(CParameterDlgSettings::Accepted == RC_SHOW_WINDOW(&set))
{
m_Client.SaveSettings();
m_Parameter.Save();
}
}

Connect the signal(accepted) to the slot(slotAccept) in CParameterDlgSettings

foreach(auto p, wViewer)
{
ui->tabWidget->addTab(p, p->windowIcon(), p->windowTitle());
bool check = false;
check = connect(this, SIGNAL(accepted()), p, SLOT(slotAccept()));
if(!check)
{
qCritical(log) << "Class" << p->metaObject()->className()
<< "must has slot slotAccept(), please add it";
}
Q_ASSERT(check);
}
See also
CFrmParameterClient CParameterDlgSettings

Definition at line 361 of file Client.cpp.

◆ LoadConnecter()

CConnecter * CClient::LoadConnecter ( const QString &  szFile)
virtual

New CConnecter pointer from file, the owner is caller.

The caller must delete it(call DeleteConnecter()), when it isn't need. The caller must connect CConnecter::sigDisconnected, then delete it (Use DeleteConnecter() )

See also
DeleteConnecter

Definition at line 273 of file Client.cpp.

◆ LoadPlugins()

int CClient::LoadPlugins ( )
private

Definition at line 71 of file Client.cpp.

◆ LoadSettings()

int CClient::LoadSettings ( QString  szFile = QString())
virtual

Load Client parameters from file.

Parameters
szFilefile name

Definition at line 351 of file Client.cpp.

◆ SaveConnecter()

int CClient::SaveConnecter ( QString  szFile,
CConnecter pConnecter 
)
virtual

Accept connecter parameters to file.

Definition at line 308 of file Client.cpp.

◆ SaveSettings()

int CClient::SaveSettings ( QString  szFile = QString())
virtual

Save Client parameters to file.

Parameters
szFilefile name

Definition at line 356 of file Client.cpp.

◆ slotHookKeyboardChanged

void CClient::slotHookKeyboardChanged ( )
privateslot

Definition at line 413 of file Client.cpp.

Member Data Documentation

◆ m_FileVersion

qint8 CClient::m_FileVersion
private

Definition at line 191 of file Client.h.

◆ m_Hook

QSharedPointer<CHook> CClient::m_Hook
private

Definition at line 193 of file Client.h.

◆ m_Plugins

QMap<QString, CPluginClient*> CClient::m_Plugins
private

Definition at line 190 of file Client.h.

◆ m_pParameterClient

CParameterClient* CClient::m_pParameterClient
private

Definition at line 194 of file Client.h.

◆ m_szDetails

QString CClient::m_szDetails
private

Definition at line 195 of file Client.h.

◆ m_Translator

QSharedPointer<QTranslator> CClient::m_Translator
private

Definition at line 192 of file Client.h.


The documentation for this class was generated from the following files: