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