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