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

Operate interface. More...

#include <Operate.h>

Inheritance diagram for COperate:
Inheritance graph
[legend]
Collaboration diagram for COperate:
Collaboration graph
[legend]

Public Types

enum class  SecurityLevel {
  No , Secure , NonSecureAuthentication , SecureChannel ,
  Normal = SecureChannel , SecureAuthentication , Risky
}
 

Signals

void sigRunning ()
 Start success signal.
 
void sigStop ()
 Notify the user to stop.
 
void sigFinished ()
 Successful disconnection signal.
 
void sigViewerFocusIn (QWidget *pView)
 The view is focus.
 
void sigUpdateName (const QString &szName)
 
void sigUpdateParameters (COperate *pOperate)
 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

 COperate (CPlugin *plugin)
 
virtual QWidget * GetViewer ()=0
 Get Viewer.
 
virtual int OpenDialogSettings (QWidget *parent=nullptr)
 Open settings dialog.
 
virtual QMenu * GetMenu (QWidget *parent=nullptr)
 Get menu.
 
virtual SecurityLevel GetSecurityLevel ()
 
virtual QString GetSecurityLevelString ()
 
virtual QColor GetSecurityLevelColor ()
 
virtual int Start ()=0
 Start.
 
virtual int Stop ()=0
 Stop.
 
Property
virtual const QString Id ()
 Identity.
 
virtual const QString Name ()
 Name.
 
virtual const QString Description ()
 Description.
 
virtual const QString Protocol () const
 Protocol.
 
virtual const qint16 Version () const =0
 Version.
 
virtual const QIcon Icon () const
 Icon.
 
virtual const QString GetTypeName () const
 Get type name.
 

Static Public Member Functions

static QString GetSecurityLevelString (SecurityLevel level)
 
static QColor GetSecurityLevelColor (SecurityLevel level)
 

Protected Member Functions

virtual Q_INVOKABLE int Initial ()
 Initial parameters and resource.
 
virtual Q_INVOKABLE int Clean ()
 Clean parameters and resource.
 
virtual Q_INVOKABLE int SetGlobalParameters (CParameterPlugin *pPara)=0
 Apply the global parameters of the plug-in.
 
Q_INVOKABLE CPluginGetPlugin () const
 Get plugin.
 

Static Protected Member Functions

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

Protected Attributes

QMenu m_Menu
 
QAction * m_pActionSettings
 

Private Slots

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 QDialog * OnOpenDialogSettings (QWidget *parent=nullptr)=0
 Open settgins dialog.
 

Private Attributes

CPluginm_pPlugin
 

Load and save settings

QString m_szSettings
 
virtual QString GetSettingsFile ()
 
virtual int SetSettingsFile (const QString &szFile)
 
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.
 

Detailed Description

Operate interface.

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

Class diagram:

Sequen diagram:

Basic implementations of the following types have been provided:

See also
CPlugin

Definition at line 49 of file Operate.h.

Member Enumeration Documentation

◆ SecurityLevel

enum class COperate::SecurityLevel
strong

Definition at line 116 of file Operate.h.

Constructor & Destructor Documentation

◆ ~COperate()

COperate::~COperate ( )
virtual

Definition at line 28 of file Operate.cpp.

Member Function Documentation

◆ Clean()

int COperate::Clean ( )
protectedvirtual

◆ createObject()

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

Definition at line 279 of file Operate.cpp.

◆ Description()

const QString COperate::Description ( )
virtual

Description.

Reimplemented in COperateFileTransfer, COperateSerialPort, COperateSSH, COperateTelnet, CTerminal, COperateDesktop, and COperateTerminal.

Definition at line 46 of file Operate.cpp.

◆ GetMenu()

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

Get menu.

Definition at line 107 of file Operate.cpp.

◆ GetPlugin()

CPlugin * COperate::GetPlugin ( ) const
protected

Get plugin.

See also
CManager::DeleteOperate

Definition at line 254 of file Operate.cpp.

◆ GetSecurityLevel()

COperate::SecurityLevel COperate::GetSecurityLevel ( )
virtual

Definition at line 114 of file Operate.cpp.

◆ GetSecurityLevelColor() [1/2]

QColor COperate::GetSecurityLevelColor ( )
virtual

Definition at line 145 of file Operate.cpp.

◆ GetSecurityLevelColor() [2/2]

QColor COperate::GetSecurityLevelColor ( SecurityLevel  level)
static

Definition at line 150 of file Operate.cpp.

◆ GetSecurityLevelString() [1/2]

QString COperate::GetSecurityLevelString ( )
virtual

Definition at line 119 of file Operate.cpp.

◆ GetSecurityLevelString() [2/2]

QString COperate::GetSecurityLevelString ( SecurityLevel  level)
static

Definition at line 124 of file Operate.cpp.

◆ GetSettingsFile()

QString COperate::GetSettingsFile ( )
virtual

Definition at line 169 of file Operate.cpp.

◆ GetTypeName()

const QString COperate::GetTypeName ( ) const
virtual

Get type name.

Definition at line 76 of file Operate.cpp.

◆ GetViewer()

virtual QWidget * COperate::GetViewer ( )
pure virtual

Get Viewer.

Returns
QWidget*: the ownership is a instance of this class or its derivative class
Note
If you implement the view yourself, you need to disable the view at the beginning and allow the view after sigRun.
See also
sigRunning CFrmViewer::CFrmViewer

Implemented in COperateFileTransfer, CScreenCapture, COperateWakeOnLan, COperateDesktop, and COperateTerminal.

◆ Icon()

const QIcon COperate::Icon ( ) const
virtual

Icon.

Definition at line 82 of file Operate.cpp.

◆ Id()

const QString COperate::Id ( )
virtual

◆ Initial()

int COperate::Initial ( )
protectedvirtual

◆ Load() [1/2]

int COperate::Load ( QSettings &  set)
protectedvirtual

Load parameters.

Reimplemented in COperateFileTransfer, COperateWakeOnLan, COperateDesktop, and COperateTerminal.

Definition at line 211 of file Operate.cpp.

◆ Load() [2/2]

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

Load parameters from file.

See also
CManger::LoadOperate

Definition at line 187 of file Operate.cpp.

◆ Name()

const QString COperate::Name ( )
virtual

◆ OnOpenDialogSettings()

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

Open settgins dialog.

Parameters
parentthe parent windows of the dialog of return
Returns
QDialog*: then QDialog must be allocated in heap memory, the ownership is caller.
See also
OpenDialogSettings

Implemented in COperateFileTransfer, COperateFreeRDP, COperateLibVNCServer, COperatePlayer, CScreenCapture, COperateSerialPort, COperateSSH, COperateTelnet, CTerminal, COperateWakeOnLan, and COperateVnc.

◆ OpenDialogSettings()

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

Open settings dialog.

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

Definition at line 87 of file Operate.cpp.

◆ Protocol()

const QString COperate::Protocol ( ) const
virtual

Protocol.

Reimplemented in COperateFileTransfer.

Definition at line 71 of file Operate.cpp.

◆ Save() [1/2]

int COperate::Save ( QSettings &  set)
protectedvirtual

Save parameters.

Reimplemented in COperateFileTransfer, COperateWakeOnLan, COperateDesktop, and COperateTerminal.

Definition at line 218 of file Operate.cpp.

◆ Save() [2/2]

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

Save parameters to file.

Parameters
szFileFile name.
See also
CManger::SaveOperate

Definition at line 199 of file Operate.cpp.

◆ SetGlobalParameters()

int COperate::SetGlobalParameters ( CParameterPlugin pPara)
protectedpure virtual

Apply the global parameters of the plug-in.

Note
If you don't need the global parameters of the plugin, override it in the derived class and ignore.
See also
CManager::CreateOperate CParameterPlugin

Implemented in COperateFileTransfer, CScreenCapture, COperateWakeOnLan, COperateDesktop, and COperateTerminal.

Definition at line 259 of file Operate.cpp.

◆ SetSettingsFile()

int COperate::SetSettingsFile ( const QString &  szFile)
virtual

Definition at line 181 of file Operate.cpp.

◆ sigFinished

void COperate::sigFinished ( )
signal

Successful disconnection signal.

Triggered only by plugins

See also
Disconnect()

◆ sigInformation

void COperate::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()

◆ sigRunning

void COperate::sigRunning ( )
signal

Start success 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
  • If the plugin implements its own view (non-CFrmView), set the view property Enabled to true. Allows receiving keyboard and mouse events.
See also
MainWindow::slotRunning() GetViewer() CFrmViewer::CFrmViewer

◆ sigShowMessageBox

void COperate::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

◆ sigStop

void COperate::sigStop ( )
signal

Notify the user to stop.

Triggered only by plugins Emit when you need to stop 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 Stop() to close connect

◆ sigUpdateName

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

◆ sigUpdateParameters

void COperate::sigUpdateParameters ( COperate pOperate)
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
COperateDesktop::SetParameter

◆ sigViewerFocusIn

void COperate::sigViewerFocusIn ( QWidget *  pView)
signal

The view is focus.

Parameters
pView

◆ slotBlockInputDialog

void COperate::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 369 of file Operate.cpp.

◆ slotBlockShowMessageBox

void COperate::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 348 of file Operate.cpp.

◆ slotBlockShowWidget

void COperate::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);
nRetIf className is QDialog derived class, QDialog::exec() return value. Otherwise, ignore
pContextpass context from CConnect::sigBlockShowWidget()
See also
CConnect::sigBlockShowWidget()

Definition at line 309 of file Operate.cpp.

◆ slotSetClipboard

void COperate::slotSetClipboard ( QMimeData *  data)
privatevirtualslot
Note
The slot only is used by CBackendDesktop::SetConnect()

Definition at line 384 of file Operate.cpp.

◆ slotSettings

void COperate::slotSettings ( )
privatevirtualslot

Definition at line 247 of file Operate.cpp.

◆ slotUpdateName

void COperate::slotUpdateName ( )
privateslot

Definition at line 274 of file Operate.cpp.

◆ Start()

virtual int COperate::Start ( )
pure virtual

Start.

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

Implemented in COperateFileTransfer.

◆ Stop()

virtual int COperate::Stop ( )
pure virtual

Stop.

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

Implemented in COperateFileTransfer.

◆ Version()

virtual const qint16 COperate::Version ( ) const
pure virtual

Member Data Documentation

◆ m_Menu

QMenu COperate::m_Menu
protected

Definition at line 409 of file Operate.h.

◆ m_pActionSettings

QAction* COperate::m_pActionSettings
protected

Definition at line 410 of file Operate.h.

◆ m_pPlugin

CPlugin* COperate::m_pPlugin
private

Definition at line 415 of file Operate.h.

◆ m_szSettings

QString COperate::m_szSettings
private

Definition at line 323 of file Operate.h.


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