summaryrefslogtreecommitdiffabout
path: root/kabc/addresseelist.h
Unidiff
Diffstat (limited to 'kabc/addresseelist.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addresseelist.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/kabc/addresseelist.h b/kabc/addresseelist.h
index 2df252c..6106804 100644
--- a/kabc/addresseelist.h
+++ b/kabc/addresseelist.h
@@ -8,49 +8,49 @@
8 License as published by the Free Software Foundation; either 8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version. 9 version 2 of the License, or (at your option) any later version.
10 10
11 This library is distributed in the hope that it will be useful, 11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details. 14 Library General Public License for more details.
15 15
16 You should have received a copy of the GNU Library General Public License 16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to 17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. 19 Boston, MA 02111-1307, USA.
20*/ 20*/
21 21
22/* 22/*
23Enhanced Version of the file for platform independent KDE tools. 23Enhanced Version of the file for platform independent KDE tools.
24Copyright (c) 2004 Ulf Schenk 24Copyright (c) 2004 Ulf Schenk
25 25
26$Id$ 26$Id$
27*/ 27*/
28 28
29#ifndef KABC_ADDRESSEELIST_H 29#ifndef KABC_ADDRESSEELIST_H
30#define KABC_ADDRESSEELIST_H 30#define KABC_ADDRESSEELIST_H
31 31
32#include <qvaluelist.h> 32#include <q3valuelist.h>
33 33
34#include "addressee.h" 34#include "addressee.h"
35 35
36namespace KABC { 36namespace KABC {
37 37
38class Field; 38class Field;
39 39
40/** 40/**
41 * Each trait must implement one static function for equality, one for "less 41 * Each trait must implement one static function for equality, one for "less
42 * than". Class name should be the field name. A trait does not necessarily 42 * than". Class name should be the field name. A trait does not necessarily
43 * have to stick to just one field: a trait sorting by family name can e.g. 43 * have to stick to just one field: a trait sorting by family name can e.g.
44 * sort addressees with equal family name by given name. 44 * sort addressees with equal family name by given name.
45 * 45 *
46 * If you want to implement reverse sorting, you do not have to write another 46 * If you want to implement reverse sorting, you do not have to write another
47 * trait, as AddresseeList takes care of that. 47 * trait, as AddresseeList takes care of that.
48 */ 48 */
49namespace SortingTraits 49namespace SortingTraits
50{ 50{
51 51
52class Uid 52class Uid
53{ 53{
54 public: 54 public:
55 static bool eq( const Addressee &, const Addressee & ); 55 static bool eq( const Addressee &, const Addressee & );
56 static bool lt( const Addressee &, const Addressee & ); 56 static bool lt( const Addressee &, const Addressee & );
@@ -93,55 +93,55 @@ typedef enum { Uid, Name, FormattedName, FamilyName, GivenName } SortingCriterio
93 93
94/** 94/**
95 * @short a QValueList of Addressee, with sorting functionality 95 * @short a QValueList of Addressee, with sorting functionality
96 * 96 *
97 * This class extends the functionality of QValueList with 97 * This class extends the functionality of QValueList with
98 * sorting methods specific to the Addressee class. It can be used 98 * sorting methods specific to the Addressee class. It can be used
99 * just like any other QValueList but is no template class. 99 * just like any other QValueList but is no template class.
100 * 100 *
101 * An AddresseeList does not automatically keep sorted when addressees 101 * An AddresseeList does not automatically keep sorted when addressees
102 * are added or removed or the sorting order is changed, as this would 102 * are added or removed or the sorting order is changed, as this would
103 * slow down larger operations by sorting after every step. So after 103 * slow down larger operations by sorting after every step. So after
104 * such operations you have to call {@link #sort} or {@link #sortBy} to 104 * such operations you have to call {@link #sort} or {@link #sortBy} to
105 * create a defined order again. 105 * create a defined order again.
106 * 106 *
107 * Iterator usage is inherited by QValueList and extensively documented 107 * Iterator usage is inherited by QValueList and extensively documented
108 * there. Please remember that the state of an iterator is undefined 108 * there. Please remember that the state of an iterator is undefined
109 * after any sorting operation. 109 * after any sorting operation.
110 * 110 *
111 * For the enumeration Type SortingCriterion, which specifies the 111 * For the enumeration Type SortingCriterion, which specifies the
112 * field by the collection will be sorted, the following values exist: 112 * field by the collection will be sorted, the following values exist:
113 * Uid, Name, FormattedName, FamilyName, GivenName. 113 * Uid, Name, FormattedName, FamilyName, GivenName.
114 * 114 *
115 * @author Jost Schenck jost@schenck.de 115 * @author Jost Schenck jost@schenck.de
116 */ 116 */
117class AddresseeList : public QValueList<Addressee> 117class AddresseeList : public Q3ValueList<Addressee>
118{ 118{
119 public: 119 public:
120 AddresseeList(); 120 AddresseeList();
121 ~AddresseeList(); 121 ~AddresseeList();
122 AddresseeList( const AddresseeList & ); 122 AddresseeList( const AddresseeList & );
123 AddresseeList( const QValueList<Addressee> & ); 123 AddresseeList( const Q3ValueList<Addressee> & );
124 124
125 /** 125 /**
126 * Debug output. 126 * Debug output.
127 */ 127 */
128 void dump() const; 128 void dump() const;
129 129
130 /** 130 /**
131 * Determines the direction of sorting. On change, the list 131 * Determines the direction of sorting. On change, the list
132 * will <em>not</em> automatically be resorted. 132 * will <em>not</em> automatically be resorted.
133 * @param r <tt>true</tt> if sorting should be done reverse, <tt>false</tt> otherwise 133 * @param r <tt>true</tt> if sorting should be done reverse, <tt>false</tt> otherwise
134 */ 134 */
135 void setReverseSorting( bool r = true ) { mReverseSorting = r; } 135 void setReverseSorting( bool r = true ) { mReverseSorting = r; }
136 136
137 /** 137 /**
138 * Returns the direction of sorting. 138 * Returns the direction of sorting.
139 * @return <tt>true</tt> if sorting is done reverse, <tt>false</tt> otherwise 139 * @return <tt>true</tt> if sorting is done reverse, <tt>false</tt> otherwise
140 */ 140 */
141 bool reverseSorting() const { return mReverseSorting; } 141 bool reverseSorting() const { return mReverseSorting; }
142 142
143 /** 143 /**
144 * Sorts this list by a specific criterion. 144 * Sorts this list by a specific criterion.
145 * @param c the criterion by which should be sorted 145 * @param c the criterion by which should be sorted
146 */ 146 */
147 void sortBy( SortingCriterion c ); 147 void sortBy( SortingCriterion c );