summaryrefslogtreecommitdiffabout
path: root/kabc/addressbook.h
Unidiff
Diffstat (limited to 'kabc/addressbook.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressbook.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/kabc/addressbook.h b/kabc/addressbook.h
index 5edca06..f124dc9 100644
--- a/kabc/addressbook.h
+++ b/kabc/addressbook.h
@@ -51,192 +51,193 @@ class AddressBook : public QObject
51{ 51{
52 Q_OBJECT 52 Q_OBJECT
53 53
54 friend QDataStream &operator<<( QDataStream &, const AddressBook & ); 54 friend QDataStream &operator<<( QDataStream &, const AddressBook & );
55 friend QDataStream &operator>>( QDataStream &, AddressBook & ); 55 friend QDataStream &operator>>( QDataStream &, AddressBook & );
56 friend class StdAddressBook; 56 friend class StdAddressBook;
57 57
58 public: 58 public:
59 /** 59 /**
60 @short Address Book Iterator 60 @short Address Book Iterator
61 61
62 This class provides an iterator for address book entries. 62 This class provides an iterator for address book entries.
63 */ 63 */
64 class Iterator 64 class Iterator
65 { 65 {
66 public: 66 public:
67 Iterator(); 67 Iterator();
68 Iterator( const Iterator & ); 68 Iterator( const Iterator & );
69 ~Iterator(); 69 ~Iterator();
70 70
71 Iterator &operator=( const Iterator & ); 71 Iterator &operator=( const Iterator & );
72 const Addressee &operator*() const; 72 const Addressee &operator*() const;
73 Addressee &operator*(); 73 Addressee &operator*();
74 Addressee* operator->(); 74 Addressee* operator->();
75 Iterator &operator++(); 75 Iterator &operator++();
76 Iterator &operator++(int); 76 Iterator &operator++(int);
77 Iterator &operator--(); 77 Iterator &operator--();
78 Iterator &operator--(int); 78 Iterator &operator--(int);
79 bool operator==( const Iterator &it ); 79 bool operator==( const Iterator &it );
80 bool operator!=( const Iterator &it ); 80 bool operator!=( const Iterator &it );
81 81
82 struct IteratorData; 82 struct IteratorData;
83 IteratorData *d; 83 IteratorData *d;
84 }; 84 };
85 85
86 /** 86 /**
87 @short Address Book Const Iterator 87 @short Address Book Const Iterator
88 88
89 This class provides a const iterator for address book entries. 89 This class provides a const iterator for address book entries.
90 */ 90 */
91 class ConstIterator 91 class ConstIterator
92 { 92 {
93 public: 93 public:
94 ConstIterator(); 94 ConstIterator();
95 ConstIterator( const ConstIterator & ); 95 ConstIterator( const ConstIterator & );
96 ~ConstIterator(); 96 ~ConstIterator();
97 97
98 ConstIterator &operator=( const ConstIterator & ); 98 ConstIterator &operator=( const ConstIterator & );
99 const Addressee &operator*() const; 99 const Addressee &operator*() const;
100 const Addressee* operator->() const; 100 const Addressee* operator->() const;
101 ConstIterator &operator++(); 101 ConstIterator &operator++();
102 ConstIterator &operator++(int); 102 ConstIterator &operator++(int);
103 ConstIterator &operator--(); 103 ConstIterator &operator--();
104 ConstIterator &operator--(int); 104 ConstIterator &operator--(int);
105 bool operator==( const ConstIterator &it ); 105 bool operator==( const ConstIterator &it );
106 bool operator!=( const ConstIterator &it ); 106 bool operator!=( const ConstIterator &it );
107 107
108 struct ConstIteratorData; 108 struct ConstIteratorData;
109 ConstIteratorData *d; 109 ConstIteratorData *d;
110 }; 110 };
111 111
112 /** 112 /**
113 Constructs a address book object. 113 Constructs a address book object.
114 114
115 @param format File format class. 115 @param format File format class.
116 */ 116 */
117 AddressBook(); 117 AddressBook();
118 AddressBook( const QString &config ); 118 AddressBook( const QString &config );
119 AddressBook( const QString &config, const QString &family ); 119 AddressBook( const QString &config, const QString &family );
120 virtual ~AddressBook(); 120 virtual ~AddressBook();
121 121
122 /** 122 /**
123 Requests a ticket for saving the addressbook. Calling this function locks 123 Requests a ticket for saving the addressbook. Calling this function locks
124 the addressbook for all other processes. If the address book is already 124 the addressbook for all other processes. If the address book is already
125 locked the function returns 0. You need the returned @ref Ticket object 125 locked the function returns 0. You need the returned @ref Ticket object
126 for calling the @ref save() function. 126 for calling the @ref save() function.
127 127
128 @see save() 128 @see save()
129 */ 129 */
130 Ticket *requestSaveTicket( Resource *resource=0 ); 130 Ticket *requestSaveTicket( Resource *resource=0 );
131 131
132 /** 132 /**
133 Load address book from file. 133 Load address book from file.
134 */ 134 */
135 bool load(); 135 bool load();
136 136
137 /** 137 /**
138 Save address book. The address book is saved to the file, the Ticket 138 Save address book. The address book is saved to the file, the Ticket
139 object has been requested for by @ref requestSaveTicket(). 139 object has been requested for by @ref requestSaveTicket().
140 140
141 @param ticket a ticket object returned by @ref requestSaveTicket() 141 @param ticket a ticket object returned by @ref requestSaveTicket()
142 */ 142 */
143 bool save( Ticket *ticket ); 143 bool save( Ticket *ticket );
144 bool saveAB( ); 144 bool saveAB( );
145 bool saveABphone( QString fileName ); 145 bool saveABphone( QString fileName );
146 void smplifyAddressees(); 146 void smplifyAddressees();
147 void removeSyncInfo( QString syncProfile);
147 void preparePhoneSync( QString currentSyncDevice, bool isPreSync ); 148 void preparePhoneSync( QString currentSyncDevice, bool isPreSync );
148 void export2File( QString fileName ); 149 void export2File( QString fileName );
149 bool export2PhoneFormat( QStringList uids ,QString fileName ); 150 bool export2PhoneFormat( QStringList uids ,QString fileName );
150 int importFromFile( QString fileName, bool replaceLabel = false, bool removeOld = false ); 151 int importFromFile( QString fileName, bool replaceLabel = false, bool removeOld = false );
151 void setUntagged( bool setNonSyncTagged = false ); 152 void setUntagged( bool setNonSyncTagged = false );
152 void removeUntagged(); 153 void removeUntagged();
153 void findNewExtIds( QString fileName, QString currentSyncDevice ); 154 void findNewExtIds( QString fileName, QString currentSyncDevice );
154 /** 155 /**
155 Returns a iterator for first entry of address book. 156 Returns a iterator for first entry of address book.
156 */ 157 */
157 Iterator begin(); 158 Iterator begin();
158 159
159 /** 160 /**
160 Returns a const iterator for first entry of address book. 161 Returns a const iterator for first entry of address book.
161 */ 162 */
162 ConstIterator begin() const; 163 ConstIterator begin() const;
163 164
164 /** 165 /**
165 Returns a iterator for first entry of address book. 166 Returns a iterator for first entry of address book.
166 */ 167 */
167 Iterator end(); 168 Iterator end();
168 169
169 /** 170 /**
170 Returns a const iterator for first entry of address book. 171 Returns a const iterator for first entry of address book.
171 */ 172 */
172 ConstIterator end() const; 173 ConstIterator end() const;
173 174
174 /** 175 /**
175 Removes all entries from address book. 176 Removes all entries from address book.
176 */ 177 */
177 void clear(); 178 void clear();
178 179
179 /** 180 /**
180 Insert an Addressee object into address book. If an object with the same 181 Insert an Addressee object into address book. If an object with the same
181 unique id already exists in the address book it it replaced by the new 182 unique id already exists in the address book it it replaced by the new
182 one. If not the new object is appended to the address book. 183 one. If not the new object is appended to the address book.
183 */ 184 */
184 void insertAddressee( const Addressee &, bool setRev = true, bool takeResource = false); 185 void insertAddressee( const Addressee &, bool setRev = true, bool takeResource = false);
185 186
186 /** 187 /**
187 Removes entry from the address book. 188 Removes entry from the address book.
188 */ 189 */
189 void removeAddressee( const Addressee & ); 190 void removeAddressee( const Addressee & );
190 191
191 /** 192 /**
192 This is like @ref removeAddressee() just above, with the difference that 193 This is like @ref removeAddressee() just above, with the difference that
193 the first element is a iterator, returned by @ref begin(). 194 the first element is a iterator, returned by @ref begin().
194 */ 195 */
195 void removeAddressee( const Iterator & ); 196 void removeAddressee( const Iterator & );
196 197
197 /** 198 /**
198 Find the specified entry in address book. Returns end(), if the entry 199 Find the specified entry in address book. Returns end(), if the entry
199 couldn't be found. 200 couldn't be found.
200 */ 201 */
201 Iterator find( const Addressee & ); 202 Iterator find( const Addressee & );
202 203
203 /** 204 /**
204 Find the entry specified by an unique id. Returns an empty Addressee 205 Find the entry specified by an unique id. Returns an empty Addressee
205 object, if the address book does not contain an entry with this id. 206 object, if the address book does not contain an entry with this id.
206 */ 207 */
207 Addressee findByUid( const QString & ); 208 Addressee findByUid( const QString & );
208 209
209 210
210 /** 211 /**
211 Returns a list of all addressees in the address book. This list can 212 Returns a list of all addressees in the address book. This list can
212 be sorted with @ref KABC::AddresseeList for example. 213 be sorted with @ref KABC::AddresseeList for example.
213 */ 214 */
214 Addressee::List allAddressees(); 215 Addressee::List allAddressees();
215 216
216 /** 217 /**
217 Find all entries with the specified name in the address book. Returns 218 Find all entries with the specified name in the address book. Returns
218 an empty list, if no entries could be found. 219 an empty list, if no entries could be found.
219 */ 220 */
220 Addressee::List findByName( const QString & ); 221 Addressee::List findByName( const QString & );
221 222
222 /** 223 /**
223 Find all entries with the specified email address in the address book. 224 Find all entries with the specified email address in the address book.
224 Returns an empty list, if no entries could be found. 225 Returns an empty list, if no entries could be found.
225 */ 226 */
226 Addressee::List findByEmail( const QString & ); 227 Addressee::List findByEmail( const QString & );
227 228
228 /** 229 /**
229 Find all entries wich have the specified category in the address book. 230 Find all entries wich have the specified category in the address book.
230 Returns an empty list, if no entries could be found. 231 Returns an empty list, if no entries could be found.
231 */ 232 */
232 Addressee::List findByCategory( const QString & ); 233 Addressee::List findByCategory( const QString & );
233 234
234 /** 235 /**
235 Return a string identifying this addressbook. 236 Return a string identifying this addressbook.
236 */ 237 */
237 virtual QString identifier(); 238 virtual QString identifier();
238 239
239 /** 240 /**
240 Used for debug output. 241 Used for debug output.
241 */ 242 */
242 void dump() const; 243 void dump() const;