\section{KABC::Addressee\-List Class Reference}
\label{classKABC_1_1AddresseeList}\index{KABC::AddresseeList@{KABC::AddresseeList}}
a {\bf QValue\-List} of {\bf Addressee}{\rm (p.\,\pageref{classKABC_1_1Addressee})}, with sorting functionality  


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

Inheritance diagram for KABC::Addressee\-List:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=92pt]{classKABC_1_1AddresseeList__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KABC::Addressee\-List:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=92pt]{classKABC_1_1AddresseeList__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf Addressee\-List} (const  {\bf Addressee\-List} \&)\label{classKABC_1_1AddresseeList_a2}

\item 
{\bf Addressee\-List} (const  {\bf QValue\-List}$<$ {\bf Addressee} $>$ \&)\label{classKABC_1_1AddresseeList_a3}

\item 
void {\bf dump} () const 
\begin{CompactList}\small\item\em Debug output. \item\end{CompactList}\item 
void {\bf set\-Reverse\-Sorting} (bool r=true)
\begin{CompactList}\small\item\em Determines the direction of sorting. \item\end{CompactList}\item 
bool {\bf reverse\-Sorting} () const 
\begin{CompactList}\small\item\em Returns the direction of sorting. \item\end{CompactList}\item 
void {\bf sort\-By} (Sorting\-Criterion c)
\begin{CompactList}\small\item\em Sorts this list by a specific criterion. \item\end{CompactList}\item 
void {\bf sort\-By\-Field} (Field $\ast$field)\label{classKABC_1_1AddresseeList_a8}

\item 
void {\bf sort} ()
\begin{CompactList}\small\item\em Sorts this list by its active sorting criterion. \item\end{CompactList}\item 
template$<$class Trait$>$ void {\bf sort\-By\-Trait} ()
\begin{CompactList}\small\item\em Templated sort function. \item\end{CompactList}\item 
Sorting\-Criterion {\bf sorting\-Criterion} () const 
\begin{CompactList}\small\item\em Returns the active sorting criterion, ie the sorting criterion that will be used by a {\bf sort}{\rm (p.\,\pageref{classKABC_1_1AddresseeList_a9})} call. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
a {\bf QValue\-List} of {\bf Addressee}{\rm (p.\,\pageref{classKABC_1_1Addressee})}, with sorting functionality 

This class extends the functionality of {\bf QValue\-List} with sorting methods specific to the {\bf Addressee}{\rm (p.\,\pageref{classKABC_1_1Addressee})} class. It can be used just like any other {\bf QValue\-List} but is no template class.

An {\bf Addressee\-List}{\rm (p.\,\pageref{classKABC_1_1AddresseeList})} does not automatically keep sorted when addressees are added or removed or the sorting order is changed, as this would slow down larger operations by sorting after every step. So after such operations you have to call {\bf sort}{\rm (p.\,\pageref{classKABC_1_1AddresseeList_a9})} or {\bf sort\-By}{\rm (p.\,\pageref{classKABC_1_1AddresseeList_a7})} to create a defined order again.

Iterator usage is inherited by {\bf QValue\-List} and extensively documented there. Please remember that the state of an iterator is undefined after any sorting operation.

For the enumeration Type Sorting\-Criterion, which specifies the field by the collection will be sorted, the following values exist: Uid, Name, Formatted\-Name, Family\-Name, Given\-Name.

\begin{Desc}
\item[Author:]Jost Schenck {\tt jost@schenck.de} \end{Desc}




Definition at line 108 of file addresseelist.h.

\subsection{Member Function Documentation}
\index{KABC::AddresseeList@{KABC::Addressee\-List}!dump@{dump}}
\index{dump@{dump}!KABC::AddresseeList@{KABC::Addressee\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Addressee\-List::dump () const}\label{classKABC_1_1AddresseeList_a4}


Debug output. 



Definition at line 126 of file addresseelist.cpp.

References QValue\-List$<$ Addressee $>$::begin(), QValue\-List$<$ Addressee $>$::const\_\-iterator(), and QValue\-List$<$ Addressee $>$::end().\index{KABC::AddresseeList@{KABC::Addressee\-List}!setReverseSorting@{setReverseSorting}}
\index{setReverseSorting@{setReverseSorting}!KABC::AddresseeList@{KABC::Addressee\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KABC::Addressee\-List::set\-Reverse\-Sorting (bool {\em r} = true)\hspace{0.3cm}{\tt  [inline]}}\label{classKABC_1_1AddresseeList_a5}


Determines the direction of sorting. 

On change, the list will {\em not\/} automatically be resorted. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em r}]{\tt true} if sorting should be done reverse, {\tt false} otherwise \end{description}
\end{Desc}


Definition at line 126 of file addresseelist.h.\index{KABC::AddresseeList@{KABC::Addressee\-List}!reverseSorting@{reverseSorting}}
\index{reverseSorting@{reverseSorting}!KABC::AddresseeList@{KABC::Addressee\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KABC::Addressee\-List::reverse\-Sorting () const\hspace{0.3cm}{\tt  [inline]}}\label{classKABC_1_1AddresseeList_a6}


Returns the direction of sorting. 

\begin{Desc}
\item[Returns:]{\tt true} if sorting is done reverse, {\tt false} otherwise \end{Desc}


Definition at line 132 of file addresseelist.h.\index{KABC::AddresseeList@{KABC::Addressee\-List}!sortBy@{sortBy}}
\index{sortBy@{sortBy}!KABC::AddresseeList@{KABC::Addressee\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Addressee\-List::sort\-By (Sorting\-Criterion {\em c})}\label{classKABC_1_1AddresseeList_a7}


Sorts this list by a specific criterion. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em c}]the criterion by which should be sorted \end{description}
\end{Desc}


Definition at line 155 of file addresseelist.cpp.

Referenced by sort().\index{KABC::AddresseeList@{KABC::Addressee\-List}!sort@{sort}}
\index{sort@{sort}!KABC::AddresseeList@{KABC::Addressee\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Addressee\-List::sort ()}\label{classKABC_1_1AddresseeList_a9}


Sorts this list by its active sorting criterion. 

This normally is the criterion of the last sort\-By operation or {\tt Formatted\-Name} if up to now there has been no sort\-By operation.

Please note that the sorting trait of the last {\bf sort\-By\-Trait}{\rm (p.\,\pageref{classKABC_1_1AddresseeList_a10})} method call is not remembered and thus the action can not be repeated by this method. 

Definition at line 173 of file addresseelist.cpp.

References sort\-By().\index{KABC::AddresseeList@{KABC::Addressee\-List}!sortByTrait@{sortByTrait}}
\index{sortByTrait@{sortByTrait}!KABC::AddresseeList@{KABC::Addressee\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}template$<$class Trait$>$ void Addressee\-List::sort\-By\-Trait ()}\label{classKABC_1_1AddresseeList_a10}


Templated sort function. 

You normally will not want to use this but {\bf sort\-By}{\rm (p.\,\pageref{classKABC_1_1AddresseeList_a7})} and {\bf sort}{\rm (p.\,\pageref{classKABC_1_1AddresseeList_a9})} instead as the existing sorting criteria completely suffice for most cases.

However, if you do want to use some special sorting criterion, you can write a trait class that will be provided to this templated method. This trait class has to have a class declaration like the following: \small\begin{alltt}
 class MySortingTrait \{
   public:
     // eq returns true if a1 and a2 are equal
     static bool eq(KABC::Addressee a1, KABC::Addressee a2);
     // lt returns true is a1 is "less than" a2
     static bool lt(KABC::Addressee a1, KABC::Addressee a2);
 \};
 \end{alltt}\normalsize 
 You can then pass this class to the sort\-By\-Trait method like this: \small\begin{alltt}
 myAddresseelist.sortByTrait$<$MySortingTrait$>$();
 \end{alltt}\normalsize 
 Please note that the {\bf sort}{\rm (p.\,\pageref{classKABC_1_1AddresseeList_a9})} method can not be used to repeat the sorting of the last {\tt sort\-By\-Trait} action.

Right now this method uses the bubble sort algorithm. This should be replaced for a better one when I have time. 

Definition at line 179 of file addresseelist.cpp.

References QValue\-List$<$ Addressee $>$::begin(), QValue\-List$<$ Addressee $>$::end(), and QValue\-List$<$ Addressee $>$::iterator().\index{KABC::AddresseeList@{KABC::Addressee\-List}!sortingCriterion@{sortingCriterion}}
\index{sortingCriterion@{sortingCriterion}!KABC::AddresseeList@{KABC::Addressee\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Sorting\-Criterion KABC::Addressee\-List::sorting\-Criterion () const\hspace{0.3cm}{\tt  [inline]}}\label{classKABC_1_1AddresseeList_a11}


Returns the active sorting criterion, ie the sorting criterion that will be used by a {\bf sort}{\rm (p.\,\pageref{classKABC_1_1AddresseeList_a9})} call. 



Definition at line 186 of file addresseelist.h.

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