author | eilers <eilers> | 2002-10-02 16:19:17 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-10-02 16:19:17 (UTC) |
commit | 2dda45373002520ad063233b544f5e5ae057bb28 (patch) (unidiff) | |
tree | 9545510d85bb6844aa6de24529e32ba051a007c0 /libopie | |
parent | 1400bbe439c47f0bd168d602d961235c638a861b (diff) | |
download | opie-2dda45373002520ad063233b544f5e5ae057bb28.zip opie-2dda45373002520ad063233b544f5e5ae057bb28.tar.gz opie-2dda45373002520ad063233b544f5e5ae057bb28.tar.bz2 |
Included relative path to avoid external symbolic links
-rw-r--r-- | libopie/pim/ocontact.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie/pim/ocontact.cpp b/libopie/pim/ocontact.cpp index 828a9de..a63753e 100644 --- a/libopie/pim/ocontact.cpp +++ b/libopie/pim/ocontact.cpp | |||
@@ -1,793 +1,793 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #define QTOPIA_INTERNAL_CONTACT_MRE | 21 | #define QTOPIA_INTERNAL_CONTACT_MRE |
22 | 22 | ||
23 | #include "ocontact.h" | 23 | #include "ocontact.h" |
24 | #include "vobject_p.h" | 24 | #include "../../library/backend/vobject_p.h" |
25 | #include "qfiledirect_p.h" | 25 | #include "../../library/backend/qfiledirect_p.h" |
26 | 26 | ||
27 | #include <qpe/stringutil.h> | 27 | #include <qpe/stringutil.h> |
28 | #include <qpe/timeconversion.h> | 28 | #include <qpe/timeconversion.h> |
29 | 29 | ||
30 | #include <qobject.h> | 30 | #include <qobject.h> |
31 | #include <qregexp.h> | 31 | #include <qregexp.h> |
32 | #include <qstylesheet.h> | 32 | #include <qstylesheet.h> |
33 | #include <qfileinfo.h> | 33 | #include <qfileinfo.h> |
34 | #include <qmap.h> | 34 | #include <qmap.h> |
35 | 35 | ||
36 | #include <stdio.h> | 36 | #include <stdio.h> |
37 | 37 | ||
38 | /*! | 38 | /*! |
39 | \class Contact contact.h | 39 | \class Contact contact.h |
40 | \brief The Contact class holds the data of an address book entry. | 40 | \brief The Contact class holds the data of an address book entry. |
41 | 41 | ||
42 | This data includes information the name of the person, contact | 42 | This data includes information the name of the person, contact |
43 | information, and business information such as deparment and job title. | 43 | information, and business information such as deparment and job title. |
44 | 44 | ||
45 | \ingroup qtopiaemb | 45 | \ingroup qtopiaemb |
46 | \ingroup qtopiadesktop | 46 | \ingroup qtopiadesktop |
47 | */ | 47 | */ |
48 | 48 | ||
49 | Qtopia::UidGen OContact::sUidGen( Qtopia::UidGen::Qtopia ); | 49 | Qtopia::UidGen OContact::sUidGen( Qtopia::UidGen::Qtopia ); |
50 | 50 | ||
51 | /*! | 51 | /*! |
52 | Creates a new, empty contact. | 52 | Creates a new, empty contact. |
53 | */ | 53 | */ |
54 | OContact::OContact() | 54 | OContact::OContact() |
55 | : OPimRecord(), mMap(), d( 0 ) | 55 | : OPimRecord(), mMap(), d( 0 ) |
56 | { | 56 | { |
57 | } | 57 | } |
58 | 58 | ||
59 | /*! | 59 | /*! |
60 | \internal | 60 | \internal |
61 | Creates a new contact. The properties of the contact are | 61 | Creates a new contact. The properties of the contact are |
62 | set from \a fromMap. | 62 | set from \a fromMap. |
63 | */ | 63 | */ |
64 | OContact::OContact( const QMap<int, QString> &fromMap ) : | 64 | OContact::OContact( const QMap<int, QString> &fromMap ) : |
65 | OPimRecord(), mMap( fromMap ), d( 0 ) | 65 | OPimRecord(), mMap( fromMap ), d( 0 ) |
66 | { | 66 | { |
67 | QString cats = mMap[ Qtopia::AddressCategory ]; | 67 | QString cats = mMap[ Qtopia::AddressCategory ]; |
68 | if ( !cats.isEmpty() ) | 68 | if ( !cats.isEmpty() ) |
69 | setCategories( idsFromString( cats ) ); | 69 | setCategories( idsFromString( cats ) ); |
70 | QString uidStr = find( Qtopia::AddressUid ); | 70 | QString uidStr = find( Qtopia::AddressUid ); |
71 | 71 | ||
72 | if ( uidStr.isEmpty() ) | 72 | if ( uidStr.isEmpty() ) |
73 | setUid( uidGen().generate() ); | 73 | setUid( uidGen().generate() ); |
74 | else | 74 | else |
75 | setUid( uidStr.toInt() ); | 75 | setUid( uidStr.toInt() ); |
76 | 76 | ||
77 | if ( !uidStr.isEmpty() ) | 77 | if ( !uidStr.isEmpty() ) |
78 | setUid( uidStr.toInt() ); | 78 | setUid( uidStr.toInt() ); |
79 | } | 79 | } |
80 | 80 | ||
81 | /*! | 81 | /*! |
82 | Destroys a contact. | 82 | Destroys a contact. |
83 | */ | 83 | */ |
84 | OContact::~OContact() | 84 | OContact::~OContact() |
85 | { | 85 | { |
86 | } | 86 | } |
87 | 87 | ||
88 | /*! \fn void OContact::setTitle( const QString &str ) | 88 | /*! \fn void OContact::setTitle( const QString &str ) |
89 | Sets the title of the contact to \a str. | 89 | Sets the title of the contact to \a str. |
90 | */ | 90 | */ |
91 | 91 | ||
92 | /*! \fn void OContact::setFirstName( const QString &str ) | 92 | /*! \fn void OContact::setFirstName( const QString &str ) |
93 | Sets the first name of the contact to \a str. | 93 | Sets the first name of the contact to \a str. |
94 | */ | 94 | */ |
95 | 95 | ||
96 | /*! \fn void OContact::setMiddleName( const QString &str ) | 96 | /*! \fn void OContact::setMiddleName( const QString &str ) |
97 | Sets the middle name of the contact to \a str. | 97 | Sets the middle name of the contact to \a str. |
98 | */ | 98 | */ |
99 | 99 | ||
100 | /*! \fn void OContact::setLastName( const QString &str ) | 100 | /*! \fn void OContact::setLastName( const QString &str ) |
101 | Sets the last name of the contact to \a str. | 101 | Sets the last name of the contact to \a str. |
102 | */ | 102 | */ |
103 | 103 | ||
104 | /*! \fn void OContact::setSuffix( const QString &str ) | 104 | /*! \fn void OContact::setSuffix( const QString &str ) |
105 | Sets the suffix of the contact to \a str. | 105 | Sets the suffix of the contact to \a str. |
106 | */ | 106 | */ |
107 | 107 | ||
108 | /*! \fn void OContact::setFileAs( const QString &str ) | 108 | /*! \fn void OContact::setFileAs( const QString &str ) |
109 | Sets the contact to filed as \a str. | 109 | Sets the contact to filed as \a str. |
110 | */ | 110 | */ |
111 | 111 | ||
112 | /*! \fn void OContact::setDefaultEmail( const QString &str ) | 112 | /*! \fn void OContact::setDefaultEmail( const QString &str ) |
113 | Sets the default email of the contact to \a str. | 113 | Sets the default email of the contact to \a str. |
114 | */ | 114 | */ |
115 | 115 | ||
116 | /*! \fn void OContact::setHomeStreet( const QString &str ) | 116 | /*! \fn void OContact::setHomeStreet( const QString &str ) |
117 | Sets the home street address of the contact to \a str. | 117 | Sets the home street address of the contact to \a str. |
118 | */ | 118 | */ |
119 | 119 | ||
120 | /*! \fn void OContact::setHomeCity( const QString &str ) | 120 | /*! \fn void OContact::setHomeCity( const QString &str ) |
121 | Sets the home city of the contact to \a str. | 121 | Sets the home city of the contact to \a str. |
122 | */ | 122 | */ |
123 | 123 | ||
124 | /*! \fn void OContact::setHomeState( const QString &str ) | 124 | /*! \fn void OContact::setHomeState( const QString &str ) |
125 | Sets the home state of the contact to \a str. | 125 | Sets the home state of the contact to \a str. |
126 | */ | 126 | */ |
127 | 127 | ||
128 | /*! \fn void OContact::setHomeZip( const QString &str ) | 128 | /*! \fn void OContact::setHomeZip( const QString &str ) |
129 | Sets the home zip code of the contact to \a str. | 129 | Sets the home zip code of the contact to \a str. |
130 | */ | 130 | */ |
131 | 131 | ||
132 | /*! \fn void OContact::setHomeCountry( const QString &str ) | 132 | /*! \fn void OContact::setHomeCountry( const QString &str ) |
133 | Sets the home country of the contact to \a str. | 133 | Sets the home country of the contact to \a str. |
134 | */ | 134 | */ |
135 | 135 | ||
136 | /*! \fn void OContact::setHomePhone( const QString &str ) | 136 | /*! \fn void OContact::setHomePhone( const QString &str ) |
137 | Sets the home phone number of the contact to \a str. | 137 | Sets the home phone number of the contact to \a str. |
138 | */ | 138 | */ |
139 | 139 | ||
140 | /*! \fn void OContact::setHomeFax( const QString &str ) | 140 | /*! \fn void OContact::setHomeFax( const QString &str ) |
141 | Sets the home fax number of the contact to \a str. | 141 | Sets the home fax number of the contact to \a str. |
142 | */ | 142 | */ |
143 | 143 | ||
144 | /*! \fn void OContact::setHomeMobile( const QString &str ) | 144 | /*! \fn void OContact::setHomeMobile( const QString &str ) |
145 | Sets the home mobile phone number of the contact to \a str. | 145 | Sets the home mobile phone number of the contact to \a str. |
146 | */ | 146 | */ |
147 | 147 | ||
148 | /*! \fn void OContact::setHomeWebpage( const QString &str ) | 148 | /*! \fn void OContact::setHomeWebpage( const QString &str ) |
149 | Sets the home webpage of the contact to \a str. | 149 | Sets the home webpage of the contact to \a str. |
150 | */ | 150 | */ |
151 | 151 | ||
152 | /*! \fn void OContact::setCompany( const QString &str ) | 152 | /*! \fn void OContact::setCompany( const QString &str ) |
153 | Sets the company for contact to \a str. | 153 | Sets the company for contact to \a str. |
154 | */ | 154 | */ |
155 | 155 | ||
156 | /*! \fn void OContact::setJobTitle( const QString &str ) | 156 | /*! \fn void OContact::setJobTitle( const QString &str ) |
157 | Sets the job title of the contact to \a str. | 157 | Sets the job title of the contact to \a str. |
158 | */ | 158 | */ |
159 | 159 | ||
160 | /*! \fn void OContact::setDepartment( const QString &str ) | 160 | /*! \fn void OContact::setDepartment( const QString &str ) |
161 | Sets the department for contact to \a str. | 161 | Sets the department for contact to \a str. |
162 | */ | 162 | */ |
163 | 163 | ||
164 | /*! \fn void OContact::setOffice( const QString &str ) | 164 | /*! \fn void OContact::setOffice( const QString &str ) |
165 | Sets the office for contact to \a str. | 165 | Sets the office for contact to \a str. |
166 | */ | 166 | */ |
167 | 167 | ||
168 | /*! \fn void OContact::setBusinessStreet( const QString &str ) | 168 | /*! \fn void OContact::setBusinessStreet( const QString &str ) |
169 | Sets the business street address of the contact to \a str. | 169 | Sets the business street address of the contact to \a str. |
170 | */ | 170 | */ |
171 | 171 | ||
172 | /*! \fn void OContact::setBusinessCity( const QString &str ) | 172 | /*! \fn void OContact::setBusinessCity( const QString &str ) |
173 | Sets the business city of the contact to \a str. | 173 | Sets the business city of the contact to \a str. |
174 | */ | 174 | */ |
175 | 175 | ||
176 | /*! \fn void OContact::setBusinessState( const QString &str ) | 176 | /*! \fn void OContact::setBusinessState( const QString &str ) |
177 | Sets the business state of the contact to \a str. | 177 | Sets the business state of the contact to \a str. |
178 | */ | 178 | */ |
179 | 179 | ||
180 | /*! \fn void OContact::setBusinessZip( const QString &str ) | 180 | /*! \fn void OContact::setBusinessZip( const QString &str ) |
181 | Sets the business zip code of the contact to \a str. | 181 | Sets the business zip code of the contact to \a str. |
182 | */ | 182 | */ |
183 | 183 | ||
184 | /*! \fn void OContact::setBusinessCountry( const QString &str ) | 184 | /*! \fn void OContact::setBusinessCountry( const QString &str ) |
185 | Sets the business country of the contact to \a str. | 185 | Sets the business country of the contact to \a str. |
186 | */ | 186 | */ |
187 | 187 | ||
188 | /*! \fn void OContact::setBusinessPhone( const QString &str ) | 188 | /*! \fn void OContact::setBusinessPhone( const QString &str ) |
189 | Sets the business phone number of the contact to \a str. | 189 | Sets the business phone number of the contact to \a str. |
190 | */ | 190 | */ |
191 | 191 | ||
192 | /*! \fn void OContact::setBusinessFax( const QString &str ) | 192 | /*! \fn void OContact::setBusinessFax( const QString &str ) |
193 | Sets the business fax number of the contact to \a str. | 193 | Sets the business fax number of the contact to \a str. |
194 | */ | 194 | */ |
195 | 195 | ||
196 | /*! \fn void OContact::setBusinessMobile( const QString &str ) | 196 | /*! \fn void OContact::setBusinessMobile( const QString &str ) |
197 | Sets the business mobile phone number of the contact to \a str. | 197 | Sets the business mobile phone number of the contact to \a str. |
198 | */ | 198 | */ |
199 | 199 | ||
200 | /*! \fn void OContact::setBusinessPager( const QString &str ) | 200 | /*! \fn void OContact::setBusinessPager( const QString &str ) |
201 | Sets the business pager number of the contact to \a str. | 201 | Sets the business pager number of the contact to \a str. |
202 | */ | 202 | */ |
203 | 203 | ||
204 | /*! \fn void OContact::setBusinessWebpage( const QString &str ) | 204 | /*! \fn void OContact::setBusinessWebpage( const QString &str ) |
205 | Sets the business webpage of the contact to \a str. | 205 | Sets the business webpage of the contact to \a str. |
206 | */ | 206 | */ |
207 | 207 | ||
208 | /*! \fn void OContact::setProfession( const QString &str ) | 208 | /*! \fn void OContact::setProfession( const QString &str ) |
209 | Sets the profession of the contact to \a str. | 209 | Sets the profession of the contact to \a str. |
210 | */ | 210 | */ |
211 | 211 | ||
212 | /*! \fn void OContact::setAssistant( const QString &str ) | 212 | /*! \fn void OContact::setAssistant( const QString &str ) |
213 | Sets the assistant of the contact to \a str. | 213 | Sets the assistant of the contact to \a str. |
214 | */ | 214 | */ |
215 | 215 | ||
216 | /*! \fn void OContact::setManager( const QString &str ) | 216 | /*! \fn void OContact::setManager( const QString &str ) |
217 | Sets the manager of the contact to \a str. | 217 | Sets the manager of the contact to \a str. |
218 | */ | 218 | */ |
219 | 219 | ||
220 | /*! \fn void OContact::setSpouse( const QString &str ) | 220 | /*! \fn void OContact::setSpouse( const QString &str ) |
221 | Sets the spouse of the contact to \a str. | 221 | Sets the spouse of the contact to \a str. |
222 | */ | 222 | */ |
223 | 223 | ||
224 | /*! \fn void OContact::setGender( const QString &str ) | 224 | /*! \fn void OContact::setGender( const QString &str ) |
225 | Sets the gender of the contact to \a str. | 225 | Sets the gender of the contact to \a str. |
226 | */ | 226 | */ |
227 | 227 | ||
228 | /*! \fn void OContact::setBirthday( const QString &str ) | 228 | /*! \fn void OContact::setBirthday( const QString &str ) |
229 | Sets the birthday for the contact to \a str. | 229 | Sets the birthday for the contact to \a str. |
230 | */ | 230 | */ |
231 | 231 | ||
232 | /*! \fn void OContact::setAnniversary( const QString &str ) | 232 | /*! \fn void OContact::setAnniversary( const QString &str ) |
233 | Sets the anniversary of the contact to \a str. | 233 | Sets the anniversary of the contact to \a str. |
234 | */ | 234 | */ |
235 | 235 | ||
236 | /*! \fn void OContact::setNickname( const QString &str ) | 236 | /*! \fn void OContact::setNickname( const QString &str ) |
237 | Sets the nickname of the contact to \a str. | 237 | Sets the nickname of the contact to \a str. |
238 | */ | 238 | */ |
239 | 239 | ||
240 | /*! \fn void OContact::setNotes( const QString &str ) | 240 | /*! \fn void OContact::setNotes( const QString &str ) |
241 | Sets the notes about the contact to \a str. | 241 | Sets the notes about the contact to \a str. |
242 | */ | 242 | */ |
243 | 243 | ||
244 | /*! \fn QString OContact::title() const | 244 | /*! \fn QString OContact::title() const |
245 | Returns the title of the contact. | 245 | Returns the title of the contact. |
246 | */ | 246 | */ |
247 | 247 | ||
248 | /*! \fn QString OContact::firstName() const | 248 | /*! \fn QString OContact::firstName() const |
249 | Returns the first name of the contact. | 249 | Returns the first name of the contact. |
250 | */ | 250 | */ |
251 | 251 | ||
252 | /*! \fn QString OContact::middleName() const | 252 | /*! \fn QString OContact::middleName() const |
253 | Returns the middle name of the contact. | 253 | Returns the middle name of the contact. |
254 | */ | 254 | */ |
255 | 255 | ||
256 | /*! \fn QString OContact::lastName() const | 256 | /*! \fn QString OContact::lastName() const |
257 | Returns the last name of the contact. | 257 | Returns the last name of the contact. |
258 | */ | 258 | */ |
259 | 259 | ||
260 | /*! \fn QString OContact::suffix() const | 260 | /*! \fn QString OContact::suffix() const |
261 | Returns the suffix of the contact. | 261 | Returns the suffix of the contact. |
262 | */ | 262 | */ |
263 | 263 | ||
264 | /*! \fn QString OContact::fileAs() const | 264 | /*! \fn QString OContact::fileAs() const |
265 | Returns the string the contact is filed as. | 265 | Returns the string the contact is filed as. |
266 | */ | 266 | */ |
267 | 267 | ||
268 | /*! \fn QString OContact::defaultEmail() const | 268 | /*! \fn QString OContact::defaultEmail() const |
269 | Returns the default email address of the contact. | 269 | Returns the default email address of the contact. |
270 | */ | 270 | */ |
271 | 271 | ||
272 | /*! \fn QString OContact::emails() const | 272 | /*! \fn QString OContact::emails() const |
273 | Returns the list of email address for a contact separated by ';'s in a single | 273 | Returns the list of email address for a contact separated by ';'s in a single |
274 | string. | 274 | string. |
275 | */ | 275 | */ |
276 | 276 | ||
277 | /*! \fn QString OContact::homeStreet() const | 277 | /*! \fn QString OContact::homeStreet() const |
278 | Returns the home street address of the contact. | 278 | Returns the home street address of the contact. |
279 | */ | 279 | */ |
280 | 280 | ||
281 | /*! \fn QString OContact::homeCity() const | 281 | /*! \fn QString OContact::homeCity() const |
282 | Returns the home city of the contact. | 282 | Returns the home city of the contact. |
283 | */ | 283 | */ |
284 | 284 | ||
285 | /*! \fn QString OContact::homeState() const | 285 | /*! \fn QString OContact::homeState() const |
286 | Returns the home state of the contact. | 286 | Returns the home state of the contact. |
287 | */ | 287 | */ |
288 | 288 | ||
289 | /*! \fn QString OContact::homeZip() const | 289 | /*! \fn QString OContact::homeZip() const |
290 | Returns the home zip of the contact. | 290 | Returns the home zip of the contact. |
291 | */ | 291 | */ |
292 | 292 | ||
293 | /*! \fn QString OContact::homeCountry() const | 293 | /*! \fn QString OContact::homeCountry() const |
294 | Returns the home country of the contact. | 294 | Returns the home country of the contact. |
295 | */ | 295 | */ |
296 | 296 | ||
297 | /*! \fn QString OContact::homePhone() const | 297 | /*! \fn QString OContact::homePhone() const |
298 | Returns the home phone number of the contact. | 298 | Returns the home phone number of the contact. |
299 | */ | 299 | */ |
300 | 300 | ||
301 | /*! \fn QString OContact::homeFax() const | 301 | /*! \fn QString OContact::homeFax() const |
302 | Returns the home fax number of the contact. | 302 | Returns the home fax number of the contact. |
303 | */ | 303 | */ |
304 | 304 | ||
305 | /*! \fn QString OContact::homeMobile() const | 305 | /*! \fn QString OContact::homeMobile() const |
306 | Returns the home mobile number of the contact. | 306 | Returns the home mobile number of the contact. |
307 | */ | 307 | */ |
308 | 308 | ||
309 | /*! \fn QString OContact::homeWebpage() const | 309 | /*! \fn QString OContact::homeWebpage() const |
310 | Returns the home webpage of the contact. | 310 | Returns the home webpage of the contact. |
311 | */ | 311 | */ |
312 | 312 | ||
313 | /*! \fn QString OContact::company() const | 313 | /*! \fn QString OContact::company() const |
314 | Returns the company for the contact. | 314 | Returns the company for the contact. |
315 | */ | 315 | */ |
316 | 316 | ||
317 | /*! \fn QString OContact::department() const | 317 | /*! \fn QString OContact::department() const |
318 | Returns the department for the contact. | 318 | Returns the department for the contact. |
319 | */ | 319 | */ |
320 | 320 | ||
321 | /*! \fn QString OContact::office() const | 321 | /*! \fn QString OContact::office() const |
322 | Returns the office for the contact. | 322 | Returns the office for the contact. |
323 | */ | 323 | */ |
324 | 324 | ||
325 | /*! \fn QString OContact::jobTitle() const | 325 | /*! \fn QString OContact::jobTitle() const |
326 | Returns the job title of the contact. | 326 | Returns the job title of the contact. |
327 | */ | 327 | */ |
328 | 328 | ||
329 | /*! \fn QString OContact::profession() const | 329 | /*! \fn QString OContact::profession() const |
330 | Returns the profession of the contact. | 330 | Returns the profession of the contact. |
331 | */ | 331 | */ |
332 | 332 | ||
333 | /*! \fn QString OContact::assistant() const | 333 | /*! \fn QString OContact::assistant() const |
334 | Returns the assistant of the contact. | 334 | Returns the assistant of the contact. |
335 | */ | 335 | */ |
336 | 336 | ||
337 | /*! \fn QString OContact::manager() const | 337 | /*! \fn QString OContact::manager() const |
338 | Returns the manager of the contact. | 338 | Returns the manager of the contact. |
339 | */ | 339 | */ |
340 | 340 | ||
341 | /*! \fn QString OContact::businessStreet() const | 341 | /*! \fn QString OContact::businessStreet() const |
342 | Returns the business street address of the contact. | 342 | Returns the business street address of the contact. |
343 | */ | 343 | */ |
344 | 344 | ||
345 | /*! \fn QString OContact::businessCity() const | 345 | /*! \fn QString OContact::businessCity() const |
346 | Returns the business city of the contact. | 346 | Returns the business city of the contact. |
347 | */ | 347 | */ |
348 | 348 | ||
349 | /*! \fn QString OContact::businessState() const | 349 | /*! \fn QString OContact::businessState() const |
350 | Returns the business state of the contact. | 350 | Returns the business state of the contact. |
351 | */ | 351 | */ |
352 | 352 | ||
353 | /*! \fn QString OContact::businessZip() const | 353 | /*! \fn QString OContact::businessZip() const |
354 | Returns the business zip of the contact. | 354 | Returns the business zip of the contact. |
355 | */ | 355 | */ |
356 | 356 | ||
357 | /*! \fn QString OContact::businessCountry() const | 357 | /*! \fn QString OContact::businessCountry() const |
358 | Returns the business country of the contact. | 358 | Returns the business country of the contact. |
359 | */ | 359 | */ |
360 | 360 | ||
361 | /*! \fn QString OContact::businessPhone() const | 361 | /*! \fn QString OContact::businessPhone() const |
362 | Returns the business phone number of the contact. | 362 | Returns the business phone number of the contact. |
363 | */ | 363 | */ |
364 | 364 | ||
365 | /*! \fn QString OContact::businessFax() const | 365 | /*! \fn QString OContact::businessFax() const |
366 | Returns the business fax number of the contact. | 366 | Returns the business fax number of the contact. |
367 | */ | 367 | */ |
368 | 368 | ||
369 | /*! \fn QString OContact::businessMobile() const | 369 | /*! \fn QString OContact::businessMobile() const |
370 | Returns the business mobile number of the contact. | 370 | Returns the business mobile number of the contact. |
371 | */ | 371 | */ |
372 | 372 | ||
373 | /*! \fn QString OContact::businessPager() const | 373 | /*! \fn QString OContact::businessPager() const |
374 | Returns the business pager number of the contact. | 374 | Returns the business pager number of the contact. |
375 | */ | 375 | */ |
376 | 376 | ||
377 | /*! \fn QString OContact::businessWebpage() const | 377 | /*! \fn QString OContact::businessWebpage() const |
378 | Returns the business webpage of the contact. | 378 | Returns the business webpage of the contact. |
379 | */ | 379 | */ |
380 | 380 | ||
381 | /*! \fn QString OContact::spouse() const | 381 | /*! \fn QString OContact::spouse() const |
382 | Returns the spouse of the contact. | 382 | Returns the spouse of the contact. |
383 | */ | 383 | */ |
384 | 384 | ||
385 | /*! \fn QString OContact::gender() const | 385 | /*! \fn QString OContact::gender() const |
386 | Returns the gender of the contact. | 386 | Returns the gender of the contact. |
387 | */ | 387 | */ |
388 | 388 | ||
389 | /*! \fn QString OContact::birthday() const | 389 | /*! \fn QString OContact::birthday() const |
390 | Returns the birthday of the contact. | 390 | Returns the birthday of the contact. |
391 | */ | 391 | */ |
392 | 392 | ||
393 | /*! \fn QString OContact::anniversary() const | 393 | /*! \fn QString OContact::anniversary() const |
394 | Returns the anniversary of the contact. | 394 | Returns the anniversary of the contact. |
395 | */ | 395 | */ |
396 | 396 | ||
397 | /*! \fn QString OContact::nickname() const | 397 | /*! \fn QString OContact::nickname() const |
398 | Returns the nickname of the contact. | 398 | Returns the nickname of the contact. |
399 | */ | 399 | */ |
400 | 400 | ||
401 | /*! \fn QString OContact::children() const | 401 | /*! \fn QString OContact::children() const |
402 | Returns the children of the contact. | 402 | Returns the children of the contact. |
403 | */ | 403 | */ |
404 | 404 | ||
405 | /*! \fn QString OContact::notes() const | 405 | /*! \fn QString OContact::notes() const |
406 | Returns the notes relating to the the contact. | 406 | Returns the notes relating to the the contact. |
407 | */ | 407 | */ |
408 | 408 | ||
409 | /*! \fn QString OContact::groups() const | 409 | /*! \fn QString OContact::groups() const |
410 | \internal | 410 | \internal |
411 | Returns the groups for the contact. | 411 | Returns the groups for the contact. |
412 | */ | 412 | */ |
413 | 413 | ||
414 | /*! \fn QStringList OContact::groupList() const | 414 | /*! \fn QStringList OContact::groupList() const |
415 | \internal | 415 | \internal |
416 | */ | 416 | */ |
417 | 417 | ||
418 | /*! \fn QString OContact::field(int) const | 418 | /*! \fn QString OContact::field(int) const |
419 | \internal | 419 | \internal |
420 | */ | 420 | */ |
421 | 421 | ||
422 | /*! \fn void OContact::saveJournal( journal_action, const QString & = QString::null ) | 422 | /*! \fn void OContact::saveJournal( journal_action, const QString & = QString::null ) |
423 | \internal | 423 | \internal |
424 | */ | 424 | */ |
425 | 425 | ||
426 | /*! \fn void OContact::setUid( int id ) | 426 | /*! \fn void OContact::setUid( int id ) |
427 | \internal | 427 | \internal |
428 | Sets the uid for this record to \a id. | 428 | Sets the uid for this record to \a id. |
429 | */ | 429 | */ |
430 | 430 | ||
431 | /*! \enum OContact::journal_action | 431 | /*! \enum OContact::journal_action |
432 | \internal | 432 | \internal |
433 | */ | 433 | */ |
434 | 434 | ||
435 | /*! | 435 | /*! |
436 | \internal | 436 | \internal |
437 | */ | 437 | */ |
438 | QMap<int, QString> OContact::toMap() const | 438 | QMap<int, QString> OContact::toMap() const |
439 | { | 439 | { |
440 | QMap<int, QString> map = mMap; | 440 | QMap<int, QString> map = mMap; |
441 | QString cats = idsToString( categories() ); | 441 | QString cats = idsToString( categories() ); |
442 | if ( !cats.isEmpty() ) | 442 | if ( !cats.isEmpty() ) |
443 | map.insert( Qtopia::AddressCategory, cats ); | 443 | map.insert( Qtopia::AddressCategory, cats ); |
444 | return map; | 444 | return map; |
445 | } | 445 | } |
446 | 446 | ||
447 | /*! | 447 | /*! |
448 | Returns a rich text formatted QString representing the contents the contact. | 448 | Returns a rich text formatted QString representing the contents the contact. |
449 | */ | 449 | */ |
450 | QString OContact::toRichText() const | 450 | QString OContact::toRichText() const |
451 | { | 451 | { |
452 | QString text; | 452 | QString text; |
453 | QString value, comp, state; | 453 | QString value, comp, state; |
454 | 454 | ||
455 | // name, jobtitle and company | 455 | // name, jobtitle and company |
456 | if ( !(value = fullName()).isEmpty() ) | 456 | if ( !(value = fullName()).isEmpty() ) |
457 | text += "<b>" + Qtopia::escapeString(value) + "</b><br>"; | 457 | text += "<b>" + Qtopia::escapeString(value) + "</b><br>"; |
458 | if ( !(value = jobTitle()).isEmpty() ) | 458 | if ( !(value = jobTitle()).isEmpty() ) |
459 | text += Qtopia::escapeString(value) + "<br>"; | 459 | text += Qtopia::escapeString(value) + "<br>"; |
460 | 460 | ||
461 | comp = company(); | 461 | comp = company(); |
462 | if ( !(value = department()).isEmpty() ) { | 462 | if ( !(value = department()).isEmpty() ) { |
463 | text += Qtopia::escapeString(value); | 463 | text += Qtopia::escapeString(value); |
464 | if ( comp ) | 464 | if ( comp ) |
465 | text += ", "; | 465 | text += ", "; |
466 | else | 466 | else |
467 | text += "<br>"; | 467 | text += "<br>"; |
468 | } | 468 | } |
469 | if ( !comp.isEmpty() ) | 469 | if ( !comp.isEmpty() ) |
470 | text += Qtopia::escapeString(comp) + "<br>"; | 470 | text += Qtopia::escapeString(comp) + "<br>"; |
471 | 471 | ||
472 | // business address | 472 | // business address |
473 | if ( !businessStreet().isEmpty() || !businessCity().isEmpty() || | 473 | if ( !businessStreet().isEmpty() || !businessCity().isEmpty() || |
474 | !businessZip().isEmpty() || !businessCountry().isEmpty() ) { | 474 | !businessZip().isEmpty() || !businessCountry().isEmpty() ) { |
475 | text += "<br>"; | 475 | text += "<br>"; |
476 | text += QObject::tr( "<b>Work Address:</b>" ); | 476 | text += QObject::tr( "<b>Work Address:</b>" ); |
477 | text += "<br>"; | 477 | text += "<br>"; |
478 | } | 478 | } |
479 | 479 | ||
480 | if ( !(value = businessStreet()).isEmpty() ) | 480 | if ( !(value = businessStreet()).isEmpty() ) |
481 | text += Qtopia::escapeString(value) + "<br>"; | 481 | text += Qtopia::escapeString(value) + "<br>"; |
482 | state = businessState(); | 482 | state = businessState(); |
483 | if ( !(value = businessCity()).isEmpty() ) { | 483 | if ( !(value = businessCity()).isEmpty() ) { |
484 | text += Qtopia::escapeString(value); | 484 | text += Qtopia::escapeString(value); |
485 | if ( state ) | 485 | if ( state ) |
486 | text += ", " + Qtopia::escapeString(state); | 486 | text += ", " + Qtopia::escapeString(state); |
487 | text += "<br>"; | 487 | text += "<br>"; |
488 | } else if ( !state.isEmpty() ) | 488 | } else if ( !state.isEmpty() ) |
489 | text += Qtopia::escapeString(state) + "<br>"; | 489 | text += Qtopia::escapeString(state) + "<br>"; |
490 | if ( !(value = businessZip()).isEmpty() ) | 490 | if ( !(value = businessZip()).isEmpty() ) |
491 | text += Qtopia::escapeString(value) + "<br>"; | 491 | text += Qtopia::escapeString(value) + "<br>"; |
492 | if ( !(value = businessCountry()).isEmpty() ) | 492 | if ( !(value = businessCountry()).isEmpty() ) |
493 | text += Qtopia::escapeString(value) + "<br>"; | 493 | text += Qtopia::escapeString(value) + "<br>"; |
494 | 494 | ||
495 | // home address | 495 | // home address |
496 | if ( !homeStreet().isEmpty() || !homeCity().isEmpty() || | 496 | if ( !homeStreet().isEmpty() || !homeCity().isEmpty() || |
497 | !homeZip().isEmpty() || !homeCountry().isEmpty() ) { | 497 | !homeZip().isEmpty() || !homeCountry().isEmpty() ) { |
498 | text += "<br>"; | 498 | text += "<br>"; |
499 | text += QObject::tr( "<b>Home Address:</b>" ); | 499 | text += QObject::tr( "<b>Home Address:</b>" ); |
500 | text += "<br>"; | 500 | text += "<br>"; |
501 | } | 501 | } |
502 | 502 | ||
503 | if ( !(value = homeStreet()).isEmpty() ) | 503 | if ( !(value = homeStreet()).isEmpty() ) |
504 | text += Qtopia::escapeString(value) + "<br>"; | 504 | text += Qtopia::escapeString(value) + "<br>"; |
505 | state = homeState(); | 505 | state = homeState(); |
506 | if ( !(value = homeCity()).isEmpty() ) { | 506 | if ( !(value = homeCity()).isEmpty() ) { |
507 | text += Qtopia::escapeString(value); | 507 | text += Qtopia::escapeString(value); |
508 | if ( !state.isEmpty() ) | 508 | if ( !state.isEmpty() ) |
509 | text += ", " + Qtopia::escapeString(state); | 509 | text += ", " + Qtopia::escapeString(state); |
510 | text += "<br>"; | 510 | text += "<br>"; |
511 | } else if (!state.isEmpty()) | 511 | } else if (!state.isEmpty()) |
512 | text += Qtopia::escapeString(state) + "<br>"; | 512 | text += Qtopia::escapeString(state) + "<br>"; |
513 | if ( !(value = homeZip()).isEmpty() ) | 513 | if ( !(value = homeZip()).isEmpty() ) |
514 | text += Qtopia::escapeString(value) + "<br>"; | 514 | text += Qtopia::escapeString(value) + "<br>"; |
515 | if ( !(value = homeCountry()).isEmpty() ) | 515 | if ( !(value = homeCountry()).isEmpty() ) |
516 | text += Qtopia::escapeString(value) + "<br>"; | 516 | text += Qtopia::escapeString(value) + "<br>"; |
517 | 517 | ||
518 | // the others... | 518 | // the others... |
519 | QString str; | 519 | QString str; |
520 | str = emails(); | 520 | str = emails(); |
521 | if ( !str.isEmpty() ) | 521 | if ( !str.isEmpty() ) |
522 | text += "<b>" + QObject::tr("Email Addresses: ") + "</b>" | 522 | text += "<b>" + QObject::tr("Email Addresses: ") + "</b>" |
523 | + Qtopia::escapeString(str) + "<br>"; | 523 | + Qtopia::escapeString(str) + "<br>"; |
524 | str = homePhone(); | 524 | str = homePhone(); |
525 | if ( !str.isEmpty() ) | 525 | if ( !str.isEmpty() ) |
526 | text += "<b>" + QObject::tr("Home Phone: ") + "</b>" | 526 | text += "<b>" + QObject::tr("Home Phone: ") + "</b>" |
527 | + Qtopia::escapeString(str) + "<br>"; | 527 | + Qtopia::escapeString(str) + "<br>"; |
528 | str = homeFax(); | 528 | str = homeFax(); |
529 | if ( !str.isEmpty() ) | 529 | if ( !str.isEmpty() ) |
530 | text += "<b>" + QObject::tr("Home Fax: ") + "</b>" | 530 | text += "<b>" + QObject::tr("Home Fax: ") + "</b>" |
531 | + Qtopia::escapeString(str) + "<br>"; | 531 | + Qtopia::escapeString(str) + "<br>"; |
532 | str = homeMobile(); | 532 | str = homeMobile(); |
533 | if ( !str.isEmpty() ) | 533 | if ( !str.isEmpty() ) |
534 | text += "<b>" + QObject::tr("Home Mobile: ") + "</b>" | 534 | text += "<b>" + QObject::tr("Home Mobile: ") + "</b>" |
535 | + Qtopia::escapeString(str) + "<br>"; | 535 | + Qtopia::escapeString(str) + "<br>"; |
536 | str = homeWebpage(); | 536 | str = homeWebpage(); |
537 | if ( !str.isEmpty() ) | 537 | if ( !str.isEmpty() ) |
538 | text += "<b>" + QObject::tr("Home Web Page: ") + "</b>" | 538 | text += "<b>" + QObject::tr("Home Web Page: ") + "</b>" |
539 | + Qtopia::escapeString(str) + "<br>"; | 539 | + Qtopia::escapeString(str) + "<br>"; |
540 | str = businessWebpage(); | 540 | str = businessWebpage(); |
541 | if ( !str.isEmpty() ) | 541 | if ( !str.isEmpty() ) |
542 | text += "<b>" + QObject::tr("Business Web Page: ") + "</b>" | 542 | text += "<b>" + QObject::tr("Business Web Page: ") + "</b>" |
543 | + Qtopia::escapeString(str) + "<br>"; | 543 | + Qtopia::escapeString(str) + "<br>"; |
544 | str = office(); | 544 | str = office(); |
545 | if ( !str.isEmpty() ) | 545 | if ( !str.isEmpty() ) |
546 | text += "<b>" + QObject::tr("Office: ") + "</b>" | 546 | text += "<b>" + QObject::tr("Office: ") + "</b>" |
547 | + Qtopia::escapeString(str) + "<br>"; | 547 | + Qtopia::escapeString(str) + "<br>"; |
548 | str = businessPhone(); | 548 | str = businessPhone(); |
549 | if ( !str.isEmpty() ) | 549 | if ( !str.isEmpty() ) |
550 | text += "<b>" + QObject::tr("Business Phone: ") + "</b>" | 550 | text += "<b>" + QObject::tr("Business Phone: ") + "</b>" |
551 | + Qtopia::escapeString(str) + "<br>"; | 551 | + Qtopia::escapeString(str) + "<br>"; |
552 | str = businessFax(); | 552 | str = businessFax(); |
553 | if ( !str.isEmpty() ) | 553 | if ( !str.isEmpty() ) |
554 | text += "<b>" + QObject::tr("Business Fax: ") + "</b>" | 554 | text += "<b>" + QObject::tr("Business Fax: ") + "</b>" |
555 | + Qtopia::escapeString(str) + "<br>"; | 555 | + Qtopia::escapeString(str) + "<br>"; |
556 | str = businessMobile(); | 556 | str = businessMobile(); |
557 | if ( !str.isEmpty() ) | 557 | if ( !str.isEmpty() ) |
558 | text += "<b>" + QObject::tr("Business Mobile: ") + "</b>" | 558 | text += "<b>" + QObject::tr("Business Mobile: ") + "</b>" |
559 | + Qtopia::escapeString(str) + "<br>"; | 559 | + Qtopia::escapeString(str) + "<br>"; |
560 | str = businessPager(); | 560 | str = businessPager(); |
561 | if ( !str.isEmpty() ) | 561 | if ( !str.isEmpty() ) |
562 | text += "<b>" + QObject::tr("Business Pager: ") + "</b>" | 562 | text += "<b>" + QObject::tr("Business Pager: ") + "</b>" |
563 | + Qtopia::escapeString(str) + "<br>"; | 563 | + Qtopia::escapeString(str) + "<br>"; |
564 | str = profession(); | 564 | str = profession(); |
565 | if ( !str.isEmpty() ) | 565 | if ( !str.isEmpty() ) |
566 | text += "<b>" + QObject::tr("Profession: ") + "</b>" | 566 | text += "<b>" + QObject::tr("Profession: ") + "</b>" |
567 | + Qtopia::escapeString(str) + "<br>"; | 567 | + Qtopia::escapeString(str) + "<br>"; |
568 | str = assistant(); | 568 | str = assistant(); |
569 | if ( !str.isEmpty() ) | 569 | if ( !str.isEmpty() ) |
570 | text += "<b>" + QObject::tr("Assistant: ") + "</b>" | 570 | text += "<b>" + QObject::tr("Assistant: ") + "</b>" |
571 | + Qtopia::escapeString(str) + "<br>"; | 571 | + Qtopia::escapeString(str) + "<br>"; |
572 | str = manager(); | 572 | str = manager(); |
573 | if ( !str.isEmpty() ) | 573 | if ( !str.isEmpty() ) |
574 | text += "<b>" + QObject::tr("Manager: ") + "</b>" | 574 | text += "<b>" + QObject::tr("Manager: ") + "</b>" |
575 | + Qtopia::escapeString(str) + "<br>"; | 575 | + Qtopia::escapeString(str) + "<br>"; |
576 | str = gender(); | 576 | str = gender(); |
577 | if ( !str.isEmpty() && str.toInt() != 0 ) { | 577 | if ( !str.isEmpty() && str.toInt() != 0 ) { |
578 | if ( str.toInt() == 1 ) | 578 | if ( str.toInt() == 1 ) |
579 | str = QObject::tr( "Male" ); | 579 | str = QObject::tr( "Male" ); |
580 | else if ( str.toInt() == 2 ) | 580 | else if ( str.toInt() == 2 ) |
581 | str = QObject::tr( "Female" ); | 581 | str = QObject::tr( "Female" ); |
582 | text += "<b>" + QObject::tr("Gender: ") + "</b>" + str + "<br>"; | 582 | text += "<b>" + QObject::tr("Gender: ") + "</b>" + str + "<br>"; |
583 | } | 583 | } |
584 | str = spouse(); | 584 | str = spouse(); |
585 | if ( !str.isEmpty() ) | 585 | if ( !str.isEmpty() ) |
586 | text += "<b>" + QObject::tr("Spouse: ") + "</b>" | 586 | text += "<b>" + QObject::tr("Spouse: ") + "</b>" |
587 | + Qtopia::escapeString(str) + "<br>"; | 587 | + Qtopia::escapeString(str) + "<br>"; |
588 | str = birthday(); | 588 | str = birthday(); |
589 | if ( !str.isEmpty() ) | 589 | if ( !str.isEmpty() ) |
590 | text += "<b>" + QObject::tr("Birthday: ") + "</b>" | 590 | text += "<b>" + QObject::tr("Birthday: ") + "</b>" |
591 | + Qtopia::escapeString(str) + "<br>"; | 591 | + Qtopia::escapeString(str) + "<br>"; |
592 | str = anniversary(); | 592 | str = anniversary(); |
593 | if ( !str.isEmpty() ) | 593 | if ( !str.isEmpty() ) |
594 | text += "<b>" + QObject::tr("Anniversary: ") + "</b>" | 594 | text += "<b>" + QObject::tr("Anniversary: ") + "</b>" |
595 | + Qtopia::escapeString(str) + "<br>"; | 595 | + Qtopia::escapeString(str) + "<br>"; |
596 | str = nickname(); | 596 | str = nickname(); |
597 | if ( !str.isEmpty() ) | 597 | if ( !str.isEmpty() ) |
598 | text += "<b>" + QObject::tr("Nickname: ") + "</b>" | 598 | text += "<b>" + QObject::tr("Nickname: ") + "</b>" |
599 | + Qtopia::escapeString(str) + "<br>"; | 599 | + Qtopia::escapeString(str) + "<br>"; |
600 | 600 | ||
601 | // notes last | 601 | // notes last |
602 | if ( (value = notes()) ) { | 602 | if ( (value = notes()) ) { |
603 | QRegExp reg("\n"); | 603 | QRegExp reg("\n"); |
604 | 604 | ||
605 | //QString tmp = Qtopia::escapeString(value); | 605 | //QString tmp = Qtopia::escapeString(value); |
606 | QString tmp = QStyleSheet::convertFromPlainText(value); | 606 | QString tmp = QStyleSheet::convertFromPlainText(value); |
607 | //tmp.replace( reg, "<br>" ); | 607 | //tmp.replace( reg, "<br>" ); |
608 | text += "<br>" + tmp + "<br>"; | 608 | text += "<br>" + tmp + "<br>"; |
609 | } | 609 | } |
610 | return text; | 610 | return text; |
611 | } | 611 | } |
612 | 612 | ||
613 | /*! | 613 | /*! |
614 | \internal | 614 | \internal |
615 | */ | 615 | */ |
616 | void OContact::insert( int key, const QString &v ) | 616 | void OContact::insert( int key, const QString &v ) |
617 | { | 617 | { |
618 | QString value = v.stripWhiteSpace(); | 618 | QString value = v.stripWhiteSpace(); |
619 | if ( value.isEmpty() ) | 619 | if ( value.isEmpty() ) |
620 | mMap.remove( key ); | 620 | mMap.remove( key ); |
621 | else | 621 | else |
622 | mMap.insert( key, value ); | 622 | mMap.insert( key, value ); |
623 | } | 623 | } |
624 | 624 | ||
625 | /*! | 625 | /*! |
626 | \internal | 626 | \internal |
627 | */ | 627 | */ |
628 | void OContact::replace( int key, const QString & v ) | 628 | void OContact::replace( int key, const QString & v ) |
629 | { | 629 | { |
630 | QString value = v.stripWhiteSpace(); | 630 | QString value = v.stripWhiteSpace(); |
631 | if ( value.isEmpty() ) | 631 | if ( value.isEmpty() ) |
632 | mMap.remove( key ); | 632 | mMap.remove( key ); |
633 | else | 633 | else |
634 | mMap.replace( key, value ); | 634 | mMap.replace( key, value ); |
635 | } | 635 | } |
636 | 636 | ||
637 | /*! | 637 | /*! |
638 | \internal | 638 | \internal |
639 | */ | 639 | */ |
640 | QString OContact::find( int key ) const | 640 | QString OContact::find( int key ) const |
641 | { | 641 | { |
642 | return mMap[key]; | 642 | return mMap[key]; |
643 | } | 643 | } |
644 | 644 | ||
645 | /*! | 645 | /*! |
646 | \internal | 646 | \internal |
647 | */ | 647 | */ |
648 | QString OContact::displayAddress( const QString &street, | 648 | QString OContact::displayAddress( const QString &street, |
649 | const QString &city, | 649 | const QString &city, |
650 | const QString &state, | 650 | const QString &state, |
651 | const QString &zip, | 651 | const QString &zip, |
652 | const QString &country ) const | 652 | const QString &country ) const |
653 | { | 653 | { |
654 | QString s = street; | 654 | QString s = street; |
655 | if ( !street.isEmpty() ) | 655 | if ( !street.isEmpty() ) |
656 | s+= "\n"; | 656 | s+= "\n"; |
657 | s += city; | 657 | s += city; |
658 | if ( !city.isEmpty() && !state.isEmpty() ) | 658 | if ( !city.isEmpty() && !state.isEmpty() ) |
659 | s += ", "; | 659 | s += ", "; |
660 | s += state; | 660 | s += state; |
661 | if ( !state.isEmpty() && !zip.isEmpty() ) | 661 | if ( !state.isEmpty() && !zip.isEmpty() ) |
662 | s += " "; | 662 | s += " "; |
663 | s += zip; | 663 | s += zip; |
664 | if ( !country.isEmpty() && !s.isEmpty() ) | 664 | if ( !country.isEmpty() && !s.isEmpty() ) |
665 | s += "\n"; | 665 | s += "\n"; |
666 | s += country; | 666 | s += country; |
667 | return s; | 667 | return s; |
668 | } | 668 | } |
669 | 669 | ||
670 | /*! | 670 | /*! |
671 | \internal | 671 | \internal |
672 | */ | 672 | */ |
673 | QString OContact::displayBusinessAddress() const | 673 | QString OContact::displayBusinessAddress() const |
674 | { | 674 | { |
675 | return displayAddress( businessStreet(), businessCity(), | 675 | return displayAddress( businessStreet(), businessCity(), |
676 | businessState(), businessZip(), | 676 | businessState(), businessZip(), |
677 | businessCountry() ); | 677 | businessCountry() ); |
678 | } | 678 | } |
679 | 679 | ||
680 | /*! | 680 | /*! |
681 | \internal | 681 | \internal |
682 | */ | 682 | */ |
683 | QString OContact::displayHomeAddress() const | 683 | QString OContact::displayHomeAddress() const |
684 | { | 684 | { |
685 | return displayAddress( homeStreet(), homeCity(), | 685 | return displayAddress( homeStreet(), homeCity(), |
686 | homeState(), homeZip(), | 686 | homeState(), homeZip(), |
687 | homeCountry() ); | 687 | homeCountry() ); |
688 | } | 688 | } |
689 | 689 | ||
690 | /*! | 690 | /*! |
691 | Returns the full name of the contact | 691 | Returns the full name of the contact |
692 | */ | 692 | */ |
693 | QString OContact::fullName() const | 693 | QString OContact::fullName() const |
694 | { | 694 | { |
695 | QString title = find( Qtopia::Title ); | 695 | QString title = find( Qtopia::Title ); |
696 | QString firstName = find( Qtopia::FirstName ); | 696 | QString firstName = find( Qtopia::FirstName ); |
697 | QString middleName = find( Qtopia::MiddleName ); | 697 | QString middleName = find( Qtopia::MiddleName ); |
698 | QString lastName = find( Qtopia::LastName ); | 698 | QString lastName = find( Qtopia::LastName ); |
699 | QString suffix = find( Qtopia::Suffix ); | 699 | QString suffix = find( Qtopia::Suffix ); |
700 | 700 | ||
701 | QString name = title; | 701 | QString name = title; |
702 | if ( !firstName.isEmpty() ) { | 702 | if ( !firstName.isEmpty() ) { |
703 | if ( !name.isEmpty() ) | 703 | if ( !name.isEmpty() ) |
704 | name += " "; | 704 | name += " "; |
705 | name += firstName; | 705 | name += firstName; |
706 | } | 706 | } |
707 | if ( !middleName.isEmpty() ) { | 707 | if ( !middleName.isEmpty() ) { |
708 | if ( !name.isEmpty() ) | 708 | if ( !name.isEmpty() ) |
709 | name += " "; | 709 | name += " "; |
710 | name += middleName; | 710 | name += middleName; |
711 | } | 711 | } |
712 | if ( !lastName.isEmpty() ) { | 712 | if ( !lastName.isEmpty() ) { |
713 | if ( !name.isEmpty() ) | 713 | if ( !name.isEmpty() ) |
714 | name += " "; | 714 | name += " "; |
715 | name += lastName; | 715 | name += lastName; |
716 | } | 716 | } |
717 | if ( !suffix.isEmpty() ) { | 717 | if ( !suffix.isEmpty() ) { |
718 | if ( !name.isEmpty() ) | 718 | if ( !name.isEmpty() ) |
719 | name += " "; | 719 | name += " "; |
720 | name += suffix; | 720 | name += suffix; |
721 | } | 721 | } |
722 | return name.simplifyWhiteSpace(); | 722 | return name.simplifyWhiteSpace(); |
723 | } | 723 | } |
724 | 724 | ||
725 | /*! | 725 | /*! |
726 | Returns a list of the names of the children of the contact. | 726 | Returns a list of the names of the children of the contact. |
727 | */ | 727 | */ |
728 | QStringList OContact::childrenList() const | 728 | QStringList OContact::childrenList() const |
729 | { | 729 | { |
730 | return QStringList::split( " ", find( Qtopia::Children ) ); | 730 | return QStringList::split( " ", find( Qtopia::Children ) ); |
731 | } | 731 | } |
732 | 732 | ||
733 | /*! \fn void OContact::insertEmail( const QString &email ) | 733 | /*! \fn void OContact::insertEmail( const QString &email ) |
734 | 734 | ||
735 | Insert \a email into the email list. Ensures \a email can only be added | 735 | Insert \a email into the email list. Ensures \a email can only be added |
736 | once. If there is no default email address set, it sets it to the \a email. | 736 | once. If there is no default email address set, it sets it to the \a email. |
737 | */ | 737 | */ |
738 | 738 | ||
739 | /*! \fn void OContact::removeEmail( const QString &email ) | 739 | /*! \fn void OContact::removeEmail( const QString &email ) |
740 | 740 | ||
741 | Removes the \a email from the email list. If the default email was \a email, | 741 | Removes the \a email from the email list. If the default email was \a email, |
742 | then the default email address is assigned to the first email in the | 742 | then the default email address is assigned to the first email in the |
743 | email list | 743 | email list |
744 | */ | 744 | */ |
745 | 745 | ||
746 | /*! \fn void OContact::clearEmails() | 746 | /*! \fn void OContact::clearEmails() |
747 | 747 | ||
748 | Clears the email list. | 748 | Clears the email list. |
749 | */ | 749 | */ |
750 | 750 | ||
751 | /*! \fn void OContact::insertEmails( const QStringList &emailList ) | 751 | /*! \fn void OContact::insertEmails( const QStringList &emailList ) |
752 | 752 | ||
753 | Appends the \a emailList to the exiting email list | 753 | Appends the \a emailList to the exiting email list |
754 | */ | 754 | */ |
755 | 755 | ||
756 | /*! | 756 | /*! |
757 | Returns a list of email addresses belonging to the contact, including | 757 | Returns a list of email addresses belonging to the contact, including |
758 | the default email address. | 758 | the default email address. |
759 | */ | 759 | */ |
760 | QStringList OContact::emailList() const | 760 | QStringList OContact::emailList() const |
761 | { | 761 | { |
762 | QString emailStr = emails(); | 762 | QString emailStr = emails(); |
763 | 763 | ||
764 | QStringList r; | 764 | QStringList r; |
765 | if ( !emailStr.isEmpty() ) { | 765 | if ( !emailStr.isEmpty() ) { |
766 | qDebug(" emailstr "); | 766 | qDebug(" emailstr "); |
767 | QStringList l = QStringList::split( emailSeparator(), emailStr ); | 767 | QStringList l = QStringList::split( emailSeparator(), emailStr ); |
768 | for ( QStringList::ConstIterator it = l.begin();it != l.end();++it ) | 768 | for ( QStringList::ConstIterator it = l.begin();it != l.end();++it ) |
769 | r += (*it).simplifyWhiteSpace(); | 769 | r += (*it).simplifyWhiteSpace(); |
770 | } | 770 | } |
771 | 771 | ||
772 | return r; | 772 | return r; |
773 | } | 773 | } |
774 | 774 | ||
775 | /*! | 775 | /*! |
776 | \overload | 776 | \overload |
777 | 777 | ||
778 | Generates the string for the contact to be filed as from the first, | 778 | Generates the string for the contact to be filed as from the first, |
779 | middle and last name of the contact. | 779 | middle and last name of the contact. |
780 | */ | 780 | */ |
781 | void OContact::setFileAs() | 781 | void OContact::setFileAs() |
782 | { | 782 | { |
783 | QString lastName, firstName, middleName, fileas; | 783 | QString lastName, firstName, middleName, fileas; |
784 | 784 | ||
785 | lastName = find( Qtopia::LastName ); | 785 | lastName = find( Qtopia::LastName ); |
786 | firstName = find( Qtopia::FirstName ); | 786 | firstName = find( Qtopia::FirstName ); |
787 | middleName = find( Qtopia::MiddleName ); | 787 | middleName = find( Qtopia::MiddleName ); |
788 | if ( !lastName.isEmpty() && !firstName.isEmpty() | 788 | if ( !lastName.isEmpty() && !firstName.isEmpty() |
789 | && !middleName.isEmpty() ) | 789 | && !middleName.isEmpty() ) |
790 | fileas = lastName + ", " + firstName + " " + middleName; | 790 | fileas = lastName + ", " + firstName + " " + middleName; |
791 | else if ( !lastName.isEmpty() && !firstName.isEmpty() ) | 791 | else if ( !lastName.isEmpty() && !firstName.isEmpty() ) |
792 | fileas = lastName + ", " + firstName; | 792 | fileas = lastName + ", " + firstName; |
793 | else if ( !lastName.isEmpty() || !firstName.isEmpty() || | 793 | else if ( !lastName.isEmpty() || !firstName.isEmpty() || |