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