class KRootProp

Access KDE desktop resources stored on the root window. More...

Definition#include <krootprop.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods


Detailed Description

Access KDE desktop resources stored on the root window.

A companion to the KConfig class.

The KRootProp class is used for reading and writing configuration entries to properties on the root window.

All configuration entries are of the form "key=value".

See also: KConfig

 KRootProp ( const QString& rProp = QString::null )

KRootProp

Constructs a KRootProp object for the property rProp.

 ~KRootProp ()

~KRootProp

Destructs the KRootProp object.

Writes back any dirty configuration entries.

void  setProp (const QString& rProp="")

setProp

Sets the property in which keys will be searched.

QString  prop ()

prop

[const]

Returns the name of the property under which keys are searched.

void  destroy ()

destroy

Destroys the property completely.

I.e. all entries will be cleared and the property will be removed from the root window.

QString  readEntry ( const QString& rKey, const QString& pDefault = QString::null )

readEntry

[const]

Reads the value of an entry specified by rKey in the current property.

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

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

int  readNumEntry ( const QString& rKey, int nDefault = 0 )

readNumEntry

[const]

Reads a numerical value.

Reads the value of an entry specified by rKey in the current property and interprets it numerically.

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

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

QFont  readFontEntry ( const QString& rKey, const QFont* pDefault = 0 )

readFontEntry

[const]

Reads a QFont value.

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

Parameters:
rKeyThe 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.

QColor  readColorEntry ( const QString& rKey, const QColor* pDefault = 0 )

readColorEntry

[const]

Reads a QColor.

Reads the value of an entry specified by rKey in the current property and interprets it as a color.

Parameters:
rKeyThe 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.

QString  writeEntry ( const QString& rKey, const QString& rValue )

writeEntry

Writes a (key/value) pair.

This is stored to the current property when destroying the config object or when calling sync().

Parameters:
rKeyThe key to write.
rValueThe value to write.

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

QString  writeEntry ( const QString& rKey, int nValue )

writeEntry

Writes the (key/value) pair. Same as above, but writes a numerical value.

Parameters:
rKeyThe key to write.
nValueThe value to write.

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

QString  writeEntry ( const QString& rKey, const QFont& rFont )

writeEntry

Writes the (key/value) pair. Same as above, but writes a font.

Parameters:
rKeyThe key to write.
rValueThe value to write.

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

QString  writeEntry ( const QString& rKey, const QColor& rColor )

writeEntry

Writes the (key/value) pair. Same as above, but writes a color.

Parameters:
rKeyThe key to write.
rValueThe value to write.

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

QString  removeEntry (const QString& rKey)

removeEntry

Removes an entry.

Parameters:
rKeyThe key to remove.

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

QStringList  listEntries ()

listEntries

[const]

Returns a list of all keys.

Returns: A QStringList containing all the keys.

void  sync ()

sync

Flushes the entry cache. Writes back dirty configuration entries to the current property, This is called automatically from the destructor.