KConfigSkeletonItem

Search for usage in LXR

#include <KConfigSkeletonItem>

Inheritance diagram for KConfigSkeletonItem:

Public Types

typedef QHash< QString, KConfigSkeletonItem * > Dict
 
typedef QHash< QString, KConfigSkeletonItem * >::Iterator DictIterator
 
typedef QList< KConfigSkeletonItem * > List
 

Public Member Functions

 KConfigSkeletonItem (const QString &_group, const QString &_key)
 
virtual ~KConfigSkeletonItem ()
 
KConfigGroup configGroup (KConfig *config) const
 
QVariant getDefault () const
 
QString group () const
 
bool isDefault () const
 
virtual bool isEqual (const QVariant &p) const =0
 
bool isImmutable () const
 
bool isSaveNeeded () const
 
QString key () const
 
QString label () const
 
virtual QVariant maxValue () const
 
virtual QVariant minValue () const
 
QString name () const
 
virtual QVariant property () const =0
 
virtual void readConfig (KConfig *)=0
 
virtual void readDefault (KConfig *)=0
 
virtual void setDefault ()=0
 
void setGroup (const QString &_group)
 
void setGroup (const KConfigGroup &cg)
 
void setKey (const QString &_key)
 
void setLabel (const QString &l)
 
void setName (const QString &_name)
 
virtual void setProperty (const QVariant &p)=0
 
void setToolTip (const QString &t)
 
void setWhatsThis (const QString &w)
 
void setWriteFlags (KConfigBase::WriteConfigFlags flags)
 
virtual void swapDefault ()=0
 
QString toolTip () const
 
QString whatsThis () const
 
virtual void writeConfig (KConfig *)=0
 
KConfigBase::WriteConfigFlags writeFlags () const
 

Protected Member Functions

 KConfigSkeletonItem (KConfigSkeletonItemPrivate &dd, const QString &_group, const QString &_key)
 
void readImmutability (const KConfigGroup &group)
 
void setGetDefaultImpl (const std::function< QVariant()> &impl)
 
void setIsDefaultImpl (const std::function< bool()> &impl)
 
void setIsSaveNeededImpl (const std::function< bool()> &impl)
 

Protected Attributes

KConfigSkeletonItemPrivate *const d_ptr
 
QString mGroup
 
QString mKey
 
QString mName
 

Detailed Description

Class for storing a preferences setting.

Author
Cornelius Schumacher
See also
KCoreConfigSkeleton

This class represents one preferences setting as used by KCoreConfigSkeleton. Subclasses of KConfigSkeletonItem implement storage functions for a certain type of setting. Normally you don't have to use this class directly. Use the special addItem() functions of KCoreConfigSkeleton instead. If you subclass this class you will have to register instances with the function KCoreConfigSkeleton::addItem().

Definition at line 41 of file kcoreconfigskeleton.h.

Constructor & Destructor Documentation

KConfigSkeletonItem::KConfigSkeletonItem ( const QString _group,
const QString _key 
)

Constructor.

Parameters
_groupConfig file group.
_keyConfig file key.

Definition at line 31 of file kcoreconfigskeleton.cpp.

KConfigSkeletonItem::~KConfigSkeletonItem ( )
virtual

Destructor.

Definition at line 45 of file kcoreconfigskeleton.cpp.

Member Function Documentation

KConfigGroup KConfigSkeletonItem::configGroup ( KConfig config) const

Return a KConfigGroup, the one provided by setGroup(KConfigGroup) if it's valid, or make one from.

Parameters
configand item's group
See also
setGroup(const QString &_group)
setGroup(KConfigGroup cg)
Since
5.68

Definition at line 61 of file kcoreconfigskeleton.cpp.

QVariant KConfigSkeletonItem::getDefault ( ) const

Returns the default value.

Since
5.74

Definition at line 171 of file kcoreconfigskeleton.cpp.

QString KConfigSkeletonItem::group ( ) const

Return config file group.

Definition at line 70 of file kcoreconfigskeleton.cpp.

bool KConfigSkeletonItem::isDefault ( ) const

Indicates if the item is set to its default value.

Since
5.64

Definition at line 159 of file kcoreconfigskeleton.cpp.

bool KConfigSkeletonItem::isImmutable ( ) const

Return if the entry can be modified.

Definition at line 153 of file kcoreconfigskeleton.cpp.

bool KConfigSkeletonItem::isSaveNeeded ( ) const

Indicates if the item has a different value than the previously loaded value.

Since
5.64

Definition at line 165 of file kcoreconfigskeleton.cpp.

QString KConfigSkeletonItem::key ( ) const

Return config file key.

Definition at line 80 of file kcoreconfigskeleton.cpp.

QString KConfigSkeletonItem::label ( ) const

Return label of item.

See setLabel().

Definition at line 101 of file kcoreconfigskeleton.cpp.

QVariant KConfigSkeletonItem::maxValue ( ) const
virtual
QVariant KConfigSkeletonItem::minValue ( ) const
virtual
QString KConfigSkeletonItem::name ( ) const

Return internal name of entry.

Definition at line 90 of file kcoreconfigskeleton.cpp.

virtual void KConfigSkeletonItem::readDefault ( KConfig )
pure virtual

Read global default value.

Implemented in KPropertySkeletonItem.

void KConfigSkeletonItem::readImmutability ( const KConfigGroup group)
protected

sets mIsImmutable to true if mKey in config is immutable

Parameters
groupKConfigGroup to check if mKey is immutable in

Definition at line 177 of file kcoreconfigskeleton.cpp.

virtual void KConfigSkeletonItem::setDefault ( )
pure virtual

Sets the current value to the default value.

Implemented in KPropertySkeletonItem.

void KConfigSkeletonItem::setGroup ( const QString _group)

Set config file group.

Definition at line 50 of file kcoreconfigskeleton.cpp.

void KConfigSkeletonItem::setGroup ( const KConfigGroup cg)

Set config file group but giving the KConfigGroup.

Allow the item to be in nested groups.

Since
5.68

Definition at line 55 of file kcoreconfigskeleton.cpp.

void KConfigSkeletonItem::setKey ( const QString _key)

Set config file key.

Definition at line 75 of file kcoreconfigskeleton.cpp.

void KConfigSkeletonItem::setLabel ( const QString l)

Set label providing a translated one-line description of the item.

Definition at line 95 of file kcoreconfigskeleton.cpp.

void KConfigSkeletonItem::setName ( const QString _name)

Set internal name of entry.

Definition at line 85 of file kcoreconfigskeleton.cpp.

void KConfigSkeletonItem::setToolTip ( const QString t)

Set ToolTip description of item.

Since
4.2

Definition at line 107 of file kcoreconfigskeleton.cpp.

void KConfigSkeletonItem::setWhatsThis ( const QString w)

Set WhatsThis description of item.

Definition at line 119 of file kcoreconfigskeleton.cpp.

void KConfigSkeletonItem::setWriteFlags ( KConfigBase::WriteConfigFlags  flags)

The write flags to be used when writing configuration.

Since
5.58

Definition at line 131 of file kcoreconfigskeleton.cpp.

virtual void KConfigSkeletonItem::swapDefault ( )
pure virtual

Exchanges the current value with the default value Used by KCoreConfigSkeleton::useDefaults(bool);.

Implemented in KPropertySkeletonItem.

QString KConfigSkeletonItem::toolTip ( ) const

Return ToolTip description of item.

See setToolTip().

Since
4.2

Definition at line 113 of file kcoreconfigskeleton.cpp.

QString KConfigSkeletonItem::whatsThis ( ) const

Return WhatsThis description of item.

See setWhatsThis().

Definition at line 125 of file kcoreconfigskeleton.cpp.

virtual void KConfigSkeletonItem::writeConfig ( KConfig )
pure virtual

This function is called by KCoreConfigSkeleton to write the value of this setting to a config file.

Make sure to pass writeFlags() to every call of writeEntry() and revertToDefault().

Implemented in KCoreConfigSkeleton::ItemUrlList, KCoreConfigSkeleton::ItemPathList, KCoreConfigSkeleton::ItemEnum, KCoreConfigSkeleton::ItemUrl, KCoreConfigSkeleton::ItemString, and KPropertySkeletonItem.

KConfigBase::WriteConfigFlags KConfigSkeletonItem::writeFlags ( ) const

Return write flags to be used when writing configuration.

They should be passed to every call of writeEntry() and revertToDefault().

Since
5.58

Definition at line 137 of file kcoreconfigskeleton.cpp.

Member Data Documentation

QString KConfigSkeletonItem::mGroup
protected

The group name for this item.

Definition at line 248 of file kcoreconfigskeleton.h.

QString KConfigSkeletonItem::mKey
protected

The config key for this item.

Definition at line 249 of file kcoreconfigskeleton.h.

QString KConfigSkeletonItem::mName
protected

The name of this item.

Definition at line 250 of file kcoreconfigskeleton.h.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Dec 6 2021 22:43:36 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.