\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=83pt]{classKABC_1_1AddresseeList__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KABC::Addressee\-List:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=83pt]{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 
\item 
void {\bf set\-Reverse\-Sorting} (bool r=true)
\item 
bool {\bf reverse\-Sorting} () const 
\item 
void {\bf sort\-By} ({\bf Sorting\-Criterion} c)
\item 
void {\bf sort\-By\-Field} (Field $\ast$field=0)
\item 
void {\bf sort\-By\-Mode} ({\bf Sort\-Mode} $\ast$mode=0)
\item 
void {\bf sort} ()
\item 
template$<$class Trait$>$ void {\bf sort\-By\-Trait} ()
\item 
{\bf Sorting\-Criterion} {\bf sorting\-Criterion} () const 
\item 
Field $\ast$ {\bf sorting\-Field} () const 
\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_a10})} 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 112 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 133 of file addresseelist.cpp.

References QValue\-List$<$ Addressee $>$::begin(), QValue\-List$<$ Addressee $>$::end(), endl(), and kd\-Debug().\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} = {\tt 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 130 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 136 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 ({\bf 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 162 of file addresseelist.cpp.

References endl(), and kd\-Error().

Referenced by sort().\index{KABC::AddresseeList@{KABC::Addressee\-List}!sortByField@{sortByField}}
\index{sortByField@{sortByField}!KABC::AddresseeList@{KABC::Addressee\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Addressee\-List::sort\-By\-Field (Field $\ast$ {\em field} = {\tt 0})}\label{classKABC_1_1AddresseeList_a8}


Sorts this list by a specific field. 

If no parameter is given, the last used Field object will be used. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em field}]pointer to the Field object to be sorted by \end{description}
\end{Desc}


Definition at line 221 of file addresseelist.cpp.

References QValue\-List$<$ Addressee $>$::count(), endl(), and kd\-Warning().\index{KABC::AddresseeList@{KABC::Addressee\-List}!sortByMode@{sortByMode}}
\index{sortByMode@{sortByMode}!KABC::AddresseeList@{KABC::Addressee\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Addressee\-List::sort\-By\-Mode ({\bf Sort\-Mode} $\ast$ {\em mode} = {\tt 0})}\label{classKABC_1_1AddresseeList_a9}


Sorts this list by a specific sorting mode. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mode}]pointer to the sorting mode object to be sorted by \end{description}
\end{Desc}
\begin{Desc}
\item[Since:]3.4 \end{Desc}


Definition at line 242 of file addresseelist.cpp.

References QValue\-List$<$ Addressee $>$::count().\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_a10}


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_a11})} method call is not remembered and thus the action can not be repeated by this method. 

Definition at line 180 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_a11}


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_a10})} 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: 

\footnotesize\begin{verbatim} 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{verbatim}
\normalsize
 You can then pass this class to the sort\-By\-Trait method like this: 

\footnotesize\begin{verbatim} myAddresseelist.sortByTrait&lt;MySortingTrait&gt;();
\end{verbatim}
\normalsize
 Please note that the {\bf sort}{\rm (p.\,\pageref{classKABC_1_1AddresseeList_a10})} 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 186 of file addresseelist.cpp.

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


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



Definition at line 202 of file addresseelist.h.\index{KABC::AddresseeList@{KABC::Addressee\-List}!sortingField@{sortingField}}
\index{sortingField@{sortingField}!KABC::AddresseeList@{KABC::Addressee\-List}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Field $\ast$ Addressee\-List::sorting\-Field () const}\label{classKABC_1_1AddresseeList_a13}


Returns the active sorting field, ie a pointer to the Field object which was used for the last {\bf sort\-By\-Field}{\rm (p.\,\pageref{classKABC_1_1AddresseeList_a8})} operation. 

This function returns the last GLOBAL sorting field, not the class specific one. You're a lot better off by keeping track of this locally. 

Definition at line 253 of file addresseelist.cpp.

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