summaryrefslogtreecommitdiffabout
path: root/kabc/addressee.h
authorzautrix <zautrix>2005-10-28 03:24:50 (UTC)
committer zautrix <zautrix>2005-10-28 03:24:50 (UTC)
commitf83a59cf4f9d0cff4111b6f5c88e88e6dc96e79e (patch) (unidiff)
tree969e6cf85499e3b1dcaa4dc24c972b65c906cfa9 /kabc/addressee.h
parentcbda16d4966c7483d20d1b6b5a64c8af367ea732 (diff)
downloadkdepimpi-f83a59cf4f9d0cff4111b6f5c88e88e6dc96e79e.zip
kdepimpi-f83a59cf4f9d0cff4111b6f5c88e88e6dc96e79e.tar.gz
kdepimpi-f83a59cf4f9d0cff4111b6f5c88e88e6dc96e79e.tar.bz2
many new bugs...
Diffstat (limited to 'kabc/addressee.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressee.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/kabc/addressee.h b/kabc/addressee.h
index d1c07cb..0c488eb 100644
--- a/kabc/addressee.h
+++ b/kabc/addressee.h
@@ -1,859 +1,861 @@
1/*** Warning! This file has been generated by the script makeaddressee ***/ 1/*** Warning! This file has been generated by the script makeaddressee ***/
2/* 2/*
3 This file is part of libkabc. 3 This file is part of libkabc.
4 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This library is free software; you can redistribute it and/or 6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public 7 modify it under the terms of the GNU Library General Public
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_ADDRESSEE_H 29#ifndef KABC_ADDRESSEE_H
30#define KABC_ADDRESSEE_H 30#define KABC_ADDRESSEE_H
31 31
32#include <qdatetime.h> 32#include <qdatetime.h>
33#include <qstring.h> 33#include <qstring.h>
34#include <qregexp.h> 34#include <qregexp.h>
35#include <qstringlist.h> 35#include <qstringlist.h>
36#include <qvaluelist.h> 36#include <qvaluelist.h>
37 37
38#include <ksharedptr.h> 38#include <ksharedptr.h>
39#include <kurl.h> 39#include <kurl.h>
40 40
41#include "address.h" 41#include "address.h"
42#include "agent.h" 42#include "agent.h"
43#include "geo.h" 43#include "geo.h"
44#include "key.h" 44#include "key.h"
45#include "phonenumber.h" 45#include "phonenumber.h"
46#include "picture.h" 46#include "picture.h"
47#include "secrecy.h" 47#include "secrecy.h"
48#include "sound.h" 48#include "sound.h"
49#include "timezone.h" 49#include "timezone.h"
50 50
51namespace KABC { 51namespace KABC {
52 52
53class Resource; 53class Resource;
54 54
55/** 55/**
56 @short address book entry 56 @short address book entry
57 57
58 This class represents an entry in the address book. 58 This class represents an entry in the address book.
59 59
60 The data of this class is implicitly shared. You can pass this class by value. 60 The data of this class is implicitly shared. You can pass this class by value.
61 61
62 If you need the name of a field for presenting it to the user you should use 62 If you need the name of a field for presenting it to the user you should use
63 the functions ending in Label(). They return a translated string which can be 63 the functions ending in Label(). They return a translated string which can be
64 used as label for the corresponding field. 64 used as label for the corresponding field.
65 65
66 About the name fields: 66 About the name fields:
67 67
68 givenName() is the first name and familyName() the last name. In some 68 givenName() is the first name and familyName() the last name. In some
69 countries the family name comes first, that's the reason for the 69 countries the family name comes first, that's the reason for the
70 naming. formattedName() is the full name with the correct formatting. 70 naming. formattedName() is the full name with the correct formatting.
71 It is used as an override, when the correct formatting can't be generated 71 It is used as an override, when the correct formatting can't be generated
72 from the other name fields automatically. 72 from the other name fields automatically.
73 73
74 realName() returns a fully formatted name(). It uses formattedName, if set, 74 realName() returns a fully formatted name(). It uses formattedName, if set,
75 otherwise it constucts the name from the name fields. As fallback, if 75 otherwise it constucts the name from the name fields. As fallback, if
76 nothing else is set it uses name(). 76 nothing else is set it uses name().
77 77
78 name() is the NAME type of RFC2426. It can be used as internal name for the 78 name() is the NAME type of RFC2426. It can be used as internal name for the
79 data enty, but shouldn't be used for displaying the data to the user. 79 data enty, but shouldn't be used for displaying the data to the user.
80 */ 80 */
81class Addressee 81class Addressee
82{ 82{
83 friend QDataStream &operator<<( QDataStream &, const Addressee & ); 83 friend QDataStream &operator<<( QDataStream &, const Addressee & );
84 friend QDataStream &operator>>( QDataStream &, Addressee & ); 84 friend QDataStream &operator>>( QDataStream &, Addressee & );
85 85
86 public: 86 public:
87 typedef QValueList<Addressee> List; 87 typedef QValueList<Addressee> List;
88 88
89 /** 89 /**
90 Construct an empty address book entry. 90 Construct an empty address book entry.
91 */ 91 */
92 Addressee(); 92 Addressee();
93 ~Addressee(); 93 ~Addressee();
94 94
95 Addressee( const Addressee & ); 95 Addressee( const Addressee & );
96 Addressee &operator=( const Addressee & ); 96 Addressee &operator=( const Addressee & );
97 97
98 bool operator==( const Addressee & ) const; 98 bool operator==( const Addressee & ) const;
99 bool operator!=( const Addressee & ) const; 99 bool operator!=( const Addressee & ) const;
100 // sync stuff 100 // sync stuff
101 void setTempSyncStat(int id); 101 void setTempSyncStat(int id);
102 int tempSyncStat() const; 102 int tempSyncStat() const;
103 void setIDStr( const QString & ); 103 void setIDStr( const QString & );
104 const QString IDStr() const; 104 const QString IDStr() const;
105 void setID( const QString &, const QString & ); 105 void setID( const QString &, const QString & );
106 const QString getID( const QString & ) const; 106 const QString getID( const QString & ) const;
107 void setCsum( const QString &, const QString & ); 107 void setCsum( const QString &, const QString & );
108 const QString getCsum( const QString & ) const ; 108 const QString getCsum( const QString & ) const ;
109 void removeID(const QString &); 109 void removeID(const QString &);
110 void computeCsum(const QString &dev); 110 void computeCsum(const QString &dev);
111 ulong getCsum4List( const QStringList & attList); 111 ulong getCsum4List( const QStringList & attList);
112 /** 112 /**
113 Return, if the address book entry is empty. 113 Return, if the address book entry is empty.
114 */ 114 */
115 bool isEmpty() const; 115 bool isEmpty() const;
116 void setExternalUID( const QString &id ); 116 void setExternalUID( const QString &id );
117 const QString externalUID() const; 117 const QString externalUID() const;
118 void setOriginalExternalUID( const QString &id ); 118 void setOriginalExternalUID( const QString &id );
119 QString originalExternalUID() const; 119 QString originalExternalUID() const;
120 void mergeContact( const Addressee& ad, bool isSubSet ); 120 void mergeContact( const Addressee& ad, bool isSubSet );
121 void simplifyEmails(); 121 void simplifyEmails();
122 void simplifyAddresses(); 122 void simplifyAddresses();
123 void simplifyPhoneNumbers(); 123 void simplifyPhoneNumbers();
124 void simplifyPhoneNumberTypes(); 124 void simplifyPhoneNumberTypes();
125 void makePhoneNumbersOLcompatible();
126 int hasPhoneNumberType( int type );
125 bool removeVoice(); 127 bool removeVoice();
126 bool containsAdr(const Addressee& addr ); 128 bool containsAdr(const Addressee& addr );
127 129
128 /** 130 /**
129 Set unique identifier. 131 Set unique identifier.
130 */ 132 */
131 void setUid( const QString &uid ); 133 void setUid( const QString &uid );
132 /** 134 /**
133 Return unique identifier. 135 Return unique identifier.
134 */ 136 */
135 const QString uid() const; 137 const QString uid() const;
136 /** 138 /**
137 Return translated label for uid field. 139 Return translated label for uid field.
138 */ 140 */
139 static QString uidLabel(); 141 static QString uidLabel();
140 142
141 /** 143 /**
142 Set name. 144 Set name.
143 */ 145 */
144 void setName( const QString &name ); 146 void setName( const QString &name );
145 /** 147 /**
146 Return name. 148 Return name.
147 */ 149 */
148 QString name() const; 150 QString name() const;
149 /** 151 /**
150 Return translated label for name field. 152 Return translated label for name field.
151 */ 153 */
152 static QString nameLabel(); 154 static QString nameLabel();
153 155
154 /** 156 /**
155 Set formatted name. 157 Set formatted name.
156 */ 158 */
157 void setFormattedName( const QString &formattedName ); 159 void setFormattedName( const QString &formattedName );
158 /** 160 /**
159 Return formatted name. 161 Return formatted name.
160 */ 162 */
161 QString formattedName() const; 163 QString formattedName() const;
162 /** 164 /**
163 Return translated label for formattedName field. 165 Return translated label for formattedName field.
164 */ 166 */
165 static QString formattedNameLabel(); 167 static QString formattedNameLabel();
166 168
167 /** 169 /**
168 Set family name. 170 Set family name.
169 */ 171 */
170 void setFamilyName( const QString &familyName ); 172 void setFamilyName( const QString &familyName );
171 /** 173 /**
172 Return family name. 174 Return family name.
173 */ 175 */
174 QString familyName() const; 176 QString familyName() const;
175 /** 177 /**
176 Return translated label for familyName field. 178 Return translated label for familyName field.
177 */ 179 */
178 static QString familyNameLabel(); 180 static QString familyNameLabel();
179 181
180 /** 182 /**
181 Set given name. 183 Set given name.
182 */ 184 */
183 void setGivenName( const QString &givenName ); 185 void setGivenName( const QString &givenName );
184 /** 186 /**
185 Return given name. 187 Return given name.
186 */ 188 */
187 QString givenName() const; 189 QString givenName() const;
188 /** 190 /**
189 Return translated label for givenName field. 191 Return translated label for givenName field.
190 */ 192 */
191 static QString givenNameLabel(); 193 static QString givenNameLabel();
192 194
193 /** 195 /**
194 Set additional names. 196 Set additional names.
195 */ 197 */
196 void setAdditionalName( const QString &additionalName ); 198 void setAdditionalName( const QString &additionalName );
197 /** 199 /**
198 Return additional names. 200 Return additional names.
199 */ 201 */
200 QString additionalName() const; 202 QString additionalName() const;
201 /** 203 /**
202 Return translated label for additionalName field. 204 Return translated label for additionalName field.
203 */ 205 */
204 static QString additionalNameLabel(); 206 static QString additionalNameLabel();
205 207
206 /** 208 /**
207 Set honorific prefixes. 209 Set honorific prefixes.
208 */ 210 */
209 void setPrefix( const QString &prefix ); 211 void setPrefix( const QString &prefix );
210 /** 212 /**
211 Return honorific prefixes. 213 Return honorific prefixes.
212 */ 214 */
213 QString prefix() const; 215 QString prefix() const;
214 /** 216 /**
215 Return translated label for prefix field. 217 Return translated label for prefix field.
216 */ 218 */
217 static QString prefixLabel(); 219 static QString prefixLabel();
218 220
219 /** 221 /**
220 Set honorific suffixes. 222 Set honorific suffixes.
221 */ 223 */
222 void setSuffix( const QString &suffix ); 224 void setSuffix( const QString &suffix );
223 /** 225 /**
224 Return honorific suffixes. 226 Return honorific suffixes.
225 */ 227 */
226 QString suffix() const; 228 QString suffix() const;
227 /** 229 /**
228 Return translated label for suffix field. 230 Return translated label for suffix field.
229 */ 231 */
230 static QString suffixLabel(); 232 static QString suffixLabel();
231 233
232 /** 234 /**
233 Set nick name. 235 Set nick name.
234 */ 236 */
235 void setNickName( const QString &nickName ); 237 void setNickName( const QString &nickName );
236 /** 238 /**
237 Return nick name. 239 Return nick name.
238 */ 240 */
239 QString nickName() const; 241 QString nickName() const;
240 /** 242 /**
241 Return translated label for nickName field. 243 Return translated label for nickName field.
242 */ 244 */
243 static QString nickNameLabel(); 245 static QString nickNameLabel();
244 246
245 /** 247 /**
246 Set birthday. 248 Set birthday.
247 */ 249 */
248 void setBirthday( const QDateTime &birthday ); 250 void setBirthday( const QDateTime &birthday );
249 /** 251 /**
250 Return birthday. 252 Return birthday.
251 */ 253 */
252 QDateTime birthday() const; 254 QDateTime birthday() const;
253 /** 255 /**
254 Return translated label for birthday field. 256 Return translated label for birthday field.
255 */ 257 */
256 static QString birthdayLabel(); 258 static QString birthdayLabel();
257 259
258 /** 260 /**
259 Return translated label for homeAddressStreet field. 261 Return translated label for homeAddressStreet field.
260 */ 262 */
261 static QString homeAddressStreetLabel(); 263 static QString homeAddressStreetLabel();
262 264
263 /** 265 /**
264 Return translated label for homeAddressLocality field. 266 Return translated label for homeAddressLocality field.
265 */ 267 */
266 static QString homeAddressLocalityLabel(); 268 static QString homeAddressLocalityLabel();
267 269
268 /** 270 /**
269 Return translated label for homeAddressRegion field. 271 Return translated label for homeAddressRegion field.
270 */ 272 */
271 static QString homeAddressRegionLabel(); 273 static QString homeAddressRegionLabel();
272 274
273 /** 275 /**
274 Return translated label for homeAddressPostalCode field. 276 Return translated label for homeAddressPostalCode field.
275 */ 277 */
276 static QString homeAddressPostalCodeLabel(); 278 static QString homeAddressPostalCodeLabel();
277 279
278 /** 280 /**
279 Return translated label for homeAddressCountry field. 281 Return translated label for homeAddressCountry field.
280 */ 282 */
281 static QString homeAddressCountryLabel(); 283 static QString homeAddressCountryLabel();
282 284
283 /** 285 /**
284 Return translated label for homeAddressLabel field. 286 Return translated label for homeAddressLabel field.
285 */ 287 */
286 static QString homeAddressLabelLabel(); 288 static QString homeAddressLabelLabel();
287 289
288 /** 290 /**
289 Return translated label for businessAddressStreet field. 291 Return translated label for businessAddressStreet field.
290 */ 292 */
291 static QString businessAddressStreetLabel(); 293 static QString businessAddressStreetLabel();
292 294
293 /** 295 /**
294 Return translated label for businessAddressLocality field. 296 Return translated label for businessAddressLocality field.
295 */ 297 */
296 static QString businessAddressLocalityLabel(); 298 static QString businessAddressLocalityLabel();
297 299
298 /** 300 /**
299 Return translated label for businessAddressRegion field. 301 Return translated label for businessAddressRegion field.
300 */ 302 */
301 static QString businessAddressRegionLabel(); 303 static QString businessAddressRegionLabel();
302 304
303 /** 305 /**
304 Return translated label for businessAddressPostalCode field. 306 Return translated label for businessAddressPostalCode field.
305 */ 307 */
306 static QString businessAddressPostalCodeLabel(); 308 static QString businessAddressPostalCodeLabel();
307 309
308 /** 310 /**
309 Return translated label for businessAddressCountry field. 311 Return translated label for businessAddressCountry field.
310 */ 312 */
311 static QString businessAddressCountryLabel(); 313 static QString businessAddressCountryLabel();
312 314
313 /** 315 /**
314 Return translated label for businessAddressLabel field. 316 Return translated label for businessAddressLabel field.
315 */ 317 */
316 static QString businessAddressLabelLabel(); 318 static QString businessAddressLabelLabel();
317 319
318 /** 320 /**
319 Return translated label for homePhone field. 321 Return translated label for homePhone field.
320 */ 322 */
321 static QString homePhoneLabel(); 323 static QString homePhoneLabel();
322 324
323 /** 325 /**
324 Return translated label for businessPhone field. 326 Return translated label for businessPhone field.
325 */ 327 */
326 static QString businessPhoneLabel(); 328 static QString businessPhoneLabel();
327 329
328 /** 330 /**
329 Return translated label for mobilePhone field. 331 Return translated label for mobilePhone field.
330 */ 332 */
331 static QString mobilePhoneLabel(); 333 static QString mobilePhoneLabel();
332 static QString mobileWorkPhoneLabel(); 334 static QString mobileWorkPhoneLabel();
333 static QString mobileHomePhoneLabel(); 335 static QString mobileHomePhoneLabel();
334 336
335 /** 337 /**
336 Return translated label for homeFax field. 338 Return translated label for homeFax field.
337 */ 339 */
338 static QString homeFaxLabel(); 340 static QString homeFaxLabel();
339 341
340 /** 342 /**
341 Return translated label for businessFax field. 343 Return translated label for businessFax field.
342 */ 344 */
343 static QString businessFaxLabel(); 345 static QString businessFaxLabel();
344 346
345 /** 347 /**
346 Return translated label for carPhone field. 348 Return translated label for carPhone field.
347 */ 349 */
348 static QString carPhoneLabel(); 350 static QString carPhoneLabel();
349 351
350 /** 352 /**
351 Return translated label for isdn field. 353 Return translated label for isdn field.
352 */ 354 */
353 static QString isdnLabel(); 355 static QString isdnLabel();
354 356
355 /** 357 /**
356 Return translated label for pager field. 358 Return translated label for pager field.
357 */ 359 */
358 static QString pagerLabel(); 360 static QString pagerLabel();
359 361
360 /** 362 /**
361 Return translated label for sip field. 363 Return translated label for sip field.
362 */ 364 */
363 static QString sipLabel(); 365 static QString sipLabel();
364 366
365 /** 367 /**
366 Return translated label for email field. 368 Return translated label for email field.
367 */ 369 */
368 static QString emailLabel(); 370 static QString emailLabel();
369 371
370 /** 372 /**
371 Set mail client. 373 Set mail client.
372 */ 374 */
373 void setMailer( const QString &mailer ); 375 void setMailer( const QString &mailer );
374 /** 376 /**
375 Return mail client. 377 Return mail client.
376 */ 378 */
377 QString mailer() const; 379 QString mailer() const;
378 /** 380 /**
379 Return translated label for mailer field. 381 Return translated label for mailer field.
380 */ 382 */
381 static QString mailerLabel(); 383 static QString mailerLabel();
382 384
383 /** 385 /**
384 Set time zone. 386 Set time zone.
385 */ 387 */
386 void setTimeZone( const TimeZone &timeZone ); 388 void setTimeZone( const TimeZone &timeZone );
387 /** 389 /**
388 Return time zone. 390 Return time zone.
389 */ 391 */
390 TimeZone timeZone() const; 392 TimeZone timeZone() const;
391 /** 393 /**
392 Return translated label for timeZone field. 394 Return translated label for timeZone field.
393 */ 395 */
394 static QString timeZoneLabel(); 396 static QString timeZoneLabel();
395 397
396 /** 398 /**
397 Set geographic position. 399 Set geographic position.
398 */ 400 */
399 void setGeo( const Geo &geo ); 401 void setGeo( const Geo &geo );
400 /** 402 /**
401 Return geographic position. 403 Return geographic position.
402 */ 404 */
403 Geo geo() const; 405 Geo geo() const;
404 /** 406 /**
405 Return translated label for geo field. 407 Return translated label for geo field.
406 */ 408 */
407 static QString geoLabel(); 409 static QString geoLabel();
408 410
409 /** 411 /**
410 Set title. 412 Set title.
411 */ 413 */
412 void setTitle( const QString &title ); 414 void setTitle( const QString &title );
413 /** 415 /**
414 Return title. 416 Return title.
415 */ 417 */
416 QString title() const; 418 QString title() const;
417 /** 419 /**
418 Return translated label for title field. 420 Return translated label for title field.
419 */ 421 */
420 static QString titleLabel(); 422 static QString titleLabel();
421 423
422 /** 424 /**
423 Set role. 425 Set role.
424 */ 426 */
425 void setRole( const QString &role ); 427 void setRole( const QString &role );
426 /** 428 /**
427 Return role. 429 Return role.
428 */ 430 */
429 QString role() const; 431 QString role() const;
430 /** 432 /**
431 Return translated label for role field. 433 Return translated label for role field.
432 */ 434 */
433 static QString roleLabel(); 435 static QString roleLabel();
434 436
435 /** 437 /**
436 Set organization. 438 Set organization.
437 */ 439 */
438 void setOrganization( const QString &organization ); 440 void setOrganization( const QString &organization );
439 /** 441 /**
440 Return organization. 442 Return organization.
441 */ 443 */
442 QString organization() const; 444 QString organization() const;
443 /** 445 /**
444 Return translated label for organization field. 446 Return translated label for organization field.
445 */ 447 */
446 static QString organizationLabel(); 448 static QString organizationLabel();
447 449
448 /** 450 /**
449 Set note. 451 Set note.
450 */ 452 */
451 void setNote( const QString &note ); 453 void setNote( const QString &note );
452 /** 454 /**
453 Return note. 455 Return note.
454 */ 456 */
455 QString note() const; 457 QString note() const;
456 /** 458 /**
457 Return translated label for note field. 459 Return translated label for note field.
458 */ 460 */
459 static QString noteLabel(); 461 static QString noteLabel();
460 462
461 /** 463 /**
462 Set product identifier. 464 Set product identifier.
463 */ 465 */
464 void setProductId( const QString &productId ); 466 void setProductId( const QString &productId );
465 /** 467 /**
466 Return product identifier. 468 Return product identifier.
467 */ 469 */
468 QString productId() const; 470 QString productId() const;
469 /** 471 /**
470 Return translated label for productId field. 472 Return translated label for productId field.
471 */ 473 */
472 static QString productIdLabel(); 474 static QString productIdLabel();
473 475
474 /** 476 /**
475 Set revision date. 477 Set revision date.
476 */ 478 */
477 void setRevision( const QDateTime &revision ); 479 void setRevision( const QDateTime &revision );
478 /** 480 /**
479 Return revision date. 481 Return revision date.
480 */ 482 */
481 QDateTime revision() const; 483 QDateTime revision() const;
482 /** 484 /**
483 Return translated label for revision field. 485 Return translated label for revision field.
484 */ 486 */
485 static QString revisionLabel(); 487 static QString revisionLabel();
486 488
487 /** 489 /**
488 Set sort string. 490 Set sort string.
489 */ 491 */
490 void setSortString( const QString &sortString ); 492 void setSortString( const QString &sortString );
491 /** 493 /**
492 Return sort string. 494 Return sort string.
493 */ 495 */
494 QString sortString() const; 496 QString sortString() const;
495 /** 497 /**
496 Return translated label for sortString field. 498 Return translated label for sortString field.
497 */ 499 */
498 static QString sortStringLabel(); 500 static QString sortStringLabel();
499 501
500 /** 502 /**
501 Set URL. 503 Set URL.
502 */ 504 */
503 void setUrl( const KURL &url ); 505 void setUrl( const KURL &url );
504 /** 506 /**
505 Return URL. 507 Return URL.
506 */ 508 */
507 KURL url() const; 509 KURL url() const;
508 /** 510 /**
509 Return translated label for url field. 511 Return translated label for url field.
510 */ 512 */
511 static QString urlLabel(); 513 static QString urlLabel();
512 514
513 /** 515 /**
514 Set security class. 516 Set security class.
515 */ 517 */
516 void setSecrecy( const Secrecy &secrecy ); 518 void setSecrecy( const Secrecy &secrecy );
517 /** 519 /**
518 Return security class. 520 Return security class.
519 */ 521 */
520 Secrecy secrecy() const; 522 Secrecy secrecy() const;
521 /** 523 /**
522 Return translated label for secrecy field. 524 Return translated label for secrecy field.
523 */ 525 */
524 static QString secrecyLabel(); 526 static QString secrecyLabel();
525 527
526 /** 528 /**
527 Set logo. 529 Set logo.
528 */ 530 */
529 void setLogo( const Picture &logo ); 531 void setLogo( const Picture &logo );
530 /** 532 /**
531 Return logo. 533 Return logo.
532 */ 534 */
533 Picture logo() const; 535 Picture logo() const;
534 /** 536 /**
535 Return translated label for logo field. 537 Return translated label for logo field.
536 */ 538 */
537 static QString logoLabel(); 539 static QString logoLabel();
538 540
539 /** 541 /**
540 Set photo. 542 Set photo.
541 */ 543 */
542 void setPhoto( const Picture &photo ); 544 void setPhoto( const Picture &photo );
543 /** 545 /**
544 Return photo. 546 Return photo.
545 */ 547 */
546 Picture photo() const; 548 Picture photo() const;
547 /** 549 /**
548 Return translated label for photo field. 550 Return translated label for photo field.
549 */ 551 */
550 static QString photoLabel(); 552 static QString photoLabel();
551 553
552 /** 554 /**
553 Set sound. 555 Set sound.
554 */ 556 */
555 void setSound( const Sound &sound ); 557 void setSound( const Sound &sound );
556 /** 558 /**
557 Return sound. 559 Return sound.
558 */ 560 */
559 Sound sound() const; 561 Sound sound() const;
560 /** 562 /**
561 Return translated label for sound field. 563 Return translated label for sound field.
562 */ 564 */
563 static QString soundLabel(); 565 static QString soundLabel();
564 566
565 /** 567 /**
566 Set agent. 568 Set agent.
567 */ 569 */
568 void setAgent( const Agent &agent ); 570 void setAgent( const Agent &agent );
569 /** 571 /**
570 Return agent. 572 Return agent.
571 */ 573 */
572 Agent agent() const; 574 Agent agent() const;
573 /** 575 /**
574 Return translated label for agent field. 576 Return translated label for agent field.
575 */ 577 */
576 static QString agentLabel(); 578 static QString agentLabel();
577 579
578 /** 580 /**
579 Set name fields by parsing the given string and trying to associate the 581 Set name fields by parsing the given string and trying to associate the
580 parts of the string with according fields. This function should probably 582 parts of the string with according fields. This function should probably
581 be a bit more clever. 583 be a bit more clever.
582 */ 584 */
583 void setNameFromString( const QString & ); 585 void setNameFromString( const QString & );
584 586
585 /** 587 /**
586 Return the name of the addressee. This is calculated from all the name 588 Return the name of the addressee. This is calculated from all the name
587 fields. 589 fields.
588 */ 590 */
589 QString realName() const; 591 QString realName() const;
590 592
591 /** 593 /**
592 Return the name that consists of all name parts. 594 Return the name that consists of all name parts.
593 */ 595 */
594 QString assembledName() const; 596 QString assembledName() const;
595 597
596 /** 598 /**
597 Return email address including real name. 599 Return email address including real name.
598 600
599 @param email Email address to be used to construct the full email string. 601 @param email Email address to be used to construct the full email string.
600 If this is QString::null the preferred email address is used. 602 If this is QString::null the preferred email address is used.
601 */ 603 */
602 QString fullEmail( const QString &email=QString::null ) const; 604 QString fullEmail( const QString &email=QString::null ) const;
603 605
604 /** 606 /**
605 Insert an email address. If the email address already exists in this 607 Insert an email address. If the email address already exists in this
606 addressee it is not duplicated. 608 addressee it is not duplicated.
607 609
608 @param email Email address 610 @param email Email address
609 @param preferred Set to true, if this is the preferred email address of 611 @param preferred Set to true, if this is the preferred email address of
610 the addressee. 612 the addressee.
611 */ 613 */
612 void insertEmail( const QString &email, bool preferred=false ); 614 void insertEmail( const QString &email, bool preferred=false );
613 615
614 /** 616 /**
615 Remove email address. If the email address doesn't exist, nothing happens. 617 Remove email address. If the email address doesn't exist, nothing happens.
616 */ 618 */
617 void removeEmail( const QString &email ); 619 void removeEmail( const QString &email );
618 620
619 /** 621 /**
620 Return preferred email address. This is the first email address or the 622 Return preferred email address. This is the first email address or the
621 last one added with @ref insertEmail() with a set preferred parameter. 623 last one added with @ref insertEmail() with a set preferred parameter.
622 */ 624 */
623 QString preferredEmail() const; 625 QString preferredEmail() const;
624 626
625 /** 627 /**
626 Return list of all email addresses. 628 Return list of all email addresses.
627 */ 629 */
628 QStringList emails() const; 630 QStringList emails() const;
629 631
630 /** 632 /**
631 Set the emails to @param. 633 Set the emails to @param.
632 The first email address gets the preferred one! 634 The first email address gets the preferred one!
633 @param list The list of email addresses. 635 @param list The list of email addresses.
634 */ 636 */
635 void setEmails( const QStringList& list); 637 void setEmails( const QStringList& list);
636 638
637 /** 639 /**
638 Insert a phone number. If a phone number with the same id already exists 640 Insert a phone number. If a phone number with the same id already exists
639 in this addressee it is not duplicated. 641 in this addressee it is not duplicated.
640 */ 642 */
641 void insertPhoneNumber( const PhoneNumber &phoneNumber ); 643 void insertPhoneNumber( const PhoneNumber &phoneNumber );
642 644
643 /** 645 /**
644 Remove phone number. If no phone number with the given id exists for this 646 Remove phone number. If no phone number with the given id exists for this
645 addresse nothing happens. 647 addresse nothing happens.
646 */ 648 */
647 void removePhoneNumber( const PhoneNumber &phoneNumber ); 649 void removePhoneNumber( const PhoneNumber &phoneNumber );
648 650
649 /** 651 /**
650 Return phone number, which matches the given type. 652 Return phone number, which matches the given type.
651 */ 653 */
652 PhoneNumber phoneNumber( int type ) const; 654 PhoneNumber phoneNumber( int type ) const;
653 655
654 bool matchPhoneNumber( QRegExp* searchExp ) const; 656 bool matchPhoneNumber( QRegExp* searchExp ) const;
655 bool matchAddress( QRegExp* searchExp ) const; 657 bool matchAddress( QRegExp* searchExp ) const;
656 658
657 /** 659 /**
658 Return list of all phone numbers. 660 Return list of all phone numbers.
659 */ 661 */
660 PhoneNumber::List phoneNumbers() const; 662 PhoneNumber::List phoneNumbers() const;
661 663
662 /** 664 /**
663 Return list of phone numbers with a special type. 665 Return list of phone numbers with a special type.
664 */ 666 */
665 PhoneNumber::List phoneNumbers( int type ) const; 667 PhoneNumber::List phoneNumbers( int type ) const;
666 668
667 /** 669 /**
668 Return phone number with the given id. 670 Return phone number with the given id.
669 */ 671 */
670 PhoneNumber findPhoneNumber( const QString &id ) const; 672 PhoneNumber findPhoneNumber( const QString &id ) const;
671 673
672 /** 674 /**
673 Insert a key. If a key with the same id already exists 675 Insert a key. If a key with the same id already exists
674 in this addressee it is not duplicated. 676 in this addressee it is not duplicated.
675 */ 677 */
676 void insertKey( const Key &key ); 678 void insertKey( const Key &key );
677 679
678 /** 680 /**
679 Remove a key. If no key with the given id exists for this 681 Remove a key. If no key with the given id exists for this
680 addresse nothing happens. 682 addresse nothing happens.
681 */ 683 */
682 void removeKey( const Key &key ); 684 void removeKey( const Key &key );
683 685
684 /** 686 /**
685 Return key, which matches the given type. 687 Return key, which matches the given type.
686 If @p type == Key::Custom you can specify a string 688 If @p type == Key::Custom you can specify a string
687 that should match. If you leave the string empty, the first 689 that should match. If you leave the string empty, the first
688 key with a custom value is returned. 690 key with a custom value is returned.
689 */ 691 */
690 Key key( int type, QString customTypeString = QString::null ) const; 692 Key key( int type, QString customTypeString = QString::null ) const;
691 693
692 /** 694 /**
693 Return list of all keys. 695 Return list of all keys.
694 */ 696 */
695 Key::List keys() const; 697 Key::List keys() const;
696 698
697 /** 699 /**
698 Set the list of keys 700 Set the list of keys
699 @param keys The keys to be set. 701 @param keys The keys to be set.
700 */ 702 */
701 void setKeys( const Key::List& keys); 703 void setKeys( const Key::List& keys);
702 704
703 /** 705 /**
704 Return list of keys with a special type. 706 Return list of keys with a special type.
705 If @p type == Key::Custom you can specify a string 707 If @p type == Key::Custom you can specify a string
706 that should match. If you leave the string empty, all custom 708 that should match. If you leave the string empty, all custom
707 keys will be returned. 709 keys will be returned.
708 */ 710 */
709 Key::List keys( int type, QString customTypeString = QString::null ) const; 711 Key::List keys( int type, QString customTypeString = QString::null ) const;
710 712
711 /** 713 /**
712 Return key with the given id. 714 Return key with the given id.
713 */ 715 */
714 Key findKey( const QString &id ) const; 716 Key findKey( const QString &id ) const;
715 717
716 /** 718 /**
717 Insert an address. If an address with the same id already exists 719 Insert an address. If an address with the same id already exists
718 in this addressee it is not duplicated. 720 in this addressee it is not duplicated.
719 */ 721 */
720 void insertAddress( const Address &address ); 722 void insertAddress( const Address &address );
721 723
722 /** 724 /**
723 Remove address. If no address with the given id exists for this 725 Remove address. If no address with the given id exists for this
724 addresse nothing happens. 726 addresse nothing happens.
725 */ 727 */
726 void removeAddress( const Address &address ); 728 void removeAddress( const Address &address );
727 729
728 /** 730 /**
729 Return address, which matches the given type. 731 Return address, which matches the given type.
730 */ 732 */
731 Address address( int type ) const; 733 Address address( int type ) const;
732 734
733 /** 735 /**
734 Return list of all addresses. 736 Return list of all addresses.
735 */ 737 */
736 Address::List addresses() const; 738 Address::List addresses() const;
737 739
738 /** 740 /**
739 Return list of addresses with a special type. 741 Return list of addresses with a special type.
740 */ 742 */
741 Address::List addresses( int type ) const; 743 Address::List addresses( int type ) const;
742 744
743 /** 745 /**
744 Return address with the given id. 746 Return address with the given id.
745 */ 747 */
746 Address findAddress( const QString &id ) const; 748 Address findAddress( const QString &id ) const;
747 749
748 /** 750 /**
749 Insert category. If the category already exists it is not duplicated. 751 Insert category. If the category already exists it is not duplicated.
750 */ 752 */
751 void insertCategory( const QString & ); 753 void insertCategory( const QString & );
752 754
753 /** 755 /**
754 Remove category. 756 Remove category.
755 */ 757 */
756 void removeCategory( const QString & ); 758 void removeCategory( const QString & );
757 759
758 /** 760 /**
759 Return, if addressee has the given category. 761 Return, if addressee has the given category.
760 */ 762 */
761 bool hasCategory( const QString & ) const; 763 bool hasCategory( const QString & ) const;
762 764
763 /** 765 /**
764 Set categories to given value. 766 Set categories to given value.
765 */ 767 */
766 void setCategories( const QStringList & ); 768 void setCategories( const QStringList & );
767 769
768 /** 770 /**
769 Return list of all set categories. 771 Return list of all set categories.
770 */ 772 */
771 QStringList categories() const; 773 QStringList categories() const;
772 774
773 /** 775 /**
774 Insert custom entry. The entry is identified by the name of the inserting 776 Insert custom entry. The entry is identified by the name of the inserting
775 application and a unique name. If an entry with the given app and name 777 application and a unique name. If an entry with the given app and name
776 already exists its value is replaced with the new given value. 778 already exists its value is replaced with the new given value.
777 */ 779 */
778 void insertCustom( const QString &app, const QString &name, 780 void insertCustom( const QString &app, const QString &name,
779 const QString &value ); 781 const QString &value );
780 782
781 /** 783 /**
782 Remove custom entry. 784 Remove custom entry.
783 */ 785 */
784 void removeCustom( const QString &app, const QString &name ); 786 void removeCustom( const QString &app, const QString &name );
785 787
786 /** 788 /**
787 Return value of custom entry, identified by app and entry name. 789 Return value of custom entry, identified by app and entry name.
788 */ 790 */
789 QString custom( const QString &app, const QString &name ) const; 791 QString custom( const QString &app, const QString &name ) const;
790 792
791 /** 793 /**
792 Set all custom entries. 794 Set all custom entries.
793 */ 795 */
794 void setCustoms( const QStringList & ); 796 void setCustoms( const QStringList & );
795 797
796 /** 798 /**
797 Return list of all custom entries. 799 Return list of all custom entries.
798 */ 800 */
799 QStringList customs() const; 801 QStringList customs() const;
800 802
801 /** 803 /**
802 Parse full email address. The result is given back in fullName and email. 804 Parse full email address. The result is given back in fullName and email.
803 */ 805 */
804 static void parseEmailAddress( const QString &rawEmail, QString &fullName, 806 static void parseEmailAddress( const QString &rawEmail, QString &fullName,
805 QString &email ); 807 QString &email );
806 808
807 /** 809 /**
808 Debug output. 810 Debug output.
809 */ 811 */
810 void dump() const; 812 void dump() const;
811 813
812 /** 814 /**
813 Returns string representation of the addressee. 815 Returns string representation of the addressee.
814 */ 816 */
815 QString asString() const; 817 QString asString() const;
816 818
817 /** 819 /**
818 Set resource where the addressee is from. 820 Set resource where the addressee is from.
819 */ 821 */
820 void setResource( Resource *resource ); 822 void setResource( Resource *resource );
821 823
822 /** 824 /**
823 Return pointer to resource. 825 Return pointer to resource.
824 */ 826 */
825 Resource *resource() const; 827 Resource *resource() const;
826 828
827 /** 829 /**
828 Return resourcelabel. 830 Return resourcelabel.
829 */ 831 */
830 //US 832 //US
831 static QString resourceLabel(); 833 static QString resourceLabel();
832 static QString categoryLabel(); 834 static QString categoryLabel();
833 /** 835 /**
834 Mark addressee as changed. 836 Mark addressee as changed.
835 */ 837 */
836 void setChanged( bool value ); 838 void setChanged( bool value );
837 839
838 /** 840 /**
839 Return whether the addressee is changed. 841 Return whether the addressee is changed.
840 */ 842 */
841 bool changed() const; 843 bool changed() const;
842 844
843 void setTagged( bool value ); 845 void setTagged( bool value );
844 bool tagged() const; 846 bool tagged() const;
845 847
846 private: 848 private:
847 Addressee copy(); 849 Addressee copy();
848 void detach(); 850 void detach();
849 851
850 struct AddresseeData; 852 struct AddresseeData;
851 mutable KSharedPtr<AddresseeData> mData; 853 mutable KSharedPtr<AddresseeData> mData;
852}; 854};
853 855
854QDataStream &operator<<( QDataStream &, const Addressee & ); 856QDataStream &operator<<( QDataStream &, const Addressee & );
855QDataStream &operator>>( QDataStream &, Addressee & ); 857QDataStream &operator>>( QDataStream &, Addressee & );
856 858
857} 859}
858 860
859#endif 861#endif