Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CPluginClient Class Referenceabstract

The plugin interface. More...

#include <PluginClient.h>

Inheritance diagram for CPluginClient:
CPluginClientThread CPluginFreeRDP CPluginLibSSH CPluginLibVNCServer CPluginPlayer CPluginRabbitVNC CPluginScreenCapture CPluginTelnet CPluginTerminal CPluginTigerVnc CPluginWakeOnLan

Public Member Functions

 CPluginClient (QObject *parent=nullptr)
 When the derived class is implemented, The plugin global resources are initialized are loaded here.
 
virtual ~CPluginClient ()
 When the derived class is implemented, the resources are clean are unloaded here.
 
virtual const QString Id () const
 ID. Default: Protocol() + ":" + Name()
 
virtual const QString Protocol () const =0
 Plugin Protocol.
 
virtual const QString Name () const =0
 This name must be the same as the project name (${PROJECT_NAME}). The translation file (${PROJECT_NAME}_*.ts)) name is associated with it.
 
virtual const QString DisplayName () const
 The plugin display name.
 
virtual const QString Description () const =0
 Plugin description.
 
virtual const QString Version () const =0
 Version.
 
virtual const QIcon Icon () const
 
virtual const QString Details () const
 Display more information in About dialog or log.
 

Private Member Functions

virtual Q_INVOKABLE CConnecterCreateConnecter (const QString &szId)=0
 New CConnecter instance.
 
Q_INVOKABLE int InitTranslator ()
 Initialize the translation resource, which is only called by CClient.
 

Private Attributes

QSharedPointer< QTranslator > m_Translator
 

Detailed Description

The plugin interface.

Create CConnecter instance. The interface only is implemented by plug-in.

See also
CClient CConnecterThread CConnecter CPluginClientThread

Definition at line 32 of file PluginClient.h.

Constructor & Destructor Documentation

◆ CPluginClient()

CPluginClient::CPluginClient ( QObject *  parent = nullptr)
explicit

When the derived class is implemented, The plugin global resources are initialized are loaded here.

eg:

: CPluginClient(parent)
{
qDebug(log) << Q_FUNC_INFO;
qInfo(log) << "FreeRDP version:" << freerdp_get_version_string()
<< "revision:" << freerdp_get_build_revision();
static wLogCallbacks* pCbLog = new wLogCallbacks;
BOOL bRet = WLog_SetLogAppenderType(WLog_GetRoot(), WLOG_APPENDER_CALLBACK);
if(bRet && pCbLog)
{
memset(pCbLog, 0, sizeof(wLogCallbacks));
pCbLog->message = [](const wLogMessage* msg)->BOOL{
switch(msg->Level)
{
case WLOG_TRACE:
break;
case WLOG_DEBUG:
qDebug(LoggerFreeRDP) /*<< msg->PrefixString */ << msg->TextString;
break;
case WLOG_INFO:
qInfo(LoggerFreeRDP) /*<< msg->PrefixString*/ << msg->TextString;
break;
case WLOG_WARN:
qWarning(LoggerFreeRDP) /*<< msg->PrefixString */<< msg->TextString;
case WLOG_ERROR:
qCritical(LoggerFreeRDP) /*<< msg->PrefixString*/ << msg->TextString;
break;
case WLOG_FATAL:
case WLOG_OFF:
qFatal(msg->FormatString, msg->TextString);
break;
default:
break;
}
return TRUE;
};
WLog_ConfigureAppender(WLog_GetLogAppender(WLog_GetRoot()), "callbacks", pCbLog);
}
WLog_SetLogLevel(WLog_GetRoot(), WLOG_TRACE);
}
The plugin interface.
CPluginFreeRDP(QObject *parent=nullptr)
[Initialize resource]

◆ ~CPluginClient()

CPluginClient::~CPluginClient ( )
virtual

When the derived class is implemented, the resources are clean are unloaded here.

eg:

{
qDebug(log) << Q_FUNC_INFO;
}
virtual ~CPluginFreeRDP() override
[Initialize resource]

Definition at line 17 of file PluginClient.cpp.

Member Function Documentation

◆ CreateConnecter()

virtual Q_INVOKABLE CConnecter * CPluginClient::CreateConnecter ( const QString &  szId)
privatepure virtual

New CConnecter instance.

Only is called by CClient

{
auto it = m_Plugins.find(id);
if(m_Plugins.end() != it)
{
bool bRet = 0;
qDebug(log) << "CreateConnecter id:" << id;
auto plugin = it.value();
CConnecter* p = nullptr;
if(plugin) {
//p = plugin->CreateConnecter(id);
bRet = QMetaObject::invokeMethod(
plugin,
"CreateConnecter",
Qt::DirectConnection,
Q_RETURN_ARG(CConnecter*, p),
Q_ARG(QString, id));
if(!bRet) {
qCritical(log) << "Create CConnecter fail.";
return nullptr;
}
}
if(p) {
int val = 0;
//p->Initial();
bRet = QMetaObject::invokeMethod(
p,
"Initial",
Qt::DirectConnection,
Q_RETURN_ARG(int, val));
if(!bRet || val) {
qCritical(log) << "Connecter initial fail" << bRet << val;
DeleteConnecter(p);
return nullptr;
}
//p->SetParameterClient(m_ParameterClient)
bRet = QMetaObject::invokeMethod(
p,
"SetParameterClient",
Qt::DirectConnection,
Q_RETURN_ARG(int, val),
Q_ARG(CParameterClient*, m_pParameterClient));
if(!bRet || val) {
qCritical(log) << "SetParameterClient fail" << bRet << val;
DeleteConnecter(p);
return nullptr;
}
}
return p;
}
return nullptr;
}
virtual CConnecter * CreateConnecter(const QString &id)
New CConnecter pointer, the owner is caller.
Definition Client.cpp:202
Connecter interface.
Definition Connecter.h:62
The parameters of client.
Returns
Return CConnecter pointer, the owner is caller
Note
The function new object pointer, the caller must delete it when don't use it.
Parameters
szId
See also
CClient::CreateConnecter CClient::LoadConnecter

Implemented in CPluginFreeRDP, CPluginLibVNCServer, CPluginPlayer, CPluginRabbitVNC, CPluginScreenCapture, CPluginTigerVnc, CPluginWakeOnLan, CPluginClientThread, CPluginLibSSH, CPluginTelnet, and CPluginTerminal.

◆ Description()

virtual const QString CPluginClient::Description ( ) const
pure virtual

◆ Details()

const QString CPluginClient::Details ( ) const
virtual

Display more information in About dialog or log.

eg: Include the plugin depends on the library version and description

See also
CPluginFreeRDP::Details()

Reimplemented in CPluginFreeRDP, CPluginLibVNCServer, CPluginPlayer, CPluginTigerVnc, and CPluginWakeOnLan.

Definition at line 52 of file PluginClient.cpp.

◆ DisplayName()

const QString CPluginClient::DisplayName ( ) const
virtual

◆ Icon()

const QIcon CPluginClient::Icon ( ) const
virtual

Definition at line 47 of file PluginClient.cpp.

◆ Id()

const QString CPluginClient::Id ( ) const
virtual

ID. Default: Protocol() + ":" + Name()

Definition at line 37 of file PluginClient.cpp.

◆ InitTranslator()

int CPluginClient::InitTranslator ( )
private

Initialize the translation resource, which is only called by CClient.

Because it calls Name(), So it can't be called directly in the constructor of this class.

See also
CClient::AppendPlugin

Definition at line 25 of file PluginClient.cpp.

◆ Name()

virtual const QString CPluginClient::Name ( ) const
pure virtual

This name must be the same as the project name (${PROJECT_NAME}). The translation file (${PROJECT_NAME}_*.ts)) name is associated with it.

Implemented in CPluginFreeRDP, CPluginLibSSH, CPluginLibVNCServer, CPluginPlayer, CPluginRabbitVNC, CPluginScreenCapture, CPluginTelnet, CPluginTerminal, CPluginTigerVnc, and CPluginWakeOnLan.

◆ Protocol()

virtual const QString CPluginClient::Protocol ( ) const
pure virtual

◆ Version()

virtual const QString CPluginClient::Version ( ) const
pure virtual

Member Data Documentation

◆ m_Translator

QSharedPointer<QTranslator> CPluginClient::m_Translator
private

Definition at line 116 of file PluginClient.h.


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