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