|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 ** |
|
7 ** This file is part of the Qt Mobility Components. |
|
8 ** |
|
9 ** $QT_BEGIN_LICENSE:LGPL$ |
|
10 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
15 ** |
|
16 ** GNU Lesser General Public License Usage |
|
17 ** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 ** General Public License version 2.1 as published by the Free Software |
|
19 ** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 ** packaging of this file. Please review the following information to |
|
21 ** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 ** |
|
24 ** In addition, as a special exception, Nokia gives you certain additional |
|
25 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 ** |
|
28 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
|
42 |
|
43 #ifndef QVERSITDEFS_H |
|
44 #define QVERSITDEFS_H |
|
45 |
|
46 #include "qmobilityglobal.h" |
|
47 |
|
48 #include <qcontactdetail.h> |
|
49 #include <qcontactname.h> |
|
50 #include <qcontactemailaddress.h> |
|
51 #include <qcontactphonenumber.h> |
|
52 #include "qcontactaddress.h" |
|
53 #include <qcontacturl.h> |
|
54 #include <qcontactguid.h> |
|
55 #include <qcontactorganization.h> |
|
56 #include <qcontacttimestamp.h> |
|
57 #include <qcontactbirthday.h> |
|
58 #include <qcontactnote.h> |
|
59 #include <qcontactgeolocation.h> |
|
60 #include <qcontactavatar.h> |
|
61 #include <qcontactgender.h> |
|
62 #include <qcontactnickname.h> |
|
63 #include <qcontactanniversary.h> |
|
64 #include <qcontactonlineaccount.h> |
|
65 #include <qcontactfamily.h> |
|
66 #include <qcontactdisplaylabel.h> |
|
67 |
|
68 QTM_BEGIN_NAMESPACE |
|
69 |
|
70 // Mapping between a string in versit specifications and Qt contact details |
|
71 struct versitContactDetailMapping { |
|
72 const char* versitPropertyName; |
|
73 const char* contactDetailDefinitionName; |
|
74 const char* contactDetailValueKey; |
|
75 }; |
|
76 |
|
77 //! [Property name mappings] |
|
78 // Mappings from versit property names to Qt contact details |
|
79 const versitContactDetailMapping versitContactDetailMappings[] = { |
|
80 {"ADR", QContactAddress::DefinitionName.str, |
|
81 ""}, |
|
82 {"BDAY", QContactBirthday::DefinitionName.str, |
|
83 QContactBirthday::FieldBirthday.str}, |
|
84 {"FN", QContactDisplayLabel::DefinitionName.str, |
|
85 ""}, |
|
86 {"GEO", QContactGeolocation::DefinitionName.str, |
|
87 ""}, |
|
88 {"EMAIL", QContactEmailAddress::DefinitionName.str, |
|
89 QContactEmailAddress::FieldEmailAddress.str}, |
|
90 {"IMPP", QContactOnlineAccount::DefinitionName.str, |
|
91 QContactOnlineAccount::SubTypeImpp.str}, |
|
92 {"LOGO", QContactOrganization::DefinitionName.str, |
|
93 QContactOrganization::FieldLogo.str}, |
|
94 {"N", QContactName::DefinitionName.str, |
|
95 ""}, |
|
96 {"NICKNAME", QContactNickname::DefinitionName.str, |
|
97 QContactNickname::FieldNickname.str}, |
|
98 {"NOTE", QContactNote::DefinitionName.str, |
|
99 QContactNote::FieldNote.str}, |
|
100 {"ORG", QContactOrganization::DefinitionName.str, |
|
101 QContactOrganization::FieldName.str}, |
|
102 {"PHOTO", QContactAvatar::DefinitionName.str, |
|
103 QContactAvatar::SubTypeImage.str}, |
|
104 {"REV", QContactTimestamp::DefinitionName.str, |
|
105 ""}, |
|
106 {"ROLE", QContactOrganization::DefinitionName.str, |
|
107 QContactOrganization::FieldRole.str}, |
|
108 {"SOUND", QContactAvatar::DefinitionName.str, |
|
109 QContactAvatar::SubTypeAudioRingtone.str}, |
|
110 {"TEL", QContactPhoneNumber::DefinitionName.str, |
|
111 QContactPhoneNumber::FieldNumber.str}, |
|
112 {"TITLE", QContactOrganization::DefinitionName.str, |
|
113 QContactOrganization::FieldTitle.str}, |
|
114 {"UID", QContactGuid::DefinitionName.str, |
|
115 QContactGuid::FieldGuid.str}, |
|
116 {"URL", QContactUrl::DefinitionName.str, |
|
117 QContactUrl::FieldUrl.str}, |
|
118 {"X-ANNIVERSARY", QContactAnniversary::DefinitionName.str, |
|
119 ""}, |
|
120 {"X-ASSISTANT", QContactOrganization::DefinitionName.str, |
|
121 QContactOrganization::FieldAssistantName.str}, |
|
122 {"X-CHILDREN", QContactFamily::DefinitionName.str, |
|
123 QContactFamily::FieldChildren.str}, |
|
124 {"X-GENDER", QContactGender::DefinitionName.str, |
|
125 QContactGender::FieldGender.str}, |
|
126 {"X-IMPP", QContactOnlineAccount::DefinitionName.str, |
|
127 QContactOnlineAccount::SubTypeImpp.str}, |
|
128 {"X-NICKNAME", QContactNickname::DefinitionName.str, |
|
129 QContactNickname::FieldNickname.str}, |
|
130 {"X-SIP", QContactOnlineAccount::DefinitionName.str, |
|
131 ""}, |
|
132 {"X-SPOUSE", QContactFamily::DefinitionName.str, |
|
133 QContactFamily::FieldSpouse.str} |
|
134 }; |
|
135 //! [Property name mappings] |
|
136 |
|
137 // Mapping between a string in versit specifications and Qt contacts |
|
138 struct versitMapping { |
|
139 const char* versitString; |
|
140 const char* contactString; |
|
141 }; |
|
142 |
|
143 // Mappings from versit TYPE parameters to Qt contact detail contexts |
|
144 const versitMapping versitContextMappings[] = { |
|
145 {"HOME", QContactDetail::ContextHome.str}, |
|
146 {"WORK", QContactDetail::ContextWork.str}, |
|
147 }; |
|
148 |
|
149 //! [Property type parameter mappings] |
|
150 // Mappings from versit TYPE parameters to Qt contact detail subtypes |
|
151 const versitMapping versitSubTypeMappings[] = { |
|
152 {"DOM", QContactAddress::SubTypeDomestic.str}, |
|
153 {"INTL", QContactAddress::SubTypeInternational.str}, |
|
154 {"POSTAL", QContactAddress::SubTypePostal.str}, |
|
155 {"PARCEL", QContactAddress::SubTypeParcel.str}, |
|
156 {"VOICE", QContactPhoneNumber::SubTypeVoice.str}, |
|
157 {"CELL", QContactPhoneNumber::SubTypeMobile.str}, |
|
158 {"MODEM", QContactPhoneNumber::SubTypeModem.str}, |
|
159 {"CAR", QContactPhoneNumber::SubTypeCar.str}, |
|
160 {"VIDEO", QContactPhoneNumber::SubTypeVideo.str}, |
|
161 {"FAX", QContactPhoneNumber::SubTypeFacsimile.str}, |
|
162 {"BBS", QContactPhoneNumber::SubTypeBulletinBoardSystem.str}, |
|
163 {"PAGER", QContactPhoneNumber::SubTypePager.str}, |
|
164 {"SWIS", QContactOnlineAccount::SubTypeVideoShare.str}, |
|
165 {"VOIP", QContactOnlineAccount::SubTypeSipVoip.str} |
|
166 }; |
|
167 //! [Property type parameter mappings] |
|
168 |
|
169 //! [File extension mappings] |
|
170 // Mappings from file types in versit specifications to file extensions |
|
171 const versitMapping versitFileExtensionMappings[] = { |
|
172 {"JPEG", "JPG"}, |
|
173 {"WAVE", "WAV"}, |
|
174 {"PICT", "PCT"}, |
|
175 {"TIFF", "TIF"}, |
|
176 {"MPEG", "MPG"}, |
|
177 {"MPEG2", "M2P"}, |
|
178 {"QTIME", "QT"}, |
|
179 {"AIFF", "AIF"}, |
|
180 {"GIF", "GIF"} |
|
181 }; |
|
182 //! [File extension mappings] |
|
183 |
|
184 QTM_END_NAMESPACE |
|
185 |
|
186 #endif // QVERSITDEFS_H |