author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (side-by-side diff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kabc/vcard/Enum.cpp | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2 |
initial public commit of qt4 portp1
-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,361 +1,361 @@ /* libvcard - vCard parsing library for vCard version 3.0 Copyright (C) 1998 Rik Hemsley rik@kde.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#include <qcstring.h> +#include <q3cstring.h> #include <ctype.h> #include <VCardEnum.h> using namespace VCARD; // There are 31 possible types, not including extensions. - const QCString + const Q3CString VCARD::paramNames [] = { "NAME", "PROFILE", "SOURCE", "FN", "N", "NICKNAME", "PHOTO", "BDAY", "ADR", "LABEL", "TEL", "EMAIL", "MAILER", "TZ", "GEO", "TITLE", "ROLE", "LOGO", "AGENT", "ORG", "CATEGORIES", "NOTE", "PRODID", "REV", "SORT-STRING", "SOUND", "UID", "URL", "VERSION", "CLASS", "KEY" }; const ParamType VCARD::paramTypesTable[] = { ParamNone, // NAME ParamNone, // PROFILE ParamSource, // SOURCE ParamText, // FN ParamText, // N ParamText, // NICKNAME ParamImage, // PHOTO (inline/refer) ParamDate, // BDAY ("VALUE = "date-time/date) ParamAddrText, // ADR (adr-param/text-param) ParamAddrText, // LABEL (adr-param/text-param) ParamTel, // TEL ParamEmail, // EMAIL ParamText, // MAILER ParamNone, // TZ ParamNone, // GEO ParamText, // TITLE ParamText, // ROLE ParamImage, // LOGO ParamAgent, // AGENT ParamText, // ORG ParamText, // CATEGORIES ParamText, // NOTE ParamNone, // PRODID ParamDate, // REV ParamText, // SORT-STRING ParamSound, // SOUND ParamNone, // UID ParamNone, // URL ParamNone, // VERSION ParamNone, // CLASS ParamTextBin, // KEY ParamTextNS // X }; ParamType VCARD::EntityTypeToParamType(EntityType e) { ParamType t(ParamUnknown); switch (e) { //---------------------------------------------------------------// case EntityAgent: t = ParamAgent; break; //---------------------------------------------------------------// case EntitySound: t = ParamSound; break; //---------------------------------------------------------------// case EntitySource: t = ParamSource; break; //---------------------------------------------------------------// case EntityTelephone: t = ParamTel; break; //---------------------------------------------------------------// case EntityEmail: t = ParamEmail; break; //---------------------------------------------------------------// case EntityKey: t = ParamTextBin; break; //---------------------------------------------------------------// case EntityExtension: t = ParamTextNS; break; //---------------------------------------------------------------// case EntityAddress: case EntityLabel: t = ParamAddrText; break; //---------------------------------------------------------------// case EntityBirthday: case EntityRevision: t = ParamDate; break; //---------------------------------------------------------------// case EntityPhoto: case EntityLogo: t = ParamImage; break; //---------------------------------------------------------------// case EntityOrganisation: case EntityTitle: case EntityRole: case EntityFullName: case EntityMailer: case EntityN: case EntitySortString: case EntityNickname: case EntityCategories: case EntityNote: t = ParamText; break; //---------------------------------------------------------------// case EntityProductID: case EntityTimeZone: case EntityUID: case EntityURL: case EntityClass: case EntityGeo: case EntityName: case EntityVersion: case EntityProfile: default: t = ParamNone; break; //---------------------------------------------------------------// } return t; } ValueType VCARD::EntityTypeToValueType(EntityType e) { ValueType t(ValueUnknown); switch (e) { //---------------------------------------------------------------// case EntitySound: t = ValueSound; break; //---------------------------------------------------------------// case EntityAgent: t = ValueAgent; break; //---------------------------------------------------------------// case EntityAddress: t = ValueAddress; break; //---------------------------------------------------------------// case EntityTelephone: t = ValueTel; break; //---------------------------------------------------------------// case EntityKey: t = ValueTextBin; break; //---------------------------------------------------------------// case EntityOrganisation: t = ValueOrg; break; //---------------------------------------------------------------// case EntityN: t = ValueN; break; //---------------------------------------------------------------// case EntityTimeZone: t = ValueUTC; break; //---------------------------------------------------------------// case EntityClass: t = ValueClass; break; //---------------------------------------------------------------// case EntityGeo: t = ValueGeo; break; //---------------------------------------------------------------// case EntitySource: case EntityURL: t = ValueURI; break; //---------------------------------------------------------------// case EntityPhoto: case EntityLogo: t = ValueImage; break; //---------------------------------------------------------------// case EntityBirthday: case EntityRevision: t = ValueDate; break; //---------------------------------------------------------------// case EntityCategories: case EntityNickname: t = ValueTextList; break; //---------------------------------------------------------------// case EntityLabel: case EntityExtension: case EntityEmail: case EntityTitle: case EntityRole: case EntityFullName: case EntityMailer: case EntityProductID: case EntityName: case EntitySortString: case EntityVersion: case EntityProfile: case EntityUID: case EntityNote: default: t = ValueText; break; //---------------------------------------------------------------// } return t; } - QCString + Q3CString VCARD::EntityTypeToParamName(EntityType e) { if ( e > EntityUnknown ) e = EntityUnknown; return paramNames[ int( e ) ]; } EntityType -VCARD::EntityNameToEntityType(const QCString & s) +VCARD::EntityNameToEntityType(const Q3CString & s) { if (s.isEmpty()) return EntityUnknown; EntityType t(EntityUnknown); switch (s[0]) { case 'A': if (s == "ADR") t = EntityAddress; else if (s == "AGENT") t = EntityAgent; break; case 'B': if (s == "BDAY") t = EntityBirthday; break; case 'C': if (s == "CATEGORIES") t = EntityCategories; else if (s == "CLASS") t = EntityClass; break; case 'E': if (s == "EMAIL") t = EntityEmail; break; case 'F': if (s == "FN") t = EntityFullName; break; case 'G': if (s == "GEO") t = EntityGeo; break; case 'K': if (s == "KEY") t = EntityKey; break; case 'L': if (s == "LABEL") t = EntityLabel; else if (s == "LOGO") t = EntityLogo; break; case 'M': if (s == "MAILER") t = EntityMailer; break; case 'N': if (s == "N") t = EntityN; else if (s == "NAME") t = EntityName; else if (s == "NICKNAME") t = EntityNickname; else if (s == "NOTE") t = EntityNote; break; case 'O': if (s == "ORG") t = EntityOrganisation; break; case 'P': if (s == "PHOTO") t = EntityPhoto; else if (s == "PRODID") t = EntityProductID; else if (s == "PROFILE") t = EntityProfile; break; case 'R': if (s == "REV") t = EntityRevision; else if (s == "ROLE") t = EntityRole; break; case 'S': if (s == "SORT-STRING") t = EntitySortString; else if (s == "SOUND") t = EntitySound; else if (s == "SOURCE") t = EntitySource; break; case 'T': if (s == "TEL") t = EntityTelephone; else if (s == "TITLE") t = EntityTitle; else if (s == "TZ") t = EntityTimeZone; break; case 'U': if (s == "UID") t = EntityUID; else if (s == "URL") t = EntityURL; case 'V': if (s == "VERSION") t = EntityVersion; break; case 'X': if (s.left(2) == "X-") t = EntityExtension; break; default: t = EntityUnknown; } |