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