-rw-r--r-- | kabc/vcard/Enum.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/kabc/vcard/Enum.cpp b/kabc/vcard/Enum.cpp index cc48b5a..036324c 100644 --- a/kabc/vcard/Enum.cpp +++ b/kabc/vcard/Enum.cpp | |||
@@ -1,80 +1,80 @@ | |||
1 | /* | 1 | /* |
2 | libvcard - vCard parsing library for vCard version 3.0 | 2 | libvcard - vCard parsing library for vCard version 3.0 |
3 | 3 | ||
4 | Copyright (C) 1998 Rik Hemsley rik@kde.org | 4 | Copyright (C) 1998 Rik Hemsley rik@kde.org |
5 | 5 | ||
6 | Permission is hereby granted, free of charge, to any person obtaining a copy | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy |
7 | of this software and associated documentation files (the "Software"), to | 7 | of this software and associated documentation files (the "Software"), to |
8 | deal in the Software without restriction, including without limitation the | 8 | deal in the Software without restriction, including without limitation the |
9 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or | 9 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
10 | sell copies of the Software, and to permit persons to whom the Software is | 10 | sell copies of the Software, and to permit persons to whom the Software is |
11 | furnished to do so, subject to the following conditions: | 11 | furnished to do so, subject to the following conditions: |
12 | 12 | ||
13 | The above copyright notice and this permission notice shall be included in | 13 | The above copyright notice and this permission notice shall be included in |
14 | all copies or substantial portions of the Software. | 14 | all copies or substantial portions of the Software. |
15 | 15 | ||
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
19 | AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | 19 | AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
20 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | 20 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | 21 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qcstring.h> | 24 | #include <q3cstring.h> |
25 | #include <ctype.h> | 25 | #include <ctype.h> |
26 | 26 | ||
27 | #include <VCardEnum.h> | 27 | #include <VCardEnum.h> |
28 | 28 | ||
29 | using namespace VCARD; | 29 | using namespace VCARD; |
30 | 30 | ||
31 | // There are 31 possible types, not including extensions. | 31 | // There are 31 possible types, not including extensions. |
32 | const QCString | 32 | const Q3CString |
33 | VCARD::paramNames [] = | 33 | VCARD::paramNames [] = |
34 | { | 34 | { |
35 | "NAME", | 35 | "NAME", |
36 | "PROFILE", | 36 | "PROFILE", |
37 | "SOURCE", | 37 | "SOURCE", |
38 | "FN", | 38 | "FN", |
39 | "N", | 39 | "N", |
40 | "NICKNAME", | 40 | "NICKNAME", |
41 | "PHOTO", | 41 | "PHOTO", |
42 | "BDAY", | 42 | "BDAY", |
43 | "ADR", | 43 | "ADR", |
44 | "LABEL", | 44 | "LABEL", |
45 | "TEL", | 45 | "TEL", |
46 | "EMAIL", | 46 | "EMAIL", |
47 | "MAILER", | 47 | "MAILER", |
48 | "TZ", | 48 | "TZ", |
49 | "GEO", | 49 | "GEO", |
50 | "TITLE", | 50 | "TITLE", |
51 | "ROLE", | 51 | "ROLE", |
52 | "LOGO", | 52 | "LOGO", |
53 | "AGENT", | 53 | "AGENT", |
54 | "ORG", | 54 | "ORG", |
55 | "CATEGORIES", | 55 | "CATEGORIES", |
56 | "NOTE", | 56 | "NOTE", |
57 | "PRODID", | 57 | "PRODID", |
58 | "REV", | 58 | "REV", |
59 | "SORT-STRING", | 59 | "SORT-STRING", |
60 | "SOUND", | 60 | "SOUND", |
61 | "UID", | 61 | "UID", |
62 | "URL", | 62 | "URL", |
63 | "VERSION", | 63 | "VERSION", |
64 | "CLASS", | 64 | "CLASS", |
65 | "KEY" | 65 | "KEY" |
66 | }; | 66 | }; |
67 | 67 | ||
68 | const ParamType | 68 | const ParamType |
69 | VCARD::paramTypesTable[] = { | 69 | VCARD::paramTypesTable[] = { |
70 | ParamNone, // NAME | 70 | ParamNone, // NAME |
71 | ParamNone, // PROFILE | 71 | ParamNone, // PROFILE |
72 | ParamSource, // SOURCE | 72 | ParamSource, // SOURCE |
73 | ParamText, // FN | 73 | ParamText, // FN |
74 | ParamText, // N | 74 | ParamText, // N |
75 | ParamText, // NICKNAME | 75 | ParamText, // NICKNAME |
76 | ParamImage, // PHOTO (inline/refer) | 76 | ParamImage, // PHOTO (inline/refer) |
77 | ParamDate, // BDAY ("VALUE = "date-time/date) | 77 | ParamDate, // BDAY ("VALUE = "date-time/date) |
78 | ParamAddrText, // ADR (adr-param/text-param) | 78 | ParamAddrText, // ADR (adr-param/text-param) |
79 | ParamAddrText, // LABEL (adr-param/text-param) | 79 | ParamAddrText, // LABEL (adr-param/text-param) |
80 | ParamTel, // TEL | 80 | ParamTel, // TEL |
@@ -177,105 +177,105 @@ VCARD::EntityTypeToValueType(EntityType e) | |||
177 | case EntityTelephone: t = ValueTel; break; | 177 | case EntityTelephone: t = ValueTel; break; |
178 | //---------------------------------------------------------------// | 178 | //---------------------------------------------------------------// |
179 | case EntityKey: t = ValueTextBin;break; | 179 | case EntityKey: t = ValueTextBin;break; |
180 | //---------------------------------------------------------------// | 180 | //---------------------------------------------------------------// |
181 | case EntityOrganisation: t = ValueOrg; break; | 181 | case EntityOrganisation: t = ValueOrg; break; |
182 | //---------------------------------------------------------------// | 182 | //---------------------------------------------------------------// |
183 | case EntityN: t = ValueN; break; | 183 | case EntityN: t = ValueN; break; |
184 | //---------------------------------------------------------------// | 184 | //---------------------------------------------------------------// |
185 | case EntityTimeZone: t = ValueUTC; break; | 185 | case EntityTimeZone: t = ValueUTC; break; |
186 | //---------------------------------------------------------------// | 186 | //---------------------------------------------------------------// |
187 | case EntityClass: t = ValueClass; break; | 187 | case EntityClass: t = ValueClass; break; |
188 | //---------------------------------------------------------------// | 188 | //---------------------------------------------------------------// |
189 | case EntityGeo: t = ValueGeo; break; | 189 | case EntityGeo: t = ValueGeo; break; |
190 | //---------------------------------------------------------------// | 190 | //---------------------------------------------------------------// |
191 | case EntitySource: | 191 | case EntitySource: |
192 | case EntityURL: t = ValueURI; break; | 192 | case EntityURL: t = ValueURI; break; |
193 | //---------------------------------------------------------------// | 193 | //---------------------------------------------------------------// |
194 | case EntityPhoto: | 194 | case EntityPhoto: |
195 | case EntityLogo: t = ValueImage; break; | 195 | case EntityLogo: t = ValueImage; break; |
196 | //---------------------------------------------------------------// | 196 | //---------------------------------------------------------------// |
197 | case EntityBirthday: | 197 | case EntityBirthday: |
198 | case EntityRevision: t = ValueDate; break; | 198 | case EntityRevision: t = ValueDate; break; |
199 | //---------------------------------------------------------------// | 199 | //---------------------------------------------------------------// |
200 | case EntityCategories: | 200 | case EntityCategories: |
201 | case EntityNickname: t = ValueTextList;break; | 201 | case EntityNickname: t = ValueTextList;break; |
202 | //---------------------------------------------------------------// | 202 | //---------------------------------------------------------------// |
203 | case EntityLabel: | 203 | case EntityLabel: |
204 | case EntityExtension: | 204 | case EntityExtension: |
205 | case EntityEmail: | 205 | case EntityEmail: |
206 | case EntityTitle: | 206 | case EntityTitle: |
207 | case EntityRole: | 207 | case EntityRole: |
208 | case EntityFullName: | 208 | case EntityFullName: |
209 | case EntityMailer: | 209 | case EntityMailer: |
210 | case EntityProductID: | 210 | case EntityProductID: |
211 | case EntityName: | 211 | case EntityName: |
212 | case EntitySortString: | 212 | case EntitySortString: |
213 | case EntityVersion: | 213 | case EntityVersion: |
214 | case EntityProfile: | 214 | case EntityProfile: |
215 | case EntityUID: | 215 | case EntityUID: |
216 | case EntityNote: | 216 | case EntityNote: |
217 | default: t = ValueText; break; | 217 | default: t = ValueText; break; |
218 | //---------------------------------------------------------------// | 218 | //---------------------------------------------------------------// |
219 | 219 | ||
220 | } | 220 | } |
221 | 221 | ||
222 | return t; | 222 | return t; |
223 | } | 223 | } |
224 | 224 | ||
225 | QCString | 225 | Q3CString |
226 | VCARD::EntityTypeToParamName(EntityType e) | 226 | VCARD::EntityTypeToParamName(EntityType e) |
227 | { | 227 | { |
228 | if ( e > EntityUnknown ) e = EntityUnknown; | 228 | if ( e > EntityUnknown ) e = EntityUnknown; |
229 | return paramNames[ int( e ) ]; | 229 | return paramNames[ int( e ) ]; |
230 | } | 230 | } |
231 | 231 | ||
232 | EntityType | 232 | EntityType |
233 | VCARD::EntityNameToEntityType(const QCString & s) | 233 | VCARD::EntityNameToEntityType(const Q3CString & s) |
234 | { | 234 | { |
235 | if (s.isEmpty()) return EntityUnknown; | 235 | if (s.isEmpty()) return EntityUnknown; |
236 | 236 | ||
237 | EntityType t(EntityUnknown); | 237 | EntityType t(EntityUnknown); |
238 | 238 | ||
239 | switch (s[0]) { | 239 | switch (s[0]) { |
240 | 240 | ||
241 | case 'A': | 241 | case 'A': |
242 | if (s == "ADR") | 242 | if (s == "ADR") |
243 | t = EntityAddress; | 243 | t = EntityAddress; |
244 | else if (s == "AGENT") | 244 | else if (s == "AGENT") |
245 | t = EntityAgent; | 245 | t = EntityAgent; |
246 | break; | 246 | break; |
247 | 247 | ||
248 | case 'B': | 248 | case 'B': |
249 | if (s == "BDAY") | 249 | if (s == "BDAY") |
250 | t = EntityBirthday; | 250 | t = EntityBirthday; |
251 | break; | 251 | break; |
252 | 252 | ||
253 | case 'C': | 253 | case 'C': |
254 | if (s == "CATEGORIES") | 254 | if (s == "CATEGORIES") |
255 | t = EntityCategories; | 255 | t = EntityCategories; |
256 | else if (s == "CLASS") | 256 | else if (s == "CLASS") |
257 | t = EntityClass; | 257 | t = EntityClass; |
258 | break; | 258 | break; |
259 | 259 | ||
260 | case 'E': | 260 | case 'E': |
261 | if (s == "EMAIL") | 261 | if (s == "EMAIL") |
262 | t = EntityEmail; | 262 | t = EntityEmail; |
263 | break; | 263 | break; |
264 | 264 | ||
265 | case 'F': | 265 | case 'F': |
266 | if (s == "FN") | 266 | if (s == "FN") |
267 | t = EntityFullName; | 267 | t = EntityFullName; |
268 | break; | 268 | break; |
269 | 269 | ||
270 | case 'G': | 270 | case 'G': |
271 | if (s == "GEO") | 271 | if (s == "GEO") |
272 | t = EntityGeo; | 272 | t = EntityGeo; |
273 | break; | 273 | break; |
274 | 274 | ||
275 | case 'K': | 275 | case 'K': |
276 | if (s == "KEY") | 276 | if (s == "KEY") |
277 | t = EntityKey; | 277 | t = EntityKey; |
278 | break; | 278 | break; |
279 | 279 | ||
280 | case 'L': | 280 | case 'L': |
281 | if (s == "LABEL") | 281 | if (s == "LABEL") |