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