src/versit/qversitdefs_p.h
changeset 0 876b1a06bc25
child 5 603d3f8b6302
equal deleted inserted replaced
-1:000000000000 0:876b1a06bc25
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2010 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_P_H
       
    44 #define QVERSITDEFS_P_H
       
    45 
       
    46 //
       
    47 //  W A R N I N G
       
    48 //  -------------
       
    49 //
       
    50 // This file is not part of the Qt API.  It exists purely as an
       
    51 // implementation detail.  This header file may change from version to
       
    52 // version without notice, or even be removed.
       
    53 //
       
    54 // We mean it.
       
    55 //
       
    56 
       
    57 #include "qmobilityglobal.h"
       
    58 
       
    59 #include <qcontactdetail.h>
       
    60 #include <qcontactname.h>
       
    61 #include <qcontactemailaddress.h>
       
    62 #include <qcontactphonenumber.h>
       
    63 #include "qcontactaddress.h"
       
    64 #include <qcontacturl.h>
       
    65 #include <qcontactguid.h>
       
    66 #include <qcontactorganization.h>
       
    67 #include <qcontacttimestamp.h>
       
    68 #include <qcontactbirthday.h>
       
    69 #include <qcontactnote.h>
       
    70 #include <qcontactgeolocation.h>
       
    71 #include <qcontactavatar.h>
       
    72 #include <qcontactgender.h>
       
    73 #include <qcontactnickname.h>
       
    74 #include <qcontactanniversary.h>
       
    75 #include <qcontactonlineaccount.h>
       
    76 #include <qcontactfamily.h>
       
    77 #include <qcontactdisplaylabel.h>
       
    78 #include <qcontacttag.h>
       
    79 #include <qcontactringtone.h>
       
    80 #include <qcontactthumbnail.h>
       
    81 
       
    82 QTM_BEGIN_NAMESPACE
       
    83 
       
    84 // Mapping between a string in versit specifications and Qt contact details
       
    85 struct VersitContactDetailMapping {
       
    86     const char* versitPropertyName;
       
    87     const char* contactDetailDefinitionName;
       
    88     const char* contactDetailValueKey;
       
    89 };
       
    90 
       
    91 //! [Property name mappings]
       
    92 // Mappings from versit property names to Qt contact details
       
    93 const VersitContactDetailMapping versitContactDetailMappings[] = {
       
    94     {"ADR",           QContactAddress::DefinitionName.latin1(),
       
    95                       ""},
       
    96     {"BDAY",          QContactBirthday::DefinitionName.latin1(),
       
    97                       QContactBirthday::FieldBirthday.latin1()},
       
    98     {"CATEGORIES",    QContactTag::DefinitionName.latin1(),
       
    99                       QContactTag::FieldTag.latin1()},
       
   100     {"FN",            QContactDisplayLabel::DefinitionName.latin1(),
       
   101                       ""},
       
   102     {"GEO",           QContactGeoLocation::DefinitionName.latin1(),
       
   103                       ""},
       
   104     {"EMAIL",         QContactEmailAddress::DefinitionName.latin1(),
       
   105                       QContactEmailAddress::FieldEmailAddress.latin1()},
       
   106     {"IMPP",          QContactOnlineAccount::DefinitionName.latin1(),
       
   107                       QContactOnlineAccount::SubTypeImpp.latin1()},
       
   108     {"LOGO",          QContactOrganization::DefinitionName.latin1(),
       
   109                       QContactOrganization::FieldLogoUrl.latin1()},
       
   110     {"N",             QContactName::DefinitionName.latin1(),
       
   111                       ""},
       
   112     {"NICKNAME",      QContactNickname::DefinitionName.latin1(),
       
   113                       QContactNickname::FieldNickname.latin1()},
       
   114     {"NOTE",          QContactNote::DefinitionName.latin1(),
       
   115                       QContactNote::FieldNote.latin1()},
       
   116     {"ORG",           QContactOrganization::DefinitionName.latin1(),
       
   117                       QContactOrganization::FieldName.latin1()},
       
   118     {"PHOTO",         QContactThumbnail::DefinitionName.latin1(),
       
   119                       ""},
       
   120     {"REV",           QContactTimestamp::DefinitionName.latin1(),
       
   121                       ""},
       
   122     {"ROLE",          QContactOrganization::DefinitionName.latin1(),
       
   123                       QContactOrganization::FieldRole.latin1()},
       
   124     {"SOUND",         QContactRingtone::DefinitionName.latin1(),
       
   125                       QContactRingtone::FieldAudioRingtoneUrl.latin1()},
       
   126     {"TEL",           QContactPhoneNumber::DefinitionName.latin1(),
       
   127                       QContactPhoneNumber::FieldNumber.latin1()},
       
   128     {"TITLE",         QContactOrganization::DefinitionName.latin1(),
       
   129                       QContactOrganization::FieldTitle.latin1()},
       
   130     {"UID",           QContactGuid::DefinitionName.latin1(),
       
   131                       QContactGuid::FieldGuid.latin1()},
       
   132     {"URL",           QContactUrl::DefinitionName.latin1(),
       
   133                       QContactUrl::FieldUrl.latin1()},
       
   134     {"X-ANNIVERSARY", QContactAnniversary::DefinitionName.latin1(),
       
   135                       ""},
       
   136     {"X-ASSISTANT",   QContactOrganization::DefinitionName.latin1(),
       
   137                       QContactOrganization::FieldAssistantName.latin1()},
       
   138     {"X-ASSISTANT-TEL", QContactPhoneNumber::DefinitionName.latin1(),
       
   139                       QContactPhoneNumber::SubTypeAssistant.latin1()},
       
   140     {"X-CHILDREN",    QContactFamily::DefinitionName.latin1(),
       
   141                       QContactFamily::FieldChildren.latin1()},
       
   142     {"X-EPOCSECONDNAME",QContactNickname::DefinitionName.latin1(),
       
   143                       QContactNickname::FieldNickname.latin1()},
       
   144     {"X-GENDER",      QContactGender::DefinitionName.latin1(),
       
   145                       QContactGender::FieldGender.latin1()},
       
   146     {"X-IMPP",        QContactOnlineAccount::DefinitionName.latin1(),
       
   147                       QContactOnlineAccount::SubTypeImpp.latin1()},
       
   148     {"X-JABBER",      QContactOnlineAccount::DefinitionName.latin1(),
       
   149                       QContactOnlineAccount::SubTypeImpp.latin1()},
       
   150     {"X-NICKNAME",    QContactNickname::DefinitionName.latin1(),
       
   151                       QContactNickname::FieldNickname.latin1()},
       
   152     {"X-SIP",         QContactOnlineAccount::DefinitionName.latin1(),
       
   153                       ""},
       
   154     {"X-SPOUSE",      QContactFamily::DefinitionName.latin1(),
       
   155                       QContactFamily::FieldSpouse.latin1()}
       
   156 };
       
   157 //! [Property name mappings]
       
   158 
       
   159 // Mapping between a string in versit specifications and Qt contacts
       
   160 struct VersitMapping {
       
   161     const char* versitString;
       
   162     const char* contactString;
       
   163 };
       
   164 
       
   165 // Mappings from versit TYPE parameters to Qt contact detail contexts
       
   166 const VersitMapping versitContextMappings[] = {
       
   167     {"HOME", QContactDetail::ContextHome.latin1()},
       
   168     {"WORK", QContactDetail::ContextWork.latin1()},
       
   169 };
       
   170 
       
   171 //! [Property type parameter mappings]
       
   172 // Mappings from versit TYPE parameters to Qt contact detail subtypes
       
   173 const VersitMapping versitSubTypeMappings[] = {
       
   174     {"DOM",    QContactAddress::SubTypeDomestic.latin1()},
       
   175     {"INTL",   QContactAddress::SubTypeInternational.latin1()},
       
   176     {"POSTAL", QContactAddress::SubTypePostal.latin1()},
       
   177     {"PARCEL", QContactAddress::SubTypeParcel.latin1()},
       
   178     {"VOICE",  QContactPhoneNumber::SubTypeVoice.latin1()},
       
   179     {"CELL",   QContactPhoneNumber::SubTypeMobile.latin1()},
       
   180     {"MODEM",  QContactPhoneNumber::SubTypeModem.latin1()},
       
   181     {"CAR",    QContactPhoneNumber::SubTypeCar.latin1()},
       
   182     {"VIDEO",  QContactPhoneNumber::SubTypeVideo.latin1()},
       
   183     {"FAX",    QContactPhoneNumber::SubTypeFax.latin1()},
       
   184     {"BBS",    QContactPhoneNumber::SubTypeBulletinBoardSystem.latin1()},
       
   185     {"PAGER",  QContactPhoneNumber::SubTypePager.latin1()},
       
   186     {"SWIS",   QContactOnlineAccount::SubTypeVideoShare.latin1()},
       
   187     {"VOIP",   QContactOnlineAccount::SubTypeSipVoip.latin1()}
       
   188 };
       
   189 //! [Property type parameter mappings]
       
   190 
       
   191 //! [File extension mappings]
       
   192 // Mappings from mime types to file extensions
       
   193 const VersitMapping versitFileExtensionMappings[] = {
       
   194     {"application/octet-stream", "obj"},
       
   195     {"audio/x-pn-realaudio", "ra"},
       
   196     {"application/xml", "wsdl"},
       
   197     {"application/octet-stream", "dll"},
       
   198     {"image/x-cmu-raster", "ras"},
       
   199     {"application/x-pn-realaudio", "ram"},
       
   200     {"application/x-bcpio", "bcpio"},
       
   201     {"application/x-sh", "sh"},
       
   202     {"video/mpeg", "m1v"},
       
   203     {"image/x-xwindowdump", "xwd"},
       
   204     {"video/x-msvideo", "avi"},
       
   205     {"image/x-ms-bmp", "bmp"},
       
   206     {"application/x-shar", "shar"},
       
   207     {"application/x-javascript", "js"},
       
   208     {"application/x-wais-source", "src"},
       
   209     {"application/x-dvi", "dvi"},
       
   210     {"audio/x-aiff", "aif"},
       
   211     {"text/plain", "ksh"},
       
   212     {"application/msword", "dot"},
       
   213     {"message/rfc822", "mht"},
       
   214     {"application/x-pkcs12", "p12"},
       
   215     {"text/css", "css"},
       
   216     {"application/x-csh", "csh"},
       
   217     {"application/vnd.ms-powerpoint", "pwz"},
       
   218     {"application/pdf", "pdf"},
       
   219     {"application/x-netcdf", "cdf"},
       
   220     {"text/plain", "pl"},
       
   221     {"text/plain", "c"},
       
   222     {"image/jpeg", "jpe"},
       
   223     {"image/jpeg", "jpg"},
       
   224     {"text/x-python", "py"},
       
   225     {"text/xml", "xml"},
       
   226     {"image/jpeg", "jpeg"},
       
   227     {"application/postscript", "ps"},
       
   228     {"application/x-gtar", "gtar"},
       
   229     {"image/x-xpixmap", "xpm"},
       
   230     {"application/x-hdf", "hdf"},
       
   231     {"message/rfc822", "nws"},
       
   232     {"text/tab-separated-values", "tsv"},
       
   233     {"application/xml", "xpdl"},
       
   234     {"application/pkcs7-mime", "p7c"},
       
   235     {"application/postscript", "eps"},
       
   236     {"image/ief", "ief"},
       
   237     {"application/octet-stream", "so"},
       
   238     {"application/vnd.ms-excel", "xlb"},
       
   239     {"image/x-portable-bitmap", "pbm"},
       
   240     {"application/x-texinfo", "texinfo"},
       
   241     {"application/vnd.ms-excel", "xls"},
       
   242     {"application/x-tex", "tex"},
       
   243     {"text/richtext", "rtx"},
       
   244     {"text/html", "html"},
       
   245     {"audio/x-aiff", "aiff"},
       
   246     {"audio/x-aiff", "aifc"},
       
   247     {"application/octet-stream", "exe"},
       
   248     {"text/x-sgml", "sgm"},
       
   249     {"image/tiff", "tif"},
       
   250     {"video/mpeg", "mpeg"},
       
   251     {"application/x-ustar", "ustar"},
       
   252     {"image/gif", "gif"},
       
   253     {"application/vnd.ms-powerpoint", "ppt"},
       
   254     {"application/vnd.ms-powerpoint", "pps"},
       
   255     {"text/x-sgml", "sgml"},
       
   256     {"image/x-portable-pixmap", "ppm"},
       
   257     {"application/x-latex", "latex"},
       
   258     {"text/plain", "bat"},
       
   259     {"video/quicktime", "mov"},
       
   260     {"application/vnd.ms-powerpoint", "ppa"},
       
   261     {"application/x-troff", "tr"},
       
   262     {"application/xml", "rdf"},
       
   263     {"application/xml", "xsl"},
       
   264     {"message/rfc822", "eml"},
       
   265     {"application/x-netcdf", "nc"},
       
   266     {"application/x-sv4cpio", "sv4cpio"},
       
   267     {"application/octet-stream", "bin"},
       
   268     {"text/plain", "h"},
       
   269     {"application/x-tcl", "tcl"},
       
   270     {"application/msword", "wiz"},
       
   271     {"application/octet-stream", "o"},
       
   272     {"application/octet-stream", "a"},
       
   273     {"application/postscript", "ai"},
       
   274     {"audio/x-wav", "wav"},
       
   275     {"text/x-vcard", "vcf"},
       
   276     {"image/x-xbitmap", "xbm"},
       
   277     {"text/plain", "txt"},
       
   278     {"audio/basic", "au"},
       
   279     {"application/x-troff", "t"},
       
   280     {"image/tiff", "tiff"},
       
   281     {"application/x-texinfo", "texi"},
       
   282     {"application/oda", "oda"},
       
   283     {"application/x-troff-ms", "ms"},
       
   284     {"image/x-rgb", "rgb"},
       
   285     {"application/x-troff-me", "me"},
       
   286     {"application/x-sv4crc", "sv4crc"},
       
   287     {"video/quicktime", "qt"},
       
   288     {"video/mpeg", "mpa"},
       
   289     {"video/mpeg", "mpg"},
       
   290     {"video/mpeg", "mpe"},
       
   291     {"application/msword", "doc"},
       
   292     {"image/x-portable-graymap", "pgm"},
       
   293     {"application/vnd.ms-powerpoint", "pot"},
       
   294     {"application/x-mif", "mif"},
       
   295     {"application/x-troff", "roff"},
       
   296     {"text/html", "htm"},
       
   297     {"application/x-troff-man", "man"},
       
   298     {"text/x-setext", "etx"},
       
   299     {"application/zip", "zip"},
       
   300     {"video/x-sgi-movie", "movie"},
       
   301     {"application/x-python-code", "pyc"},
       
   302     {"image/png", "png"},
       
   303     {"application/x-pkcs12", "pfx"},
       
   304     {"message/rfc822", "mhtml"},
       
   305     {"application/x-tar", "tar"},
       
   306     {"image/x-portable-anymap", "pnm"},
       
   307     {"application/x-python-code", "pyo"},
       
   308     {"audio/basic", "snd"},
       
   309     {"application/x-cpio", "cpio"},
       
   310     {"application/x-shockwave-flash", "swf"},
       
   311     {"audio/mpeg", "mp3"},
       
   312     {"audio/mpeg", "mp2"}
       
   313 };
       
   314 //! [File extension mappings]
       
   315 
       
   316 QTM_END_NAMESPACE
       
   317 
       
   318 #endif // QVERSITDEFS_P_H