• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KDECore

KRootProp Class Reference

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

#include <krootprop.h>

List of all members.


Public Member Functions

void destroy ()
 KRootProp (const QString &rProp=QString::null)
QStringList listEntries () const
QString prop () const
QColor readColorEntry (const QString &rKey, const QColor *pDefault=0) const
QString readEntry (const QString &rKey, const QString &pDefault=QString::null) const
QFont readFontEntry (const QString &rKey, const QFont *pDefault=0) const
int readNumEntry (const QString &rKey, int nDefault=0) const
QString removeEntry (const QString &rKey)
void setProp (const QString &rProp=QString())
void sync ()
QString writeEntry (const QString &rKey, const QColor &rColor)
QString writeEntry (const QString &rKey, const QFont &rFont)
QString writeEntry (const QString &rKey, int nValue)
QString writeEntry (const QString &rKey, const QString &rValue)
 ~KRootProp ()

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::KConfig
Author:
Mark Donohoe (donohe@kde.org)

Definition at line 46 of file krootprop.h.


Constructor & Destructor Documentation

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

Constructs a KRootProp object for the property rProp.

Parameters:
rProp the property that will be searched, null to do nothing
See also:
setProp()

KRootProp::~KRootProp (  ) 

Destructs the KRootProp object.

Writes back any dirty configuration entries.


Member Function Documentation

void KRootProp::destroy (  ) 

Destroys the property completely.

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

QStringList KRootProp::listEntries (  )  const

Returns a list of all keys.

Returns:
A QStringList containing all the keys.

QString KRootProp::prop (  )  const

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

Returns:
the property that will be searched

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

Reads a QColor.

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

Parameters:
rKey The key to search for.
pDefault A 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 KRootProp::readEntry ( const QString &  rKey,
const QString &  pDefault = QString::null 
) const

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

Parameters:
rKey The key to search for.
pDefault A default value returned if the key was not found.
Returns:
The value for this key or the default if no value was found.

QFont KRootProp::readFontEntry ( const QString &  rKey,
const QFont *  pDefault = 0 
) 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:
rKey The key to search for.
pDefault A default value returned if the key was not found.
Returns:
The value for this key or a default font if no value was found.

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

Reads a numerical value.

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

Parameters:
rKey The key to search for.
nDefault A default value returned if the key was not found.
Returns:
The value for this key or the default if no value was found.

QString KRootProp::removeEntry ( const QString &  rKey  ) 

Removes an entry.

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

void KRootProp::setProp ( const QString &  rProp = QString()  ) 

Sets the property in which keys will be searched.

Parameters:
rProp the property that will be searched

void KRootProp::sync (  ) 

Flushes the entry cache.

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

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

Writes the (key/value) pair.

Same as above, but writes a color.

Parameters:
rKey The key to write.
rColor The color to write.
Returns:
The old value for this key. If this key did not exist, a null string is returned.

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

Writes the (key/value) pair.

Same as above, but writes a font.

Parameters:
rKey The key to write.
rFont The font to write.
Returns:
The old value for this key. If this key did not exist, a null string is returned.

QString KRootProp::writeEntry ( const QString &  rKey,
int  nValue 
)

Writes the (key/value) pair.

Same as above, but writes a numerical value.

Parameters:
rKey The key to write.
nValue The value to write.
Returns:
The old value for this key. If this key did not exist, a null string is returned.

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

Writes a (key/value) pair.

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

Parameters:
rKey The key to write.
rValue The value to write.
Returns:
The old value for this key. If this key did not exist, a null string is returned.


The documentation for this class was generated from the following file:
  • krootprop.h

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal