\section{KABC::Address\-Book Class Reference}
\label{classKABC_1_1AddressBook}\index{KABC::AddressBook@{KABC::AddressBook}}
{\bf Address}{\rm (p.\,\pageref{classKABC_1_1Address})} Book.  


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

Inheritance diagram for KABC::Address\-Book:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=82pt]{classKABC_1_1AddressBook__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KABC::Address\-Book:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=119pt]{classKABC_1_1AddressBook__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf address\-Book\-Changed} ({\bf Address\-Book} $\ast$)
\begin{CompactList}\small\item\em Emitted, when the address book has changed on disk. \item\end{CompactList}\item 
void {\bf address\-Book\-Locked} ({\bf Address\-Book} $\ast$)
\begin{CompactList}\small\item\em Emitted, when the address book has been locked for writing. \item\end{CompactList}\item 
void {\bf address\-Book\-Unlocked} ({\bf Address\-Book} $\ast$)
\begin{CompactList}\small\item\em Emitted, when the address book has been unlocked. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Address\-Book} ()
\begin{CompactList}\small\item\em Constructs a address book object. \item\end{CompactList}\item 
{\bf Ticket} $\ast$ {\bf request\-Save\-Ticket} (Resource $\ast$resource=0)
\begin{CompactList}\small\item\em Requests a ticket for saving the addressbook. \item\end{CompactList}\item 
bool {\bf load} ()
\begin{CompactList}\small\item\em Load address book from file. \item\end{CompactList}\item 
bool {\bf save} ({\bf Ticket} $\ast$ticket)
\begin{CompactList}\small\item\em Save address book. \item\end{CompactList}\item 
{\bf Iterator} {\bf begin} ()
\begin{CompactList}\small\item\em Returns a iterator for first entry of address book. \item\end{CompactList}\item 
{\bf Const\-Iterator} {\bf begin} () const 
\begin{CompactList}\small\item\em Returns a const iterator for first entry of address book. \item\end{CompactList}\item 
{\bf Iterator} {\bf end} ()
\begin{CompactList}\small\item\em Returns a iterator for first entry of address book. \item\end{CompactList}\item 
{\bf Const\-Iterator} {\bf end} () const 
\begin{CompactList}\small\item\em Returns a const iterator for first entry of address book. \item\end{CompactList}\item 
void {\bf clear} ()
\begin{CompactList}\small\item\em Removes all entries from address book. \item\end{CompactList}\item 
void {\bf insert\-Addressee} (const  {\bf Addressee} \&)
\begin{CompactList}\small\item\em Insert an {\bf Addressee}{\rm (p.\,\pageref{classKABC_1_1Addressee})} object into address book. \item\end{CompactList}\item 
void {\bf remove\-Addressee} (const  {\bf Addressee} \&)
\begin{CompactList}\small\item\em Removes entry from the address book. \item\end{CompactList}\item 
void {\bf remove\-Addressee} (const  {\bf Iterator} \&)
\begin{CompactList}\small\item\em This is like {\bf remove\-Addressee}{\rm (p.\,\pageref{classKABC_1_1AddressBook_a11})}() just above, with the difference that the first element is a iterator, returned by {\bf begin}{\rm (p.\,\pageref{classKABC_1_1AddressBook_a5})}(). \item\end{CompactList}\item 
{\bf Iterator} {\bf find} (const  {\bf Addressee} \&)
\begin{CompactList}\small\item\em Find the specified entry in address book. \item\end{CompactList}\item 
{\bf Addressee} {\bf find\-By\-Uid} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Find the entry specified by an unique id. \item\end{CompactList}\item 
{\bf Addressee::List} {\bf find\-By\-Name} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Find all entries with the specified name in the address book. \item\end{CompactList}\item 
{\bf Addressee::List} {\bf find\-By\-Email} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Find all entries with the specified email address in the address book. \item\end{CompactList}\item 
{\bf Addressee::List} {\bf find\-By\-Category} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Find all entries wich have the specified category in the address book. \item\end{CompactList}\item 
virtual {\bf QString} {\bf identifier} ()
\begin{CompactList}\small\item\em Return a string identifying this addressbook. \item\end{CompactList}\item 
void {\bf dump} () const 
\begin{CompactList}\small\item\em Used for debug output. \item\end{CompactList}\item 
void {\bf emit\-Address\-Book\-Locked} ()\label{classKABC_1_1AddressBook_a20}

\item 
void {\bf emit\-Address\-Book\-Unlocked} ()\label{classKABC_1_1AddressBook_a21}

\item 
void {\bf emit\-Address\-Book\-Changed} ()\label{classKABC_1_1AddressBook_a22}

\item 
{\bf Field::List} {\bf fields} (int category=Field::All)
\begin{CompactList}\small\item\em Return list of all Fields known to the address book which are associated with the given field category. \item\end{CompactList}\item 
bool {\bf add\-Custom\-Field} (const  {\bf QString} \&label, int category=Field::All, const  {\bf QString} \&key=QString::null, const  {\bf QString} \&app=QString::null)
\begin{CompactList}\small\item\em Add custom field to address book. \item\end{CompactList}\item 
bool {\bf add\-Resource} (Resource $\ast$)
\begin{CompactList}\small\item\em Add address book resource. \item\end{CompactList}\item 
bool {\bf remove\-Resource} (Resource $\ast$)
\begin{CompactList}\small\item\em Remove address book resource. \item\end{CompactList}\item 
{\bf QPtr\-List}$<$ Resource $>$ {\bf resources} ()
\begin{CompactList}\small\item\em Return pointer list of all resources. \item\end{CompactList}\item 
void {\bf set\-Error\-Handler} ({\bf Error\-Handler} $\ast$)
\begin{CompactList}\small\item\em Set the {\tt {\bf Error\-Handler}{\rm (p.\,\pageref{classKABC_1_1ErrorHandler})}}, that is used by {\bf error}{\rm (p.\,\pageref{classKABC_1_1AddressBook_a29})}() to provide gui-independend error messages. \item\end{CompactList}\item 
void {\bf error} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em Shows gui independend error messages. \item\end{CompactList}\item 
void {\bf clean\-Up} ()
\begin{CompactList}\small\item\em Query all resources to clean up their lock files. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf delete\-Removed\-Addressees} ()\label{classKABC_1_1AddressBook_b0}

\item 
void {\bf set\-Standard\-Resource} (Resource $\ast$)\label{classKABC_1_1AddressBook_b1}

\item 
Resource $\ast$ {\bf standard\-Resource} ()\label{classKABC_1_1AddressBook_b2}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf Std\-Address\-Book}\label{classKABC_1_1AddressBook_n0}

\item 
Q\_\-OBJECT friend {\bf QData\-Stream} \& {\bf operator$<$$<$} ({\bf QData\-Stream} \&, const  {\bf Address\-Book} \&)\label{classKABC_1_1AddressBook_n1}

\item 
{\bf QData\-Stream} \& {\bf operator$>$$>$} ({\bf QData\-Stream} \&, {\bf Address\-Book} \&)\label{classKABC_1_1AddressBook_n2}

\end{CompactItemize}


\subsection{Detailed Description}
{\bf Address}{\rm (p.\,\pageref{classKABC_1_1Address})} Book. 

This class provides access to a collection of address book entries. 



Definition at line 41 of file addressbook.h.

\subsection{Constructor \& Destructor Documentation}
\index{KABC::AddressBook@{KABC::Address\-Book}!AddressBook@{AddressBook}}
\index{AddressBook@{AddressBook}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KABC::Address\-Book::Address\-Book ()}\label{classKABC_1_1AddressBook_a0}


Constructs a address book object. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em format}]File format class. \end{description}
\end{Desc}


\subsection{Member Function Documentation}
\index{KABC::AddressBook@{KABC::Address\-Book}!requestSaveTicket@{requestSaveTicket}}
\index{requestSaveTicket@{requestSaveTicket}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Ticket}$\ast$ KABC::Address\-Book::request\-Save\-Ticket (Resource $\ast$ {\em resource} = 0)}\label{classKABC_1_1AddressBook_a2}


Requests a ticket for saving the addressbook. 

Calling this function locks the addressbook for all other processes. If the address book is already locked the function returns 0. You need the returned {\bf Ticket}{\rm (p.\,\pageref{classKABC_1_1Ticket})} object for calling the {\bf save}{\rm (p.\,\pageref{classKABC_1_1AddressBook_a4})}() function.

\begin{Desc}
\item[See also:]{\bf save()}{\rm (p.\,\pageref{classKABC_1_1AddressBook_a4})} \end{Desc}


Referenced by KABC::Std\-Address\-Book::save().\index{KABC::AddressBook@{KABC::Address\-Book}!load@{load}}
\index{load@{load}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KABC::Address\-Book::load ()}\label{classKABC_1_1AddressBook_a3}


Load address book from file. 

\index{KABC::AddressBook@{KABC::Address\-Book}!save@{save}}
\index{save@{save}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KABC::Address\-Book::save ({\bf Ticket} $\ast$ {\em ticket})}\label{classKABC_1_1AddressBook_a4}


Save address book. 

The address book is saved to the file, the {\bf Ticket}{\rm (p.\,\pageref{classKABC_1_1Ticket})} object has been requested for by {\bf request\-Save\-Ticket}{\rm (p.\,\pageref{classKABC_1_1AddressBook_a2})}().

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ticket}]a ticket object returned by {\bf request\-Save\-Ticket}{\rm (p.\,\pageref{classKABC_1_1AddressBook_a2})}() \end{description}
\end{Desc}


Referenced by KABC::Std\-Address\-Book::save().\index{KABC::AddressBook@{KABC::Address\-Book}!begin@{begin}}
\index{begin@{begin}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Iterator} KABC::Address\-Book::begin ()}\label{classKABC_1_1AddressBook_a5}


Returns a iterator for first entry of address book. 



Referenced by KABC::Binary\-Format::save\-All().\index{KABC::AddressBook@{KABC::Address\-Book}!begin@{begin}}
\index{begin@{begin}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Const\-Iterator} KABC::Address\-Book::begin () const}\label{classKABC_1_1AddressBook_a6}


Returns a const iterator for first entry of address book. 

\index{KABC::AddressBook@{KABC::Address\-Book}!end@{end}}
\index{end@{end}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Iterator} KABC::Address\-Book::end ()}\label{classKABC_1_1AddressBook_a7}


Returns a iterator for first entry of address book. 



Referenced by KABC::Binary\-Format::save\-All().\index{KABC::AddressBook@{KABC::Address\-Book}!end@{end}}
\index{end@{end}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Const\-Iterator} KABC::Address\-Book::end () const}\label{classKABC_1_1AddressBook_a8}


Returns a const iterator for first entry of address book. 

\index{KABC::AddressBook@{KABC::Address\-Book}!clear@{clear}}
\index{clear@{clear}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KABC::Address\-Book::clear ()}\label{classKABC_1_1AddressBook_a9}


Removes all entries from address book. 

\index{KABC::AddressBook@{KABC::Address\-Book}!insertAddressee@{insertAddressee}}
\index{insertAddressee@{insertAddressee}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KABC::Address\-Book::insert\-Addressee (const {\bf Addressee} \&)}\label{classKABC_1_1AddressBook_a10}


Insert an {\bf Addressee}{\rm (p.\,\pageref{classKABC_1_1Addressee})} object into address book. 

If an object with the same unique id already exists in the address book it it replaced by the new one. If not the new object is appended to the address book. 

Referenced by KABC::Binary\-Format::load\-All().\index{KABC::AddressBook@{KABC::Address\-Book}!removeAddressee@{removeAddressee}}
\index{removeAddressee@{removeAddressee}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KABC::Address\-Book::remove\-Addressee (const {\bf Addressee} \&)}\label{classKABC_1_1AddressBook_a11}


Removes entry from the address book. 

\index{KABC::AddressBook@{KABC::Address\-Book}!removeAddressee@{removeAddressee}}
\index{removeAddressee@{removeAddressee}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KABC::Address\-Book::remove\-Addressee (const {\bf Iterator} \&)}\label{classKABC_1_1AddressBook_a12}


This is like {\bf remove\-Addressee}{\rm (p.\,\pageref{classKABC_1_1AddressBook_a11})}() just above, with the difference that the first element is a iterator, returned by {\bf begin}{\rm (p.\,\pageref{classKABC_1_1AddressBook_a5})}(). 

\index{KABC::AddressBook@{KABC::Address\-Book}!find@{find}}
\index{find@{find}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Iterator} KABC::Address\-Book::find (const {\bf Addressee} \&)}\label{classKABC_1_1AddressBook_a13}


Find the specified entry in address book. 

Returns {\bf end()}{\rm (p.\,\pageref{classKABC_1_1AddressBook_a7})}, if the entry couldn't be found. \index{KABC::AddressBook@{KABC::Address\-Book}!findByUid@{findByUid}}
\index{findByUid@{findByUid}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Addressee} KABC::Address\-Book::find\-By\-Uid (const {\bf QString} \&)}\label{classKABC_1_1AddressBook_a14}


Find the entry specified by an unique id. 

Returns an empty {\bf Addressee}{\rm (p.\,\pageref{classKABC_1_1Addressee})} object, if the address book does not contain an entry with this id. 

Referenced by KABC::Distribution\-List\-Manager::load().\index{KABC::AddressBook@{KABC::Address\-Book}!findByName@{findByName}}
\index{findByName@{findByName}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Addressee::List} KABC::Address\-Book::find\-By\-Name (const {\bf QString} \&)}\label{classKABC_1_1AddressBook_a15}


Find all entries with the specified name in the address book. 

Returns an empty list, if no entries couldn't be found. \index{KABC::AddressBook@{KABC::Address\-Book}!findByEmail@{findByEmail}}
\index{findByEmail@{findByEmail}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Addressee::List} KABC::Address\-Book::find\-By\-Email (const {\bf QString} \&)}\label{classKABC_1_1AddressBook_a16}


Find all entries with the specified email address in the address book. 

Returns an empty list, if no entries couldn't be found. \index{KABC::AddressBook@{KABC::Address\-Book}!findByCategory@{findByCategory}}
\index{findByCategory@{findByCategory}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Addressee::List} KABC::Address\-Book::find\-By\-Category (const {\bf QString} \&)}\label{classKABC_1_1AddressBook_a17}


Find all entries wich have the specified category in the address book. 

Returns an empty list, if no entries couldn't be found. \index{KABC::AddressBook@{KABC::Address\-Book}!identifier@{identifier}}
\index{identifier@{identifier}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QString} KABC::Address\-Book::identifier ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKABC_1_1AddressBook_a18}


Return a string identifying this addressbook. 



Referenced by KABC::Distribution\-List\-Manager::load(), and KABC::Distribution\-List\-Manager::save().\index{KABC::AddressBook@{KABC::Address\-Book}!dump@{dump}}
\index{dump@{dump}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KABC::Address\-Book::dump () const}\label{classKABC_1_1AddressBook_a19}


Used for debug output. 

\index{KABC::AddressBook@{KABC::Address\-Book}!fields@{fields}}
\index{fields@{fields}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf Field::List} KABC::Address\-Book::fields (int {\em category} = Field::All)}\label{classKABC_1_1AddressBook_a23}


Return list of all Fields known to the address book which are associated with the given field category. 

\index{KABC::AddressBook@{KABC::Address\-Book}!addCustomField@{addCustomField}}
\index{addCustomField@{addCustomField}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KABC::Address\-Book::add\-Custom\-Field (const {\bf QString} \& {\em label}, int {\em category} = Field::All, const {\bf QString} \& {\em key} = QString::null, const {\bf QString} \& {\em app} = QString::null)}\label{classKABC_1_1AddressBook_a24}


Add custom field to address book. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em label}]User visible label of the field. \item[{\em category}]Ored list of field categories. \item[{\em key}]Identifier used as key for reading and writing the field. \item[{\em app}]String used as application key for reading and writing the field. \end{description}
\end{Desc}
\index{KABC::AddressBook@{KABC::Address\-Book}!addResource@{addResource}}
\index{addResource@{addResource}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KABC::Address\-Book::add\-Resource (Resource $\ast$)}\label{classKABC_1_1AddressBook_a25}


Add address book resource. 

\index{KABC::AddressBook@{KABC::Address\-Book}!removeResource@{removeResource}}
\index{removeResource@{removeResource}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KABC::Address\-Book::remove\-Resource (Resource $\ast$)}\label{classKABC_1_1AddressBook_a26}


Remove address book resource. 

\index{KABC::AddressBook@{KABC::Address\-Book}!resources@{resources}}
\index{resources@{resources}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QPtr\-List}$<$Resource$>$ KABC::Address\-Book::resources ()}\label{classKABC_1_1AddressBook_a27}


Return pointer list of all resources. 



Referenced by KABC::Resource\-Select\-Dialog::get\-Resource(), KABC::Resource\-Select\-Dialog::Resource\-Select\-Dialog(), and KABC::Std\-Address\-Book::save().\index{KABC::AddressBook@{KABC::Address\-Book}!setErrorHandler@{setErrorHandler}}
\index{setErrorHandler@{setErrorHandler}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KABC::Address\-Book::set\-Error\-Handler ({\bf Error\-Handler} $\ast$)}\label{classKABC_1_1AddressBook_a28}


Set the {\tt {\bf Error\-Handler}{\rm (p.\,\pageref{classKABC_1_1ErrorHandler})}}, that is used by {\bf error}{\rm (p.\,\pageref{classKABC_1_1AddressBook_a29})}() to provide gui-independend error messages. 

\index{KABC::AddressBook@{KABC::Address\-Book}!error@{error}}
\index{error@{error}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KABC::Address\-Book::error (const {\bf QString} \&)}\label{classKABC_1_1AddressBook_a29}


Shows gui independend error messages. 



Referenced by KABC::Std\-Address\-Book::save().\index{KABC::AddressBook@{KABC::Address\-Book}!cleanUp@{cleanUp}}
\index{cleanUp@{cleanUp}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KABC::Address\-Book::clean\-Up ()}\label{classKABC_1_1AddressBook_a30}


Query all resources to clean up their lock files. 

\index{KABC::AddressBook@{KABC::Address\-Book}!addressBookChanged@{addressBookChanged}}
\index{addressBookChanged@{addressBookChanged}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KABC::Address\-Book::address\-Book\-Changed ({\bf Address\-Book} $\ast$)\hspace{0.3cm}{\tt  [signal]}}\label{classKABC_1_1AddressBook_l0}


Emitted, when the address book has changed on disk. 

\index{KABC::AddressBook@{KABC::Address\-Book}!addressBookLocked@{addressBookLocked}}
\index{addressBookLocked@{addressBookLocked}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KABC::Address\-Book::address\-Book\-Locked ({\bf Address\-Book} $\ast$)\hspace{0.3cm}{\tt  [signal]}}\label{classKABC_1_1AddressBook_l1}


Emitted, when the address book has been locked for writing. 

\index{KABC::AddressBook@{KABC::Address\-Book}!addressBookUnlocked@{addressBookUnlocked}}
\index{addressBookUnlocked@{addressBookUnlocked}!KABC::AddressBook@{KABC::Address\-Book}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KABC::Address\-Book::address\-Book\-Unlocked ({\bf Address\-Book} $\ast$)\hspace{0.3cm}{\tt  [signal]}}\label{classKABC_1_1AddressBook_l2}


Emitted, when the address book has been unlocked. 



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