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

Parameter interface. More...

#include <Parameter.h>

Inheritance diagram for CParameter:
CParameterClient CParameterConnecter CParameterRecord CParameterBase CParameterNet CParameterProxy CParameterTerminal CParameterUser CParameterWakeOnLan CParameterFreeRDP CParameterLibVNCServer CParameterPlayer CParameterScreenCapture CParameterVnc CParameterSSH CParameterTelnet

Signals

void sigChanged ()
 emit when the parameter changes Usually if required, the corresponding parameter corresponds to a change event.
 

Public Member Functions

 CParameter (QObject *parent=nullptr, const QString &szPrefix=QString())
 
virtual int Load (QString szFile=QString())
 Load from file.
 
virtual int Save (QString szFile=QString(), bool bForce=true)
 Save to file.
 
virtual int Load (QSettings &set)
 Load from storage.
 
virtual int Save (QSettings &set, bool bForce=true)
 Save to storage.
 
virtual bool CheckValidity ()
 Check whether the parameter is valid to decide whether to use or save the parameter.
 

Protected Member Functions

virtual int OnLoad (QSettings &set)=0
 
virtual int OnSave (QSettings &set)=0
 
virtual bool OnCheckValidity ()
 Check validity.
 
int SetModified (bool bModified=true)
 When setting parameters, if there is a modification, it is called.
 
bool GetModified ()
 Whether the parameters have been modified.
 

Properties

bool Modified
 

Private Member Functions

int AddCategory (CParameter *p)
 Instances of this class and its derived classes are members of the instance.
 
QString GetPrefix () const
 
int SetPrefix (const QString &szPrefix)
 

Private Attributes

QString m_szPrefix
 
bool m_bModified
 If false, then don't save when save.
 
QVector< CParameter * > m_Category
 Category.
 

Detailed Description

Parameter interface.

Parameter category

Because there may be many parameters, it is necessary to classify them by parameter category. Each category can derive a separate class from this class. Each category is then used as a member variable in the derived classes of this class.

For example:
Connection parameters include the following categories:

Then the connection parameters can be a combination of the above categories:

class CParameterConnect : public CParameter
{
public:
explicit CParameterConnect(CParameter *parent = nullptr);
CParameterVideo m_Video;
CParameterAudio m_Audio;
};
CParameterConnect::CParameterConnect(CParameter *parent = nullptr)
: CParameter(parent),
m_Video(this),
m_Audio(this)
{}
Note
When a member is instantiated, the constructor must set the parent to this

CParameter Interface functions

Definition at line 168 of file Parameter.h.

Constructor & Destructor Documentation

◆ CParameter()

CParameter::CParameter ( QObject *  parent = nullptr,
const QString &  szPrefix = QString() 
)
explicit
Parameters
parent
  • An instance of this class or its derivative class, then automatically nest calls the OnXXX(ag: OnLoad) functions of member.
  • Is null or non-CParameter instance, then don't nest calls the OnXXX(ag: OnLoad) functions of member.
See also
Load(QSettings &set) Save(QSettings &set, bool bForce = true)
Parameters
szPrefixPrefix
See also
QSetting::beginGroup
Parameters
szPrefix前缀。
See also
QSetting::beginGroup

◆ ~CParameter()

CParameter::~CParameter ( )
virtual

Definition at line 19 of file Parameter.cpp.

Member Function Documentation

◆ AddCategory()

int CParameter::AddCategory ( CParameter p)
private

Instances of this class and its derived classes are members of the instance.

Definition at line 130 of file Parameter.cpp.

◆ CheckValidity()

bool CParameter::CheckValidity ( )
virtual

Check whether the parameter is valid to decide whether to use or save the parameter.


Derived classes typically simply overload OnCheckValidity() to check the parameters.

For example, when setting the parameters in the dialog, you need to check whether the parameters are complete or valid before you can save them.

Definition at line 99 of file Parameter.cpp.

◆ GetModified()

bool CParameter::GetModified ( )
protected

Whether the parameters have been modified.

GetModified

Returns
  • true: modified
  • false: no modified

Definition at line 117 of file Parameter.cpp.

◆ GetPrefix()

QString CParameter::GetPrefix ( ) const
private

Definition at line 22 of file Parameter.cpp.

◆ Load() [1/2]

int CParameter::Load ( QSettings &  set)
virtual

Load from storage.

Reimplemented in CParameterTerminal.

Definition at line 56 of file Parameter.cpp.

◆ Load() [2/2]

int CParameter::Load ( QString  szFile = QString())
virtual

Load from file.

Definition at line 33 of file Parameter.cpp.

◆ OnCheckValidity()

bool CParameter::OnCheckValidity ( )
protectedvirtual

Check validity.

Returns
  • true: valid
  • false: invalid

Reimplemented in CParameterVnc, and CParameterWakeOnLan.

Definition at line 111 of file Parameter.cpp.

◆ OnLoad()

virtual int CParameter::OnLoad ( QSettings &  set)
protectedpure virtual

◆ OnSave()

virtual int CParameter::OnSave ( QSettings &  set)
protectedpure virtual

Implemented in CParameterClient.

◆ Save() [1/2]

int CParameter::Save ( QSettings &  set,
bool  bForce = true 
)
virtual

Save to storage.

Definition at line 77 of file Parameter.cpp.

◆ Save() [2/2]

int CParameter::Save ( QString  szFile = QString(),
bool  bForce = true 
)
virtual

Save to file.

Definition at line 44 of file Parameter.cpp.

◆ SetModified()

int CParameter::SetModified ( bool  bModified = true)
protected

When setting parameters, if there is a modification, it is called.

Parameters
bModified

Definition at line 122 of file Parameter.cpp.

◆ SetPrefix()

int CParameter::SetPrefix ( const QString &  szPrefix)
private

Definition at line 27 of file Parameter.cpp.

Member Data Documentation

◆ m_bModified

bool CParameter::m_bModified
private

If false, then don't save when save.

Definition at line 296 of file Parameter.h.

◆ m_Category

QVector<CParameter*> CParameter::m_Category
private

Category.

Definition at line 302 of file Parameter.h.

◆ m_szPrefix

QString CParameter::m_szPrefix
private

Definition at line 288 of file Parameter.h.

Property Documentation

◆ Modified

bool CParameter::Modified
readwrite

Definition at line 171 of file Parameter.h.


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