class KConfigBase


Contains pure virtuals
Definition#include <kconfigbase.h>
InheritsQObject (qt)
Inherited byKSimpleConfig, KConfig
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Members

Protected Members

KConfigBaseData* data ()
[protected const]

Access to the configuration data.

Returns: a pointer to the configuration base data

void setLocale ()
[protected]

Read the locale and put in the configuration data struct. Note: This should be done in the constructor, but this is not possible due to some mutual dependencies in KApplication::init()

void parseConfigFiles ()
[protected pure virtual]

Parse all configuration files for a configuration object.

This method must be reimplemented by the derived classes. It should go through the list of appropriate files for a configuration object, open the files and call parseOneConfigFile() for each one of them.

void parseOneConfigFile ( QFile& rFile, KGroupDict* pGroup = 0L, bool bGlobal = false )
[protected virtual]

Parse one configuration file.

This method contains the actual configuration file parser. It can overridden by derived classes for specific parsing needs. For normal use, this should not be necessary.

Parameters:
rFileThe configuration file to parse
bGlobal

bool writeConfigFile ( QFile& rFile, bool bGlobal = false )
[protected pure virtual]

Write configuration file back.

This method must be reimplemented by derived classes. It should dump the data of the configuration object to the appropriate files.

Parameters:
rFileThe file to write
bGlobalShould the data be saved to a global file

Returns: Whether some entries are left to be written to other files.

KConfigBase ()

Construct a KConfigBase object.

~KConfigBase ()
[virtual]

Destructor.

Writes back any dirty configuration entries.

void setGroup ( const char* pGroup )

Specify the group in which keys will be searched.

Switch back to the default group by passing an empty string.

Parameters:
pGroupThe name of the new group.

const char* group ()
[const]

Retrieve the group where keys are currently searched in.

Returns: The current group

const char* getGroup ()
[const]

Retrieve the group where keys are currently searched in. Note: this method is deprecated; use KConfigBase::group() instead.

Returns: The current group

const QString readEntry ( const char* pKey, const char* pDefault = 0L )
[const]

Read the value of an entry specified by rKey in the current group

Parameters:
pKeyThe key to search for.
pDefaultA default value returned if the key was not found.

Returns: The value for this key or an empty string if no value was found.

int readListEntry ( const char* pKey, QStrList &list, char sep = ',' )
[const]

Read a list of strings.

Parameters:
pKeyThe key to search for
listIn this object, the read list will be returned.
sepThe list separator (default ",")

Returns: The number of entries in the list.

int readNumEntry ( const char* pKey, int nDefault = 0 )
[const]

Read a numerical value.

Read the value of an entry specified by rKey in the current group and interpret it numerically.

Parameters:
pKeyThe key to search for.
nDefaultA default value returned if the key was not found.

Returns: The value for this key or 0 if no value was found.

unsigned int readUnsignedNumEntry ( const char* pKey, unsigned int nDefault = 0 )
[const]

Read a numerical value.

Read the value of an entry specified by rKey in the current group and interpret it numerically.

Parameters:
pKeyThe key to search for.
nDefaultA default value returned if the key was not found.

Returns: The value for this key or 0 if no value was found.

long readLongNumEntry ( const char* pKey, long nDefault = 0 )
[const]

Read a numerical value.

Read the value of an entry specified by rKey in the current group and interpret it numerically.

Parameters:
pKeyThe key to search for.
nDefaultA default value returned if the key was not found.

Returns: The value for this key or 0 if no value was found.

unsigned long readUnsignedLongNumEntry ( const char* pKey, unsigned long nDefault = 0 )
[const]

Read a numerical value.

Read the value of an entry specified by rKey in the current group and interpret it numerically.

Parameters:
pKeyThe key to search for.
nDefaultA default value returned if the key was not found.

Returns: The value for this key or 0 if no value was found.

double readDoubleNumEntry ( const char* pKey, double nDefault = 0.0 )
[const]

Read a numerical value.

Read the value of an entry specified by rKey in the current group and interpret it numerically.

Parameters:
pKeyThe key to search for.
nDefaultA default value returned if the key was not found.

Returns: The value for this key or 0 if no value was found.

QFont readFontEntry ( const char* pKey, const QFont* pDefault = 0L )
[const]

Read a QFont.

Read the value of an entry specified by rKey in the current group and interpret it as a font object.

Parameters:
pKeyThe key to search for.
pDefaultA default value returned if the key was not found.

Returns: The value for this key or a default font if no value was found.

bool readBoolEntry ( const char* pKey, const bool bDefault = false )
[const]

Read a boolean entry.

Read the value of an entry specified by pKey in the current group and interpret it as a boolean value. Currently "on" and "true" are accepted as true, everything else if false.

Parameters:
pKeyThe key to search for
bDefaultA default value returned if the key was not found.

Returns: The value for this key or a default value if no value was found.

QRect readRectEntry ( const char* pKey, const QRect* pDefault = 0L )
[const]

Read a rect entry.

Read the value of an entry specified by pKey in the current group and interpret it as a QRect object.

Parameters:
pKeyThe key to search for
pDefaultA default value returned if the key was not found.

Returns: The value for this key or a default rectangle if no value was found.

QPoint readPointEntry ( const char* pKey, const QPoint* pDefault = 0L )
[const]

Read a point entry.

Read the value of an entry specified by pKey in the current group and interpret it as a QPoint object.

Parameters:
pKeyThe key to search for
pDefaultA default value returned if the key was not found.

Returns: The value for this key or a default point if no value was found.

QSize readSizeEntry ( const char* pKey, const QSize* pDefault = 0L )
[const]

Read a size entry.

Read the value of an entry specified by pKey in the current group and interpret it as a QSize object.

Parameters:
pKeyThe key to search for
pDefaultA default value returned if the key was not found.

Returns: The value for this key or a default point if no value was found.

QColor readColorEntry ( const char* pKey, const QColor* pDefault = 0L )
[const]

Read a QColor.

Read the value of an entry specified by rKey in the current group and interpret it as a color.

Parameters:
pKeyThe key to search for.
pDefaultA default value returned if the key was not found.

Returns: The value for this key or a default color if no value was found.

const char* writeEntry ( const char* pKey, const char* pValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

Write the key/value pair.

This is stored to the most specific config file when destroying the config object or when calling sync().

Parameters:
pKeyThe key to write.
pValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

Returns: The old value for this key. If this key did not exist, a null string is returned.

void writeEntry ( const char* pKey, QStrList &list, char sep = ',', bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

writeEntry() overriden to accept a list of strings.

Note: Unlike the other writeEntry() functions, the old value is _not_ returned here!

Parameters:
pKeyThe key to write
listThe list to write
sepThe list separator
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

See also: writeEntry

const char* writeEntry ( const char* pKey, int nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

Write the key value pair. Same as above, but write a numerical value.

Parameters:
pKeyThe key to write.
nValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

Returns: The old value for this key. If this key did not exist, a null string is returned.

const char* writeEntry ( const char* pKey, unsigned int nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

Write the key value pair. Same as above, but write an unsigned numerical value.

Parameters:
pKeyThe key to write.
nValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

Returns: The old value for this key. If this key did not exist, a null string is returned.

const char* writeEntry ( const char* pKey, long nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

Write the key value pair. Same as above, but write a long numerical value.

Parameters:
pKeyThe key to write.
nValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

Returns: The old value for this key. If this key did not exist, a null string is returned.

const char* writeEntry ( const char* pKey, unsigned long nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

Write the key value pair. Same as above, but write an unsigned long numerical value.

Parameters:
pKeyThe key to write.
nValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

Returns: The old value for this key. If this key did not exist, a null string is returned.

const char* writeEntry ( const char* pKey, double nValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

Write the key value pair. Same as above, but write a floating-point value.

Parameters:
pKeyThe key to write.
nValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

Returns: The old value for this key. If this key did not exist, a null string is returned.

const char* writeEntry ( const char* pKey, bool bValue, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

Write the key value pair. Same as above, but write a boolean value.

Parameters:
pKeyThe key to write.
bValueThe value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

Returns: The old value for this key. If this key did not exist, a null string is returned.

const char* writeEntry ( const char* pKey, const QFont& rFont, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

Write the key value pair. Same as above, but write a font

Parameters:
pKeyThe key to write.
rFontThe font value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

Returns: The old value for this key. If this key did not exist, a null string is returned.

void writeEntry ( const char* pKey, const QColor& rColor, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

Write the key value pair. Same as above, but write a color

Parameters:
pKeyThe key to write.
rValueThe color value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

Returns: The old value for this key. If this key did not exist, a null string is returned.

void writeEntry ( const char* pKey, const QRect& rColor, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

Write the key value pair. Same as above, but write a rectangle

Parameters:
pKeyThe key to write.
rValueThe rectangle value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

Returns: The old value for this key. If this key did not exist, a null string is returned.

void writeEntry ( const char* pKey, const QPoint& rColor, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

Write the key value pair. Same as above, but write a point

Parameters:
pKeyThe key to write.
rValueThe point value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

Returns: The old value for this key. If this key did not exist, a null string is returned.

void writeEntry ( const char* pKey, const QSize& rColor, bool bPersistent = true, bool bGlobal = false, bool bNLS = false )

Write the key value pair. Same as above, but write a size

Parameters:
pKeyThe key to write.
rValueThe size value to write.
bPersistentIf bPersistent is false, the entry's dirty flag will not be set and thus the entry will not be written to disk at deletion time.
bGlobalIf bGlobal is true, the pair is not saved to the application specific config file, but to the global ~/.kderc
bNLSIf bNLS is true, the locale tag is added to the key when writing it back.

Returns: The old value for this key. If this key did not exist, a null string is returned.

void setDollarExpansion ( bool bExpand = true )

Turns on or off "dollar expansion" when reading config entries.

Parameters:
bExpandif true, dollar expansion is turned on.

bool isDollarExpansion ()
[const]

Returns whether dollar expansion is on or off.

Returns: true if dollar expansion is on.

void rollback ( bool bDeep = true )
[virtual]

Don't write dirty entries at destruction time. If bDeep is false, only the global dirty flag of the KConfig object gets cleared. If you then call writeEntry again, the global dirty flag is set again and all dirty entries will be written.

Parameters:
bDeepif true, the dirty flags of all entries are cleared, as well as the global dirty flag.

void sync ()
[pure virtual]

Flush the entry cache. Write back dirty configuration entries to the most specific file. This is called automatically from the destructor. This method must be implemented by the derived classes.

bool hasKey ( const char* pKey )
[const]

Check if the key has an entry in the specified group Use this to determine if a key is not specified for the current group (HasKey returns false) or is specified but has no value ("key =EOL"; Has Key returns true, ReadEntry returns an empty string)

Parameters:
pKeyThe key to search for.

Returns: if true, the key is available

KGroupIterator* groupIterator (void)

Returns an iterator on the list of groups

Returns: The group iterator. The caller is reponsable for deleting the iterator after using it.

KEntryIterator* entryIterator ( const char* pGroup )

Returns an iterator on the entries in the current group

Parameters:
pGroupthe group to provide an iterator for

Returns: The iterator for the group or 0, if the group does not exist. The caller is responsible for deleting the iterator after using it.

void reparseConfiguration ()
[virtual]

Reparses all configuration files. This is useful for programms which use standalone graphical configuration tools.


Generated by: root@porky.devel.redhat.com on Fri Sep 24 17:45:02 199.