KVIrc  4.9.2
DeveloperAPIs
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Private Attributes | List of all members
KviIdentityProfileSet Class Reference

Class which manages the list of identity profiles. More...

#include <KviIdentityProfileSet.h>

+ Inheritance diagram for KviIdentityProfileSet:

Public Member Functions

void addProfile (KviIdentityProfile *pProfile)
 Adds a profile to the set. More...
 
void clear ()
 Clears the list. More...
 
void copyFrom (const KviIdentityProfileSet &src)
 Carbon copy. More...
 
unsigned int count ()
 Returns the number of instances of the class. More...
 
KviIdentityProfilefindName (const QString &szName)
 Searches for a profile name. Returns true if the profile exists. More...
 
KviIdentityProfilefindNetwork (const QString &szNetwork)
 Searches for a profile network. Returns true if the profile exists. More...
 
bool isEmpty ()
 Returns true if the profile set is empty. More...
 
bool isEnabled ()
 Returns true if the profile set is enabled. More...
 
 KviIdentityProfileSet ()
 Constructs the identity profile set object. More...
 
 KviIdentityProfileSet (const KviIdentityProfileSet &set)
 Constructs the identity profile set object. More...
 
void load (const QString &szConfigFile)
 Loads the configuration of the profiles from file. More...
 
KviPointerList
< KviIdentityProfile > * 
profiles ()
 Returns the profiles set. More...
 
void save (const QString &szConfigFile)
 Saves the configuration of the profiles to file. More...
 
void save (KviConfigurationFile *pCfg, const QString &szPrefix)
 Saves the configuration of the profiles. More...
 
void setEnabled (bool bEnabled)
 Enables the profile set. More...
 
 ~KviIdentityProfileSet ()
 Destroys the identity profile set object. More...
 

Static Public Member Functions

static void done ()
 Destroys the class instance. More...
 
static void init ()
 Initializes the class instance. More...
 
static KviIdentityProfileSetinstance ()
 Returns the instance of the class. More...
 

Protected Member Functions

bool loadPrivate (KviConfigurationFile *pCfg, const QString &szPrefix, unsigned int uEntries)
 Loads the configuration of the profiles from file. More...
 

Protected Attributes

bool m_bEnabled
 
KviPointerList
< KviIdentityProfile > * 
m_pProfiles
 

Static Private Attributes

static KviIdentityProfileSetm_pSelf = nullptr
 
static unsigned int m_uCount = 0
 

Detailed Description

Class which manages the list of identity profiles.

Constructor & Destructor Documentation

KviIdentityProfileSet::KviIdentityProfileSet ( )

Constructs the identity profile set object.

Returns
KviIdentityProfileSet

References m_bEnabled, and m_pProfiles.

Referenced by init().

KviIdentityProfileSet::KviIdentityProfileSet ( const KviIdentityProfileSet set)

Constructs the identity profile set object.

This is a carbon copy.

Parameters
setA profile set to copy from
Returns
KviIdentityProfileSet

References copyFrom(), and m_pProfiles.

KviIdentityProfileSet::~KviIdentityProfileSet ( )

Destroys the identity profile set object.

References m_pProfiles.

Member Function Documentation

void KviIdentityProfileSet::addProfile ( KviIdentityProfile pProfile)

Adds a profile to the set.

Parameters
pProfileThe source profile to add
Returns
void

References KviPointerList< T >::append(), m_pProfiles, and KviPointerList< T >::setAutoDelete().

Referenced by OptionsWidget_identityProfile::commit().

void KviIdentityProfileSet::clear ( )

Clears the list.

Returns
void

References m_bEnabled, and m_pProfiles.

Referenced by OptionsWidget_identityProfile::commit(), and load().

void KviIdentityProfileSet::copyFrom ( const KviIdentityProfileSet src)
unsigned int KviIdentityProfileSet::count ( )
inline

Returns the number of instances of the class.

Returns
unsigned int

Referenced by done(), and init().

void KviIdentityProfileSet::done ( )
static

Destroys the class instance.

Returns
void

References count(), m_pSelf, and m_uCount.

Referenced by KviApplication::~KviApplication().

KviIdentityProfile * KviIdentityProfileSet::findName ( const QString &  szName)

Searches for a profile name. Returns true if the profile exists.

Parameters
szNameThe name of the profile
Returns
KviIdentityProfile *

References KviPointerList< T >::first(), m_pProfiles, KviQString::matchString(), KviIdentityProfile::name(), and KviPointerList< T >::next().

KviIdentityProfile * KviIdentityProfileSet::findNetwork ( const QString &  szNetwork)

Searches for a profile network. Returns true if the profile exists.

Parameters
szNetworkThe network name of the profile
Returns
KviIdentityProfile *

References KviPointerList< T >::first(), m_pProfiles, KviQString::matchString(), KviIdentityProfile::network(), and KviPointerList< T >::next().

Referenced by KviIrcConnection::pickNextLoginNickName(), and KviIrcConnection::useProfileData().

void KviIdentityProfileSet::init ( )
static

Initializes the class instance.

Returns
void

References count(), KviIdentityProfileSet(), m_pSelf, and m_uCount.

Referenced by KviApplication::setup().

static KviIdentityProfileSet* KviIdentityProfileSet::instance ( )
inlinestatic
bool KviIdentityProfileSet::isEmpty ( )
inline
bool KviIdentityProfileSet::isEnabled ( )
inline
void KviIdentityProfileSet::load ( const QString &  szConfigFile)

Loads the configuration of the profiles from file.

Parameters
szConfigFileThe file where to load
Returns
void

References clear(), loadPrivate(), KviConfigurationFile::Read, and KviConfigurationFile::readUIntEntry().

Referenced by KviApplication::setup().

bool KviIdentityProfileSet::loadPrivate ( KviConfigurationFile pCfg,
const QString &  szPrefix,
unsigned int  uEntries 
)
protected

Loads the configuration of the profiles from file.

Parameters
pCfgThe configuration file
szPrefixThe prefix of the rules
uEntriesThe number of entries
Returns
bool

References KviPointerList< T >::append(), KviPointerList< T >::clear(), KviPointerList< T >::isEmpty(), KviIdentityProfile::load(), m_bEnabled, m_pProfiles, KviConfigurationFile::readBoolEntry(), KviPointerList< T >::setAutoDelete(), and u.

Referenced by load().

KviPointerList<KviIdentityProfile>* KviIdentityProfileSet::profiles ( )
inline
void KviIdentityProfileSet::save ( const QString &  szConfigFile)

Saves the configuration of the profiles to file.

Parameters
szConfigFileThe file to save
Returns
void

References KviConfigurationFile::clear(), and KviConfigurationFile::Write.

Referenced by KviApplication::saveIdentityProfiles().

void KviIdentityProfileSet::save ( KviConfigurationFile pCfg,
const QString &  szPrefix 
)

Saves the configuration of the profiles.

Parameters
pCfgThe configuration file
szPrefixThe prefix of the rules
Returns
void

References KviPointerList< T >::count(), KviPointerList< T >::first(), KviPointerList< T >::isEmpty(), m_bEnabled, m_pProfiles, KviPointerList< T >::next(), and KviConfigurationFile::writeEntry().

void KviIdentityProfileSet::setEnabled ( bool  bEnabled)
inline

Enables the profile set.

Parameters
bEnabledWhether to enable the profile set
Returns
void

Referenced by OptionsWidget_identityProfile::commit().

Member Data Documentation

bool KviIdentityProfileSet::m_bEnabled
protected
KviPointerList<KviIdentityProfile>* KviIdentityProfileSet::m_pProfiles
protected
KviIdentityProfileSet * KviIdentityProfileSet::m_pSelf = nullptr
staticprivate

Referenced by done(), and init().

unsigned int KviIdentityProfileSet::m_uCount = 0
staticprivate

Referenced by done(), and init().


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