\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=131pt]{classKRootProp__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KRoot\-Prop} (const {\bf QString} \&r\-Prop=QString::null)
\item 
{\bf $\sim$KRoot\-Prop} ()
\item 
void {\bf set\-Prop} (const {\bf QString} \&r\-Prop={\bf QString}())
\item 
{\bf QString} {\bf prop} () const 
\item 
void {\bf destroy} ()
\item 
{\bf QString} {\bf read\-Entry} (const {\bf QString} \&r\-Key, const {\bf QString} \&p\-Default=QString::null) const 
\item 
int {\bf read\-Num\-Entry} (const {\bf QString} \&r\-Key, int n\-Default=0) const 
\item 
{\bf QFont} {\bf read\-Font\-Entry} (const {\bf QString} \&r\-Key, const {\bf QFont} $\ast$p\-Default=0) const 
\item 
{\bf QColor} {\bf read\-Color\-Entry} (const {\bf QString} \&r\-Key, const {\bf QColor} $\ast$p\-Default=0) const 
\item 
{\bf QString} {\bf write\-Entry} (const {\bf QString} \&r\-Key, const {\bf QString} \&r\-Value)
\item 
{\bf QString} {\bf write\-Entry} (const {\bf QString} \&r\-Key, int n\-Value)
\item 
{\bf QString} {\bf write\-Entry} (const {\bf QString} \&r\-Key, const {\bf QFont} \&r\-Font)
\item 
{\bf QString} {\bf write\-Entry} (const {\bf QString} \&r\-Key, const {\bf QColor} \&r\-Color)
\item 
{\bf QString} {\bf remove\-Entry} (const {\bf QString} \&r\-Key)
\item 
{\bf QString\-List} {\bf list\-Entries} () const 
\item 
void {\bf sync} ()
\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}




Definition at line 46 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} = {\tt 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 35 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 42 of file krootprop.cpp.

References QMap::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} = {\tt {\bf QString}()})}\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 74 of file krootprop.cpp.

References QString::find(), QString::from\-Utf8(), QMap::insert(), 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 144 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 149 of file krootprop.cpp.

References QMap::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} = {\tt 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 159 of file krootprop.cpp.

References QMap::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} = {\tt 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 168 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} = {\tt 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 184 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} = {\tt 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 204 of file krootprop.cpp.

References QString::find(), QString::is\-Null(), QString::left(), QString::mid(), read\-Entry(), QColor::set\-Named\-Color(), QColor::set\-Rgb(), and QString::to\-Int().\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 245 of file krootprop.cpp.

References QMap::contains(), QMap::insert(), and QMap::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 259 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\-Font}]The font 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 268 of file krootprop.cpp.

References 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\-Color}]The color 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 273 of file krootprop.cpp.

References QString::arg(), 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 280 of file krootprop.cpp.

References QMap::contains(), and QMap::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 291 of file krootprop.cpp.

References QMap::begin(), and QMap::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 48 of file krootprop.cpp.

References QString::arg(), QMap::begin(), QMap::end(), QMap::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}
