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