• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

Public Member Functions | List of all members
KRootProp Class Reference

#include <krootprop.h>

Public Member Functions

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

Detailed Description

Access KDE desktop resources stored on the root window.

A companion to the TDEConfig 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
TDEConfig::TDEConfig
Author
Mark Donohoe (donoh.nosp@m.e@kd.nosp@m.e.org)

Definition at line 46 of file krootprop.h.

Constructor & Destructor Documentation

◆ KRootProp()

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

Constructs a KRootProp object for the property rProp.

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

◆ ~KRootProp()

KRootProp::~KRootProp ( )

Destructs the KRootProp object.

Writes back any dirty configuration entries.

Member Function Documentation

◆ destroy()

void KRootProp::destroy ( )

Destroys the property completely.

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

◆ listEntries()

TQStringList KRootProp::listEntries ( ) const

Returns a list of all keys.

Returns
A TQStringList containing all the keys.

◆ prop()

TQString KRootProp::prop ( ) const

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

Returns
the property that will be searched

◆ readColorEntry()

TQColor KRootProp::readColorEntry ( const TQString &  rKey,
const TQColor *  pDefault = 0 
) const

Reads a TQColor.

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.

◆ readEntry()

TQString KRootProp::readEntry ( const TQString &  rKey,
const TQString &  pDefault = TQString::null 
) 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.

◆ readFontEntry()

TQFont KRootProp::readFontEntry ( const TQString &  rKey,
const TQFont *  pDefault = 0 
) const

Reads a TQFont 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.

◆ readNumEntry()

int KRootProp::readNumEntry ( const TQString &  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
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.

◆ removeEntry()

TQString KRootProp::removeEntry ( const TQString &  rKey)

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.

◆ setProp()

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

Sets the property in which keys will be searched.

Parameters
rPropthe property that will be searched

◆ sync()

void KRootProp::sync ( )

Flushes the entry cache.

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

◆ writeEntry() [1/4]

TQString KRootProp::writeEntry ( const TQString &  rKey,
const TQColor &  rColor 
)

Writes the (key/value) pair.

Same as above, but writes a color.

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

◆ writeEntry() [2/4]

TQString KRootProp::writeEntry ( const TQString &  rKey,
const TQFont &  rFont 
)

Writes the (key/value) pair.

Same as above, but writes a font.

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

◆ writeEntry() [3/4]

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

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.

◆ writeEntry() [4/4]

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

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.

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

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.