.TH "KABC::AddresseeList" kde3 "11 Jun 2005" "Version Version 3.4.1" "kabc Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KABC::AddresseeList \- a \fBQValueList\fP of \fBAddressee\fP, with sorting functionality  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <addresseelist.h>\fP
.PP
Inherits \fBQValueList< Addressee >\fP.
.PP
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBAddresseeList\fP (const \fBAddresseeList\fP &)"
.br
.ti -1c
.RI "\fBAddresseeList\fP (const \fBQValueList\fP< \fBAddressee\fP > &)"
.br
.ti -1c
.RI "void \fBdump\fP () const "
.br
.ti -1c
.RI "void \fBsetReverseSorting\fP (bool r=true)"
.br
.ti -1c
.RI "bool \fBreverseSorting\fP () const "
.br
.ti -1c
.RI "void \fBsortBy\fP (\fBSortingCriterion\fP c)"
.br
.ti -1c
.RI "void \fBsortByField\fP (Field *field=0)"
.br
.ti -1c
.RI "void \fBsortByMode\fP (\fBSortMode\fP *mode=0)"
.br
.ti -1c
.RI "void \fBsort\fP ()"
.br
.ti -1c
.RI "template<class Trait> void \fBsortByTrait\fP ()"
.br
.ti -1c
.RI "\fBSortingCriterion\fP \fBsortingCriterion\fP () const "
.br
.ti -1c
.RI "Field * \fBsortingField\fP () const "
.br
.in -1c
.SH "Detailed Description"
.PP 
a \fBQValueList\fP of \fBAddressee\fP, with sorting functionality 

This class extends the functionality of \fBQValueList\fP with sorting methods specific to the \fBAddressee\fP class. It can be used just like any other \fBQValueList\fP but is no template class.
.PP
An \fBAddresseeList\fP 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 \fBsort\fP or \fBsortBy\fP to create a defined order again.
.PP
Iterator usage is inherited by \fBQValueList\fP and extensively documented there. Please remember that the state of an iterator is undefined after any sorting operation.
.PP
For the enumeration Type SortingCriterion, which specifies the field by the collection will be sorted, the following values exist: Uid, Name, FormattedName, FamilyName, GivenName.
.PP
\fBAuthor:\fP
.RS 4
Jost Schenck jost@schenck.de 
.RE
.PP

.PP
Definition at line 112 of file addresseelist.h.
.SH "Member Function Documentation"
.PP 
.SS "void AddresseeList::dump () const"
.PP
Debug output. 
.PP
Definition at line 133 of file addresseelist.cpp.
.PP
References QValueList< Addressee >::begin(), QValueList< Addressee >::end(), endl(), and kdDebug().
.SS "void KABC::AddresseeList::setReverseSorting (bool r = \fCtrue\fP)\fC [inline]\fP"
.PP
Determines the direction of sorting. 
.PP
On change, the list will \fInot\fP automatically be resorted. 
.PP
\fBParameters:\fP
.RS 4
\fIr\fP \fCtrue\fP if sorting should be done reverse, \fCfalse\fP otherwise 
.RE
.PP

.PP
Definition at line 130 of file addresseelist.h.
.SS "bool KABC::AddresseeList::reverseSorting () const\fC [inline]\fP"
.PP
Returns the direction of sorting. 
.PP
\fBReturns:\fP
.RS 4
\fCtrue\fP if sorting is done reverse, \fCfalse\fP otherwise 
.RE
.PP

.PP
Definition at line 136 of file addresseelist.h.
.SS "void AddresseeList::sortBy (\fBSortingCriterion\fP c)"
.PP
Sorts this list by a specific criterion. 
.PP
\fBParameters:\fP
.RS 4
\fIc\fP the criterion by which should be sorted 
.RE
.PP

.PP
Definition at line 162 of file addresseelist.cpp.
.PP
References endl(), and kdError().
.PP
Referenced by sort().
.SS "void AddresseeList::sortByField (Field * field = \fC0\fP)"
.PP
Sorts this list by a specific field. 
.PP
If no parameter is given, the last used Field object will be used. 
.PP
\fBParameters:\fP
.RS 4
\fIfield\fP pointer to the Field object to be sorted by 
.RE
.PP

.PP
Definition at line 221 of file addresseelist.cpp.
.PP
References QValueList< Addressee >::count(), endl(), and kdWarning().
.SS "void AddresseeList::sortByMode (\fBSortMode\fP * mode = \fC0\fP)"
.PP
Sorts this list by a specific sorting mode. 
.PP
\fBParameters:\fP
.RS 4
\fImode\fP pointer to the sorting mode object to be sorted by 
.RE
.PP
\fBSince:\fP
.RS 4
3.4 
.RE
.PP

.PP
Definition at line 242 of file addresseelist.cpp.
.PP
References QValueList< Addressee >::count().
.SS "void AddresseeList::sort ()"
.PP
Sorts this list by its active sorting criterion. 
.PP
This normally is the criterion of the last sortBy operation or \fCFormattedName\fP if up to now there has been no sortBy operation.
.PP
Please note that the sorting trait of the last \fBsortByTrait\fP method call is not remembered and thus the action can not be repeated by this method. 
.PP
Definition at line 180 of file addresseelist.cpp.
.PP
References sortBy().
.SS "template<class Trait> void AddresseeList::sortByTrait ()"
.PP
Templated sort function. 
.PP
You normally will not want to use this but \fBsortBy\fP and \fBsort\fP instead as the existing sorting criteria completely suffice for most cases.
.PP
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: 
.PP
.nf
 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);
 };

.fi
.PP
 You can then pass this class to the sortByTrait method like this: 
.PP
.nf
 myAddresseelist.sortByTrait&lt;MySortingTrait&gt;();

.fi
.PP
 Please note that the \fBsort\fP method can not be used to repeat the sorting of the last \fCsortByTrait\fP action.
.PP
Right now this method uses the bubble sort algorithm. This should be replaced for a better one when I have time. 
.PP
Definition at line 186 of file addresseelist.cpp.
.PP
References QValueList< Addressee >::begin(), and QValueList< Addressee >::end().
.SS "\fBSortingCriterion\fP KABC::AddresseeList::sortingCriterion () const\fC [inline]\fP"
.PP
Returns the active sorting criterion, ie the sorting criterion that will be used by a \fBsort\fP call. 
.PP
Definition at line 202 of file addresseelist.h.
.SS "Field * AddresseeList::sortingField () const"
.PP
Returns the active sorting field, ie a pointer to the Field object which was used for the last \fBsortByField\fP operation. 
.PP
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. 
.PP
Definition at line 253 of file addresseelist.cpp.

.SH "Author"
.PP 
Generated automatically by Doxygen for kabc Library from the source code.
