.TH "KABC::AddresseeList" 3 "28 Jan 2004" "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
.RI "\fIDebug output. \fP"
.ti -1c
.RI "void \fBsetReverseSorting\fP (bool r=true)"
.br
.RI "\fIDetermines the direction of sorting. \fP"
.ti -1c
.RI "bool \fBreverseSorting\fP () const "
.br
.RI "\fIReturns the direction of sorting. \fP"
.ti -1c
.RI "void \fBsortBy\fP (SortingCriterion c)"
.br
.RI "\fISorts this list by a specific criterion. \fP"
.ti -1c
.RI "void \fBsortByField\fP (Field *field)"
.br
.ti -1c
.RI "void \fBsort\fP ()"
.br
.RI "\fISorts this list by its active sorting criterion. \fP"
.ti -1c
.RI "template<class Trait> void \fBsortByTrait\fP ()"
.br
.RI "\fITemplated sort function. \fP"
.ti -1c
.RI "SortingCriterion \fBsortingCriterion\fP () const "
.br
.RI "\fIReturns the active sorting criterion, ie the sorting criterion that will be used by a \fBsort\fP call. \fP"
.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 108 of file addresseelist.h.
.SH "Member Function Documentation"
.PP 
.SS "void AddresseeList::dump () const"
.PP
Debug output. Definition at line 126 of file addresseelist.cpp.
.PP
References QValueList< Addressee >::begin(), QValueList< Addressee >::const_iterator(), and QValueList< Addressee >::end().
.SS "void KABC::AddresseeList::setReverseSorting (bool r = true)\fC [inline]\fP"
.PP
Determines the direction of sorting. 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
Definition at line 126 of file addresseelist.h.
.SS "bool KABC::AddresseeList::reverseSorting () const\fC [inline]\fP"
.PP
Returns the direction of sorting. \fBReturns:\fP
.RS 4
\fCtrue\fP if sorting is done reverse, \fCfalse\fP otherwise 
.RE
.PP
Definition at line 132 of file addresseelist.h.
.SS "void AddresseeList::sortBy (SortingCriterion c)"
.PP
Sorts this list by a specific criterion. \fBParameters:\fP
.RS 4
\fIc\fP the criterion by which should be sorted 
.RE
.PP
Definition at line 155 of file addresseelist.cpp.
.PP
Referenced by sort().
.SS "void AddresseeList::sort ()"
.PP
Sorts this list by its active sorting criterion. 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. Definition at line 173 of file addresseelist.cpp.
.PP
References sortBy().
.SS "template<class Trait> void AddresseeList::sortByTrait ()"
.PP
Templated sort function. 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);
 };
 
.PP
 You can then pass this class to the sortByTrait method like this: 
.PP
.nf

 myAddresseelist.sortByTrait<MySortingTrait>();
 
.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. Definition at line 179 of file addresseelist.cpp.
.PP
References QValueList< Addressee >::begin(), QValueList< Addressee >::end(), and QValueList< Addressee >::iterator().
.SS "SortingCriterion 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. Definition at line 186 of file addresseelist.h.

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