\section{KRoot\-Prop Class Reference}
\label{classKRootProp}\index{KRootProp@{KRootProp}}
Access {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} desktop resources stored on the root window.  


{\tt \#include $<$krootprop.h$>$}

Collaboration diagram for KRoot\-Prop:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=143pt]{classKRootProp__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KRoot\-Prop} (const  {\bf QString} \&r\-Prop=QString::null)
\begin{CompactList}\small\item\em Constructs a KRoot\-Prop object for the property {\tt r\-Prop}. \item\end{CompactList}\item 
{\bf $\sim$KRoot\-Prop} ()
\begin{CompactList}\small\item\em Destructs the KRoot\-Prop object. \item\end{CompactList}\item 
void {\bf set\-Prop} (const  {\bf QString} \&r\-Prop=\char`\"{}\char`\"{})
\begin{CompactList}\small\item\em Sets the property in which keys will be searched. \item\end{CompactList}\item 
{\bf QString} {\bf prop} () const 
\begin{CompactList}\small\item\em Returns the name of the property under which keys are searched. \item\end{CompactList}\item 
void {\bf destroy} ()
\begin{CompactList}\small\item\em Destroys the property completely. \item\end{CompactList}\item 
{\bf QString} {\bf read\-Entry} (const  {\bf QString} \&r\-Key, const  {\bf QString} \&p\-Default=QString::null) const 
\begin{CompactList}\small\item\em Reads the value of an entry specified by {\tt r\-Key} in the current property. \item\end{CompactList}\item 
int {\bf read\-Num\-Entry} (const  {\bf QString} \&r\-Key, int n\-Default=0) const 
\begin{CompactList}\small\item\em Reads a numerical value. \item\end{CompactList}\item 
{\bf QFont} {\bf read\-Font\-Entry} (const  {\bf QString} \&r\-Key, const  {\bf QFont} $\ast$p\-Default=0) const 
\begin{CompactList}\small\item\em Reads a {\bf QFont} value. \item\end{CompactList}\item 
{\bf QColor} {\bf read\-Color\-Entry} (const  {\bf QString} \&r\-Key, const  {\bf QColor} $\ast$p\-Default=0) const 
\begin{CompactList}\small\item\em Reads a {\bf QColor}. \item\end{CompactList}\item 
{\bf QString} {\bf write\-Entry} (const  {\bf QString} \&r\-Key, const  {\bf QString} \&r\-Value)
\begin{CompactList}\small\item\em Writes a (key/value) pair. \item\end{CompactList}\item 
{\bf QString} {\bf write\-Entry} (const  {\bf QString} \&r\-Key, int n\-Value)
\begin{CompactList}\small\item\em Writes the (key/value) pair. \item\end{CompactList}\item 
{\bf QString} {\bf write\-Entry} (const  {\bf QString} \&r\-Key, const  {\bf QFont} \&r\-Font)
\begin{CompactList}\small\item\em Writes the (key/value) pair. \item\end{CompactList}\item 
{\bf QString} {\bf write\-Entry} (const  {\bf QString} \&r\-Key, const  {\bf QColor} \&r\-Color)
\begin{CompactList}\small\item\em Writes the (key/value) pair. \item\end{CompactList}\item 
{\bf QString} {\bf remove\-Entry} (const  {\bf QString} \&r\-Key)
\begin{CompactList}\small\item\em Removes an entry. \item\end{CompactList}\item 
{\bf QString\-List} {\bf list\-Entries} () const 
\begin{CompactList}\small\item\em Returns a list of all keys. \item\end{CompactList}\item 
void {\bf sync} ()
\begin{CompactList}\small\item\em Flushes the entry cache. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Access {\bf KDE}{\rm (p.\,\pageref{namespaceKDE})} desktop resources stored on the root window. 

A companion to the {\bf KConfig}{\rm (p.\,\pageref{classKConfig})} class.

The KRoot\-Prop class is used for reading and writing configuration entries to properties on the root window.

All configuration entries are of the form \char`\"{}key=value\char`\"{}.

\begin{Desc}
\item[See also:]{\bf KConfig::KConfig}{\rm (p.\,\pageref{classKConfig_a0})} \end{Desc}
\begin{Desc}
\item[Author:]Mark Donohoe ({\tt donohe@kde.org}) \end{Desc}
\begin{Desc}
\item[Version:]\begin{Desc}
\item[Id]{\bf krootprop.h}{\rm (p.\,\pageref{krootprop_8h})},v 1.20 2002/09/19 20:05:11 tjansen Exp \end{Desc}
\end{Desc}




Definition at line 45 of file krootprop.h.

\subsection{Constructor \& Destructor Documentation}
\index{KRootProp@{KRoot\-Prop}!KRootProp@{KRootProp}}
\index{KRootProp@{KRootProp}!KRootProp@{KRoot\-Prop}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRoot\-Prop::KRoot\-Prop (const {\bf QString} \& {\em r\-Prop} = QString::null)}\label{classKRootProp_a0}


Constructs a KRoot\-Prop object for the property {\tt r\-Prop}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em r\-Prop}]the property that will be searched, null to do nothing \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf set\-Prop()}{\rm (p.\,\pageref{classKRootProp_a2})} \end{Desc}


Definition at line 32 of file krootprop.cpp.

References set\-Prop().\index{KRootProp@{KRoot\-Prop}!~KRootProp@{$\sim$KRootProp}}
\index{~KRootProp@{$\sim$KRootProp}!KRootProp@{KRoot\-Prop}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KRoot\-Prop::$\sim${\bf KRoot\-Prop} ()}\label{classKRootProp_a1}


Destructs the KRoot\-Prop object. 

Writes back any dirty configuration entries. 

Definition at line 39 of file krootprop.cpp.

References QMap$<$ QString, QString $>$::clear(), and sync().

\subsection{Member Function Documentation}
\index{KRootProp@{KRoot\-Prop}!setProp@{setProp}}
\index{setProp@{setProp}!KRootProp@{KRoot\-Prop}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRoot\-Prop::set\-Prop (const {\bf QString} \& {\em r\-Prop} = \char`\"{}\char`\"{})}\label{classKRootProp_a2}


Sets the property in which keys will be searched. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em r\-Prop}]the property that will be searched \end{description}
\end{Desc}


Definition at line 71 of file krootprop.cpp.

References QString::find(), QString::from\-Utf8(), QMap$<$ QString, QString $>$::insert(), KStd\-Accel::key(), QString::left(), QString::length(), QString::mid(), QString::remove(), QString::simplify\-White\-Space(), and sync().

Referenced by KRoot\-Prop().\index{KRootProp@{KRoot\-Prop}!prop@{prop}}
\index{prop@{prop}!KRootProp@{KRoot\-Prop}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KRoot\-Prop::prop () const}\label{classKRootProp_a3}


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

\begin{Desc}
\item[Returns:]the property that will be searched \end{Desc}


Definition at line 141 of file krootprop.cpp.\index{KRootProp@{KRoot\-Prop}!destroy@{destroy}}
\index{destroy@{destroy}!KRootProp@{KRoot\-Prop}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRoot\-Prop::destroy ()}\label{classKRootProp_a4}


Destroys the property completely. 

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

Definition at line 146 of file krootprop.cpp.

References QMap$<$ QString, QString $>$::clear().\index{KRootProp@{KRoot\-Prop}!readEntry@{readEntry}}
\index{readEntry@{readEntry}!KRootProp@{KRoot\-Prop}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KRoot\-Prop::read\-Entry (const {\bf QString} \& {\em r\-Key}, const {\bf QString} \& {\em p\-Default} = QString::null) const}\label{classKRootProp_a5}


Reads the value of an entry specified by {\tt r\-Key} in the current property. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em r\-Key}]The key to search for. \item[{\em p\-Default}]A default value returned if the key was not found. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The value for this key or the default if no value was found. \end{Desc}


Definition at line 156 of file krootprop.cpp.

References QMap$<$ QString, QString $>$::contains().

Referenced by read\-Color\-Entry(), read\-Font\-Entry(), and read\-Num\-Entry().\index{KRootProp@{KRoot\-Prop}!readNumEntry@{readNumEntry}}
\index{readNumEntry@{readNumEntry}!KRootProp@{KRoot\-Prop}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KRoot\-Prop::read\-Num\-Entry (const {\bf QString} \& {\em r\-Key}, int {\em n\-Default} = 0) const}\label{classKRootProp_a6}


Reads a numerical value. 

Reads the value of an entry specified by {\tt r\-Key} in the current property and interprets it numerically.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em r\-Key}]The key to search for. \item[{\em n\-Default}]A default value returned if the key was not found. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The value for this key or the default if no value was found. \end{Desc}


Definition at line 165 of file krootprop.cpp.

References QString::is\-Null(), read\-Entry(), and QString::to\-Int().\index{KRootProp@{KRoot\-Prop}!readFontEntry@{readFontEntry}}
\index{readFontEntry@{readFontEntry}!KRootProp@{KRoot\-Prop}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QFont} KRoot\-Prop::read\-Font\-Entry (const {\bf QString} \& {\em r\-Key}, const {\bf QFont} $\ast$ {\em p\-Default} = 0) const}\label{classKRootProp_a7}


Reads a {\bf QFont} value. 

Reads the value of an entry specified by {\tt r\-Key} in the current property and interpret it as a font object.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em r\-Key}]The key to search for. \item[{\em p\-Default}]A default value returned if the key was not found. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The value for this key or a default font if no value was found. \end{Desc}


Definition at line 181 of file krootprop.cpp.

References QFont::from\-String(), QString::is\-Null(), and read\-Entry().\index{KRootProp@{KRoot\-Prop}!readColorEntry@{readColorEntry}}
\index{readColorEntry@{readColorEntry}!KRootProp@{KRoot\-Prop}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QColor} KRoot\-Prop::read\-Color\-Entry (const {\bf QString} \& {\em r\-Key}, const {\bf QColor} $\ast$ {\em p\-Default} = 0) const}\label{classKRootProp_a8}


Reads a {\bf QColor}. 

Reads the value of an entry specified by {\tt r\-Key} in the current property and interprets it as a color.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em r\-Key}]The key to search for. \item[{\em p\-Default}]A default value returned if the key was not found. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The value for this key or a default color if no value was found. \end{Desc}


Definition at line 201 of file krootprop.cpp.

References QString::find(), QString::is\-Null(), QString::left(), QString::mid(), read\-Entry(), QColor::set\-Named\-Color(), and QColor::set\-Rgb().\index{KRootProp@{KRoot\-Prop}!writeEntry@{writeEntry}}
\index{writeEntry@{writeEntry}!KRootProp@{KRoot\-Prop}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KRoot\-Prop::write\-Entry (const {\bf QString} \& {\em r\-Key}, const {\bf QString} \& {\em r\-Value})}\label{classKRootProp_a9}


Writes a (key/value) pair. 

This is stored to the current property when destroying the config object or when calling {\bf sync}{\rm (p.\,\pageref{classKRootProp_a15})}().

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em r\-Key}]The key to write. \item[{\em r\-Value}]The value to write. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The old value for this key. If this key did not exist, a null string is returned. \end{Desc}


Definition at line 242 of file krootprop.cpp.

References QMap$<$ QString, QString $>$::contains(), QMap$<$ QString, QString $>$::insert(), and QString::replace().

Referenced by write\-Entry().\index{KRootProp@{KRoot\-Prop}!writeEntry@{writeEntry}}
\index{writeEntry@{writeEntry}!KRootProp@{KRoot\-Prop}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KRoot\-Prop::write\-Entry (const {\bf QString} \& {\em r\-Key}, int {\em n\-Value})}\label{classKRootProp_a10}


Writes the (key/value) pair. 

Same as above, but writes a numerical value. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em r\-Key}]The key to write. \item[{\em n\-Value}]The value to write. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The old value for this key. If this key did not exist, a null string is returned. \end{Desc}


Definition at line 256 of file krootprop.cpp.

References QString::set\-Num(), and write\-Entry().\index{KRootProp@{KRoot\-Prop}!writeEntry@{writeEntry}}
\index{writeEntry@{writeEntry}!KRootProp@{KRoot\-Prop}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KRoot\-Prop::write\-Entry (const {\bf QString} \& {\em r\-Key}, const {\bf QFont} \& {\em r\-Font})}\label{classKRootProp_a11}


Writes the (key/value) pair. 

Same as above, but writes a font. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em r\-Key}]The key to write. \item[{\em r\-Value}]The value to write. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The old value for this key. If this key did not exist, a null string is returned. \end{Desc}


Definition at line 265 of file krootprop.cpp.

References QFont::to\-String(), and write\-Entry().\index{KRootProp@{KRoot\-Prop}!writeEntry@{writeEntry}}
\index{writeEntry@{writeEntry}!KRootProp@{KRoot\-Prop}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KRoot\-Prop::write\-Entry (const {\bf QString} \& {\em r\-Key}, const {\bf QColor} \& {\em r\-Color})}\label{classKRootProp_a12}


Writes the (key/value) pair. 

Same as above, but writes a color. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em r\-Key}]The key to write. \item[{\em r\-Value}]The value to write. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The old value for this key. If this key did not exist, a null string is returned. \end{Desc}


Definition at line 270 of file krootprop.cpp.

References QString::arg(), QColor::blue(), QColor::green(), QColor::red(), and write\-Entry().\index{KRootProp@{KRoot\-Prop}!removeEntry@{removeEntry}}
\index{removeEntry@{removeEntry}!KRootProp@{KRoot\-Prop}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KRoot\-Prop::remove\-Entry (const {\bf QString} \& {\em r\-Key})}\label{classKRootProp_a13}


Removes an entry. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em r\-Key}]The key to remove. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The old value for this key. If this key did not exist, a null string is returned. \end{Desc}


Definition at line 277 of file krootprop.cpp.

References QMap$<$ QString, QString $>$::contains(), and QString::remove().\index{KRootProp@{KRoot\-Prop}!listEntries@{listEntries}}
\index{listEntries@{listEntries}!KRootProp@{KRoot\-Prop}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KRoot\-Prop::list\-Entries () const}\label{classKRootProp_a14}


Returns a list of all keys. 

\begin{Desc}
\item[Returns:]A {\bf QString\-List} containing all the keys. \end{Desc}


Definition at line 288 of file krootprop.cpp.

References QMap$<$ QString, QString $>$::begin(), and QMap$<$ QString, QString $>$::end().\index{KRootProp@{KRoot\-Prop}!sync@{sync}}
\index{sync@{sync}!KRootProp@{KRoot\-Prop}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KRoot\-Prop::sync ()}\label{classKRootProp_a15}


Flushes the entry cache. 

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

Definition at line 45 of file krootprop.cpp.

References QString::arg(), QMap$<$ QString, QString $>$::begin(), QMap$<$ QString, QString $>$::end(), QMap$<$ QString, QString $>$::is\-Empty(), QString::length(), and QString::utf8().

Referenced by set\-Prop(), and $\sim$KRoot\-Prop().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
krootprop.h\item 
krootprop.cpp\end{CompactItemize}
