Rabbit Remote Control 0.1.0-bate8
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | Friends | List of all members
COperateFtpServer Class Reference
Inheritance diagram for COperateFtpServer:
Inheritance graph
[legend]
Collaboration diagram for COperateFtpServer:
Collaboration graph
[legend]

Public Member Functions

 COperateFtpServer (CPlugin *plugin)
 
virtual const QString Name () override
 Name.
 
virtual const QString Description () override
 Description.
 
virtual const qint16 Version () const override
 
virtual QWidget * GetViewer () override
 Get Viewer.
 
virtual int Start () override
 Start.
 
virtual int Stop () override
 Stop.
 
QSharedPointer< CParameterFtpServerGetParameter () const
 
- Public Member Functions inherited from COperate
 COperate (CPlugin *plugin)
 
virtual int OpenDialogSettings (QWidget *parent=nullptr)
 Open settings dialog.
 
virtual QMenu * GetMenu (QWidget *parent=nullptr)
 Get menu.
 
virtual const QString Id ()
 
virtual const QString Protocol () const
 
virtual const QIcon Icon () const
 
virtual const QString GetTypeName () const
 
virtual QString GetSettingsFile ()
 
virtual int SetSettingsFile (const QString &szFile)
 
virtual CStatsGetStats ()
 Get statistics.
 
virtual CSecurityLevel::Levels GetSecurityLevel () const
 Get Security Level.
 

Protected Member Functions

virtual Q_INVOKABLE CBackendInstanceBackend ()
 
virtual int SetGlobalParameters (CParameterPlugin *pPara) override
 Apply the global parameters of the plug-in.
 
virtual int Initial () override
 Initial parameters and resource.
 
virtual int Clean () override
 Clean parameters and resource.
 
virtual int Load (QSettings &set) override
 Load parameters.
 
virtual int Save (QSettings &set) override
 Save parameters.
 
- Protected Member Functions inherited from COperate
Q_INVOKABLE CPluginGetPlugin () const
 Get plugin.
 
virtual Q_INVOKABLE int Load (QString szFile=QString())
 Load parameters from file.
 
virtual Q_INVOKABLE int Save (QString szFile=QString())
 Save parameters to file.
 

Private Slots

void slotStart (bool checked)
 

Private Member Functions

virtual QDialog * OnOpenDialogSettings (QWidget *parent) override
 Open settgins dialog.
 

Private Attributes

CBackendThreadm_pThread
 
QSharedPointer< CParameterFtpServerm_Para
 
CFrmMainm_pView
 
QAction * m_pStart
 

Friends

class CFrmMain
 

Additional Inherited Members

- Signals inherited from COperate
void sigViewerFocusIn (QWidget *pView)
 The view is focus.
 
void sigFullScreen (bool bFullScreen)
 Full screen.
 
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 ()
 
void sigSecurityLevel ()
 Triggered when the security level changes.
 
void sigRunning ()
 Start success signal.
 
void sigStop ()
 Notify the user to stop.
 
void sigFinished ()
 Successful disconnection signal.
 
- Protected Slots inherited from COperate
void slotUpdateName ()
 
void slotSetSecurityLevel (CSecurityLevel::Levels level)
 
- Static Protected Member Functions inherited from COperate
static QObject * createObject (const QString &className, QObject *parent=NULL)
 Create Object.
 
- Protected Attributes inherited from COperate
QMenu m_Menu
 
QAction * m_pActionSettings
 

Detailed Description

Definition at line 10 of file OperateFtpServer.h.

Constructor & Destructor Documentation

◆ ~COperateFtpServer()

COperateFtpServer::~COperateFtpServer ( )

Definition at line 21 of file OperateFtpServer.cpp.

Member Function Documentation

◆ Clean()

int COperateFtpServer::Clean ( )
overrideprotectedvirtual

Clean parameters and resource.

See also
CManager::DeleteOperate

Reimplemented from COperate.

Definition at line 157 of file OperateFtpServer.cpp.

◆ Description()

const QString COperateFtpServer::Description ( )
overridevirtual

Description.

{
QString szDescription;
if(!Name().isEmpty())
szDescription = tr("Name: ") + Name() + "\n";
if(!GetTypeName().isEmpty())
szDescription += tr("Type: ") + GetTypeName() + "\n";
if(!Protocol().isEmpty()) {
szDescription += tr("Protocol: ") + Protocol();
#ifdef DEBUG
if(!GetPlugin()->DisplayName().isEmpty())
szDescription += " - " + GetPlugin()->DisplayName();
#endif
szDescription += "\n";
}
if(!ServerName().isEmpty())
szDescription += tr("Server name: ") + ServerName() + "\n";
if(GetParameter()) {
if(!GetParameter()->m_Net.GetHost().isEmpty())
szDescription += tr("Server address: ") + GetParameter()->m_Net.GetHost() + ":"
+ QString::number(GetParameter()->m_Net.GetPort()) + "\n";
QString szProxy(tr("Proxy") + " ");
auto &proxy = GetParameter()->m_Proxy;
switch(proxy.GetUsedType()) {
case CParameterProxy::TYPE::SSHTunnel:
{
auto &sshNet = proxy.m_SSH.m_Net;
szProxy += "(" + tr("SSH tunnel") + "): " + sshNet.GetHost() + ":"
+ QString::number(sshNet.GetPort());
break;
}
case CParameterProxy::TYPE::SockesV5:
{
auto &sockesV5 = proxy.m_SockesV5;
szProxy += "(" + tr("Sockes v5") + "): " + sockesV5.GetHost() + ":"
+ QString::number(sockesV5.GetPort());
break;
}
default:
szProxy.clear();
break;
}
if(!szProxy.isEmpty())
szDescription += szProxy + "\n";
}
if(!(GetSecurityLevel() & CSecurityLevel::Level::No)) {
szDescription += tr("Security level: ");
if(!sl.GetUnicodeIcon().isEmpty())
szDescription += sl.GetUnicodeIcon() + " ";
szDescription += sl.GetString() + "\n";
}
if(!GetPlugin()->Description().isEmpty())
szDescription += tr("Description: ") + GetPlugin()->Description();
return szDescription;
}
virtual const QString Description() override
[The name of the desktop operate]
virtual const QString Name() override
Name.
virtual const QString Description() override
Description.
virtual CSecurityLevel::Levels GetSecurityLevel() const
Get Security Level.
Definition Operate.cpp:129
Q_INVOKABLE CPlugin * GetPlugin() const
Get plugin.
Definition Operate.cpp:219
virtual const QString DisplayName() const
The plugin display name.
Definition Plugin.cpp:76
virtual const QString Description() const =0
Plugin description.
Security level.
Definition Stats.h:79
See also
COperateDesktop::Description()

Reimplemented from COperate.

Definition at line 228 of file OperateFtpServer.cpp.

◆ GetParameter()

QSharedPointer< CParameterFtpServer > COperateFtpServer::GetParameter ( ) const

Definition at line 165 of file OperateFtpServer.cpp.

◆ GetViewer()

QWidget * COperateFtpServer::GetViewer ( )
overridevirtual

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

Implements COperate.

Definition at line 31 of file OperateFtpServer.cpp.

◆ Initial()

int COperateFtpServer::Initial ( )
overrideprotectedvirtual

Initial parameters and resource.

Note
Call before Load()
See also
CManager::CreateOperate Load

Reimplemented from COperate.

Definition at line 123 of file OperateFtpServer.cpp.

◆ InstanceBackend()

CBackend * COperateFtpServer::InstanceBackend ( )
protectedvirtual

Definition at line 52 of file OperateFtpServer.cpp.

◆ Load()

int COperateFtpServer::Load ( QSettings &  set)
overrideprotectedvirtual

Load parameters.

Implements COperate.

Definition at line 109 of file OperateFtpServer.cpp.

◆ Name()

const QString COperateFtpServer::Name ( )
overridevirtual

Name.

const QString COperateDesktop::Name()
{
QString szName;
// Show the name of parameter
if(GetParameter() && !(GetParameter()->GetName().isEmpty()))
szName += GetParameter()->GetName();
else {
// Show the prefix of protocol
if(GetParameter() && GetParameter()->GetGlobalParameters()
&& (GetParameter()->GetGlobalParameters()->GetNameStyles()
& CParameterPlugin::NameStyle::Protocol)
&& !Protocol().isEmpty())
szName = Protocol() + ":";
// Show the server name
szName += ServerName();
}
// Show the prefix of security level
QString szSecurityLevel;
if((GetParameter()->GetGlobalParameters()->GetNameStyles()
& CParameterPlugin::NameStyle::SecurityLevel)
&& !(GetSecurityLevel() & CSecurityLevel::Level::No)
&& !sl.GetUnicodeIcon().isEmpty())
szSecurityLevel = sl.GetUnicodeIcon().left(2);
return szSecurityLevel + szName;
}
virtual const QString Name() override
[The name of the desktop operate]
See also
COperateDesktop::Name()

Reimplemented from COperate.

Definition at line 205 of file OperateFtpServer.cpp.

◆ OnOpenDialogSettings()

QDialog * COperateFtpServer::OnOpenDialogSettings ( QWidget *  parent)
overrideprivatevirtual

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

Implements COperate.

Definition at line 103 of file OperateFtpServer.cpp.

◆ Save()

int COperateFtpServer::Save ( QSettings &  set)
overrideprotectedvirtual

Save parameters.

Implements COperate.

Definition at line 116 of file OperateFtpServer.cpp.

◆ SetGlobalParameters()

int COperateFtpServer::SetGlobalParameters ( CParameterPlugin pPara)
overrideprotectedvirtual

Apply the global parameters of the plug-in.

Note
Call CParameterOperate::SetGlobalParameters to set the global parameters for the operation parameters, and connect the signals related to the global parameters.
{
if(GetParameter()) {
GetParameter()->SetGlobalParameters(pPara);
if(pPara) {
bool check = connect(pPara, SIGNAL(sigNameStylesChanged()),
this, SLOT(slotUpdateName()));
Q_ASSERT(check);
}
LoadAdaptWindows();
return 0;
} else {
QString szMsg = "There is not parameters! "
"please first create parameters, "
"then call SetParameter() in the ";
szMsg += metaObject()->className() + QString("::")
+ metaObject()->className();
szMsg += QString("() or ") + metaObject()->className()
+ QString("::") + "Initial()";
szMsg += " to set the parameters pointer. "
"Default set CParameterClient for the parameters of operate "
"(CParameterOperate or its derived classes) "
"See CManager::CreateOperate. "
"If you are sure the parameter of operate "
"does not need CParameterClient. "
"Please overload the SetGlobalParameters() in the ";
szMsg += QString(metaObject()->className()) + " . don't set it";
qCritical(log) << szMsg.toStdString().c_str();
Q_ASSERT(false);
}
return -1;
}
virtual int SetGlobalParameters(CParameterPlugin *pPara) override
Set Global Parameters.
Global parameters of plugins.
See also
CManager::CreateOperate CParameterPlugin

Implements COperate.

Definition at line 70 of file OperateFtpServer.cpp.

◆ slotStart

void COperateFtpServer::slotStart ( bool  checked)
privateslot

Definition at line 170 of file OperateFtpServer.cpp.

◆ Start()

int COperateFtpServer::Start ( )
overridevirtual

Start.

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

Implements COperate.

Definition at line 36 of file OperateFtpServer.cpp.

◆ Stop()

int COperateFtpServer::Stop ( )
overridevirtual

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()

Implements COperate.

Definition at line 43 of file OperateFtpServer.cpp.

◆ Version()

const qint16 COperateFtpServer::Version ( ) const
overridevirtual

Implements COperate.

Definition at line 26 of file OperateFtpServer.cpp.

Friends And Related Symbol Documentation

◆ CFrmMain

friend class CFrmMain
friend

Definition at line 47 of file OperateFtpServer.h.

Member Data Documentation

◆ m_Para

QSharedPointer<CParameterFtpServer> COperateFtpServer::m_Para
private

Definition at line 44 of file OperateFtpServer.h.

◆ m_pStart

QAction* COperateFtpServer::m_pStart
private

Definition at line 46 of file OperateFtpServer.h.

◆ m_pThread

CBackendThread* COperateFtpServer::m_pThread
private

Definition at line 43 of file OperateFtpServer.h.

◆ m_pView

CFrmMain* COperateFtpServer::m_pView
private

Definition at line 45 of file OperateFtpServer.h.


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