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

Connecter interface. More...

#include <Connecter.h>

Inheritance diagram for CConnecter:
CConnecterConnect CConnecterTerminal CScreenCapture CConnecterThread CConnecterWakeOnLan CConnecterPluginTerminal CConnecterSSH CConnecterTelnet CConnecterFreeRDP CConnecterLibVNCServer CConnecterPlayer CConnecterVnc

Public Slots

virtual int Connect ()=0
 Start connect.
 
virtual int DisConnect ()=0
 Close connect.
 

Signals

void sigConnected ()
 Successful connection signal.
 
void sigDisconnect ()
 Notify the user to disconnect.
 
void sigDisconnected ()
 Successful disconnection signal.
 
void sigUpdateName (const QString &szName)
 
void sigUpdateParameters (CConnecter *pConnecter)
 Update parameters, notify application to save or show parameters.
 
void sigError (const int nError, const QString &szError)
 Triggered when an error is generated.
 
void sigInformation (const QString &szInfo)
 Show information in main windows.
 
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 without blocking the background thread.
 
void sigClipBoardChanged ()
 

Public Member Functions

 CConnecter (CPluginClient *plugin)
 
virtual const QString Id ()
 Identity.
 
virtual const QString Name ()
 Name.
 
virtual const QString Description ()
 Description.
 
virtual const QString Protocol () const
 Protocol.
 
virtual qint16 Version ()=0
 Version.
 
virtual const QIcon Icon () const
 Icon.
 
virtual QWidget * GetViewer ()=0
 Get Viewer.
 
virtual int OpenDialogSettings (QWidget *parent=nullptr)
 Open settings dialog.
 
virtual QMenu * GetMenu (QWidget *parent=nullptr)
 Get operate menu.
 

Protected Member Functions

virtual int SetParameter (CParameter *p)
 Set parameters.
 
CParameterGetParameter ()
 
Q_INVOKABLE CPluginClientGetPlugClient () const
 
virtual int Load (QSettings &set)
 Load parameters.
 
virtual int Save (QSettings &set)
 Save parameters.
 
virtual Q_INVOKABLE int Load (QString szFile=QString())
 Load parameters from file.
 
virtual Q_INVOKABLE int Save (QString szFile=QString())
 Save parameters to file.
 

Static Protected Member Functions

static QObject * createObject (const QString &className, QObject *parent=NULL)
 

Protected Attributes

QMenu m_Menu
 
QAction * m_pSettings
 

Private Slots

void slotShowServerName ()
 
void slotUpdateName ()
 
virtual void slotBlockShowWidget (const QString &className, int &nRet, void *pContext)
 Blocks the background thread and displays the window in the foreground thread.
 
virtual void slotBlockShowMessageBox (const QString &szTitle, const QString &szMessage, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton &nRet, bool &checkBox, QString szCheckBoxContext=QString())
 Block background threads and display message dialogs in foreground threads (QMessageBox)
 
virtual void slotBlockInputDialog (const QString &szTitle, const QString &szLable, const QString &szMessage, QString &szText)
 Block background threads and display input dialogs in foreground threads (QInputDialog)
 
virtual void slotSetClipboard (QMimeData *data)
 
virtual void slotSettings ()
 

Private Member Functions

virtual Q_INVOKABLE int Initial ()=0
 Initial parameters and resource.
 
virtual Q_INVOKABLE int Clean ()=0
 Clean parameters and resource.
 
virtual Q_INVOKABLE int SetParameterClient (CParameterClient *pPara)
 Set CParameterClient.
 
virtual QDialog * OnOpenDialogSettings (QWidget *parent=nullptr)=0
 Open settgins dialog.
 

Private Attributes

CPluginClientm_pPluginClient
 
CParameterm_pParameter
 

Detailed Description

Connecter interface.

Note
  • This interface is only used by users. It is implemented by plugins.
  • Its instance is in the main thread.

Sequen diagram:

Basic implementations of the following types have been provided:

  1. Desktop type:
    1.1. The connection used is the blocking model (a blackground thread handles one connection): CConnecterThread
    1.2. The connection is a non-blocking model (a blackground thread handles multiple connections): CConnecterConnect
  2. Tool type:
    2.1. The connection is a non-blocking model(in main thread): CConnecterConnect
  3. Termianal type: CConnecterTerminal
See also
CPluginClient

Definition at line 61 of file Connecter.h.

Constructor & Destructor Documentation

◆ CConnecter()

CConnecter::CConnecter ( CPluginClient plugin)
explicit
Parameters
pluginThe plugin pointer must be specified as the corresponding CPluginClient derived class
Note
If the parameters( CParameterConnecter or its derived class) requires a CParameterClient . Please instantiate the parameters and call CConnecter::SetParameter in the derived class( or OnInitial() ) to set the parameters pointer. If you are sure the parameter does not need CParameterClient. please overload the CConnecter::SetParameterClient in the derived class. don't set it.
See also
CClient::CreateConnecter SetParameterClient SetParameter CParameterConnecter CParameterClient

◆ ~CConnecter()

CConnecter::~CConnecter ( )
virtual

Definition at line 42 of file Connecter.cpp.

Member Function Documentation

◆ Clean()

virtual Q_INVOKABLE int CConnecter::Clean ( )
privatepure virtual

◆ Connect

virtual int CConnecter::Connect ( )
pure virtualslot

Start connect.

Note
Only call by user, The plugin don't call it. When plugin is connected, it emit sigConnected()
See also
sigConnected()

◆ createObject()

QObject * CConnecter::createObject ( const QString &  className,
QObject *  parent = NULL 
)
staticprotected

Definition at line 218 of file Connecter.cpp.

◆ Description()

const QString CConnecter::Description ( )
virtual

Description.

Reimplemented in CConnecterConnect.

Definition at line 58 of file Connecter.cpp.

◆ DisConnect

virtual int CConnecter::DisConnect ( )
pure virtualslot

Close connect.

Note
Only call by user, The plugin don't call it. When plugin is disconnected, it emit sigDisconnected(). The caller receive the signal, then delete the object.
See also
sigDisconnected()

◆ GetMenu()

QMenu * CConnecter::GetMenu ( QWidget *  parent = nullptr)
virtual

Get operate menu.

Definition at line 113 of file Connecter.cpp.

◆ GetParameter()

CParameter * CConnecter::GetParameter ( )
protected

Definition at line 198 of file Connecter.cpp.

◆ GetPlugClient()

CPluginClient * CConnecter::GetPlugClient ( ) const
protected

Definition at line 203 of file Connecter.cpp.

◆ GetViewer()

virtual QWidget * CConnecter::GetViewer ( )
pure virtual

Get Viewer.

Returns
QWidget*: the ownership is a instance of this class or its derivative class
See also
sigConnected CFrmViewer::CFrmViewer

Implemented in CConnecterThread, CConnecterTerminal, CScreenCapture, and CConnecterWakeOnLan.

◆ Icon()

const QIcon CConnecter::Icon ( ) const
virtual

Icon.

Definition at line 74 of file Connecter.cpp.

◆ Id()

const QString CConnecter::Id ( )
virtual

Identity.

Reimplemented in CConnecterConnect, CConnecterVnc, and CConnecterWakeOnLan.

Definition at line 47 of file Connecter.cpp.

◆ Initial()

virtual Q_INVOKABLE int CConnecter::Initial ( )
privatepure virtual

◆ Load() [1/2]

int CConnecter::Load ( QSettings &  set)
protectedvirtual

Load parameters.

Reimplemented in CConnecterThread, CConnecterTerminal, and CConnecterWakeOnLan.

Definition at line 144 of file Connecter.cpp.

◆ Load() [2/2]

int CConnecter::Load ( QString  szFile = QString())
protectedvirtual

Load parameters from file.

See also
CClient::LoadConnecter

Definition at line 120 of file Connecter.cpp.

◆ Name()

const QString CConnecter::Name ( )
virtual

Name.

Reimplemented in CConnecterConnect, and CConnecterWakeOnLan.

Definition at line 53 of file Connecter.cpp.

◆ OnOpenDialogSettings()

virtual QDialog * CConnecter::OnOpenDialogSettings ( QWidget *  parent = nullptr)
privatepure virtual

Open settgins dialog.

Parameters
parentthe parent windows of the dialog of return
Returns
QDialog*: then QDialog must set attribute Qt::WA_DeleteOnClose; The ownership is caller.
See also
OpenDialogSettings

Implemented in CConnecterFreeRDP, CConnecterLibVNCServer, CConnecterPlayer, CScreenCapture, CConnecterWakeOnLan, and CConnecterVnc.

◆ OpenDialogSettings()

int CConnecter::OpenDialogSettings ( QWidget *  parent = nullptr)
virtual

Open settings dialog.

Parameters
parent
Returns
DialogCode
  • QDialog::Accepted
  • QDialog::Rejected
  • -1: error

Definition at line 93 of file Connecter.cpp.

◆ Protocol()

const QString CConnecter::Protocol ( ) const
virtual

Protocol.

Definition at line 69 of file Connecter.cpp.

◆ Save() [1/2]

int CConnecter::Save ( QSettings &  set)
protectedvirtual

Save parameters.

Reimplemented in CConnecterThread, CConnecterTerminal, and CConnecterWakeOnLan.

Definition at line 153 of file Connecter.cpp.

◆ Save() [2/2]

int CConnecter::Save ( QString  szFile = QString())
protectedvirtual

Save parameters to file.

Parameters
szFileFile name.
See also
CClient::SaveConnecter

Definition at line 132 of file Connecter.cpp.

◆ SetParameter()

int CConnecter::SetParameter ( CParameter p)
protectedvirtual

Set parameters.

Note
Instantiate a parameter in a derived class constructor, and then call this function in its OnInitial() to set the parameter.
See also
Use connecter parameter
SetParameterClient() CClient::CreateConnecter

Definition at line 188 of file Connecter.cpp.

◆ SetParameterClient()

int CConnecter::SetParameterClient ( CParameterClient pPara)
privatevirtual

Set CParameterClient.

Note
If CParameterConnecter isn't need CParameterClient. please overload this function.
See also
CClient::CreateConnecter CParameterConnecter CParameterClient

Reimplemented in CConnecterConnect, and CConnecterWakeOnLan.

Definition at line 163 of file Connecter.cpp.

◆ sigConnected

void CConnecter::sigConnected ( )
signal

Successful connection signal.

Triggered only by plugins. The application needs to set the view property Enabled to true at this point. enable accept keyboard and mouse event

See also
MainWindow::slotConnected() GetViewer() CFrmViewer::CFrmViewer
{
CConnecter* p = dynamic_cast<CConnecter*>(sender());
if(!p) return;
/* If you put it here, when connected, the view is not displayed.
So put it in the connect() display view.
See: Connect(CConnecter *p, bool set, QString szFile)
*/
/*
if(m_pView)
{
m_pView->SetAdaptWindows(CFrmViewer::Auto, p->GetViewer());
m_pView->AddView(p->GetViewer());
m_pView->SetWidowsTitle(p->GetViewer(), p->Name(), p->Icon(), p->Description());
}
m_Connecters.push_back(p);//*/
slotLoadConnecterMenu();
slotInformation(tr("Connected to ") + p->Name());
qDebug(log) << "MainWindow::slotConnected()" << p->Name();
}
Connecter interface.
Definition Connecter.h:62
virtual const QString Name()
Name.
Definition Connecter.cpp:53
void slotConnected()
[MainWindow slotConnected]

◆ sigDisconnect

void CConnecter::sigDisconnect ( )
signal

Notify the user to disconnect.

Triggered only by plugins Emit when you need to disconnect from the plug-in. For example, the peer disconnect or reset the connection or the connection is error. When the applicatioin receive the signal, call DisConnect() to close connect

◆ sigDisconnected

void CConnecter::sigDisconnected ( )
signal

Successful disconnection signal.

Triggered only by plugins

See also
Disconnect()

◆ sigInformation

void CConnecter::sigInformation ( const QString &  szInfo)
signal

Show information in main windows.

Note
It differs from sigShowMessageBox in that sigShowMessageBox is displayed in a dialog box
Parameters
szInfo
See also
sigShowMessageBox MainWindow::slotInformation()

◆ sigShowMessageBox

void CConnecter::sigShowMessageBox ( const QString &  title,
const QString &  message,
const QMessageBox::Icon &  icon = QMessageBox::Information 
)
signal

Trigger the display of a message dialog (QMessageBox) in the main thread from a background thread without blocking the background thread.

Note
It differs from sigInformation in that sigInformation is not displayed in a dialog box
See also
sigInformation Connect::SetConnecter MainWindow::slotShowMessageBox

◆ sigUpdateName

void CConnecter::sigUpdateName ( const QString &  szName)
signal
Note
The name is changed. This signal is only triggered by this class

◆ sigUpdateParameters

void CConnecter::sigUpdateParameters ( CConnecter pConnecter)
signal

Update parameters, notify application to save or show parameters.

Note
The plugin don't use it directly. Please use CParameter::sigChanged to emit this signal.
See also
SetParameter

◆ slotBlockInputDialog

void CConnecter::slotBlockInputDialog ( const QString &  szTitle,
const QString &  szLable,
const QString &  szMessage,
QString &  szText 
)
privatevirtualslot

Block background threads and display input dialogs in foreground threads (QInputDialog)

See also
CConnecter::sigBlockInputDialog() SetConnecter

Definition at line 312 of file Connecter.cpp.

◆ slotBlockShowMessageBox

void CConnecter::slotBlockShowMessageBox ( const QString &  szTitle,
const QString &  szMessage,
QMessageBox::StandardButtons  buttons,
QMessageBox::StandardButton &  nRet,
bool &  checkBox,
QString  szCheckBoxContext = QString() 
)
privatevirtualslot

Block background threads and display message dialogs in foreground threads (QMessageBox)

See also
CConnect::sigBlockShowMessageBox

Definition at line 291 of file Connecter.cpp.

◆ slotBlockShowWidget

void CConnecter::slotBlockShowWidget ( const QString &  className,
int &  nRet,
void *  pContext 
)
privatevirtualslot

Blocks the background thread and displays the window in the foreground thread.

Parameters
classNameshow windows class name The class must have follower public functions: Q_INVOKABLE void SetContext(void* pContext); Q_INVOKABLE void SetConnecter(CConnecter *pConnecter);
nRetIf className is QDialog derived class, QDialog::exec() return value. Otherwise, ignore
pContextpass context from CConnect::sigBlockShowWidget()
See also
CConnect::sigBlockShowWidget()

Definition at line 248 of file Connecter.cpp.

◆ slotSetClipboard

void CConnecter::slotSetClipboard ( QMimeData *  data)
privatevirtualslot
Note
The slot only is used by CConnect::SetConnecter()

Definition at line 79 of file Connecter.cpp.

◆ slotSettings

void CConnecter::slotSettings ( )
privatevirtualslot

Definition at line 327 of file Connecter.cpp.

◆ slotShowServerName

void CConnecter::slotShowServerName ( )
privateslot

Definition at line 208 of file Connecter.cpp.

◆ slotUpdateName

void CConnecter::slotUpdateName ( )
privateslot

Definition at line 213 of file Connecter.cpp.

◆ Version()

virtual qint16 CConnecter::Version ( )
pure virtual

Member Data Documentation

◆ m_Menu

QMenu CConnecter::m_Menu
protected

Definition at line 404 of file Connecter.h.

◆ m_pParameter

CParameter* CConnecter::m_pParameter
private

Definition at line 413 of file Connecter.h.

◆ m_pPluginClient

CPluginClient* CConnecter::m_pPluginClient
private

Definition at line 410 of file Connecter.h.

◆ m_pSettings

QAction* CConnecter::m_pSettings
protected

Definition at line 405 of file Connecter.h.


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