phonebookengines_old/contactsmodel/tsrc/TVCARD.CPP
changeset 40 b46a585f6909
child 49 74b30151afd6
equal deleted inserted replaced
37:fd64c38c277d 40:b46a585f6909
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15  
       
    16 #if !defined(__T_VERS_H__)
       
    17     #include "T_VERS.H"
       
    18 #endif
       
    19 
       
    20 void CVCardTest::GetSampleVersitL()
       
    21 	{
       
    22 
       
    23 	iParser=CParserVCard::NewL();
       
    24 	iVersit.Zero();
       
    25 	iVersit.Append(KVersitTokenCRLF);
       
    26 	iVersit.Append(_L8("     "));
       
    27 	iVersit.Append(KVersitTokenCRLF);
       
    28 	iVersit.Append(KVersitTokenCRLF);
       
    29 	iVersit.Append(_L8("     "));
       
    30 	iVersit.Append(_L8("BEGIN:VCARD"));
       
    31 	iVersit.Append(KVersitTokenCRLF);
       
    32 	iVersit.Append(KVersitTokenCRLF);
       
    33 	iVersit.Append(_L8("VERSION:2.1"));
       
    34 	iVersit.Append(KVersitTokenCRLF);
       
    35 	iVersit.Append(_L8("     "));
       
    36 	iVersit.Append(KVersitTokenCRLF);
       
    37 	iVersit.Append(_L8("TEL;HOME:+44-7700-900-000"));
       
    38 	iVersit.Append(KVersitTokenCRLF);
       
    39 //QUOTED-P
       
    40 	iVersit.Append(_L8("NOTE;ENCODING=QUOTED-PRINTABLE:Don’t remember to order Girl="));
       
    41 	iVersit.Append(KVersitTokenCRLF);
       
    42 	iVersit.Append(_L8("  Scout cookies from Stacey today!")); 
       
    43     iVersit.Append(KVersitTokenCRLF);
       
    44 	iVersit.Append(_L8("A.TEL;HOME:+44-7700-900-001"));
       
    45 	iVersit.Append(KVersitTokenCRLF);
       
    46 	iVersit.Append(_L8("A.NOTE:This is my vacation home."));
       
    47 	iVersit.Append(KVersitTokenCRLF);
       
    48 	iVersit.Append(_L8("PHOTO:http://www.abc.com/dir_photos/my_photo.gif"));
       
    49 	iVersit.Append(KVersitTokenCRLF);
       
    50 	iVersit.Append(_L8("SOUND;VALUE=CONTENT-ID:<jsmith.part3.960817T083000.xyzMail@examlehost1.com"));
       
    51 	iVersit.Append(KVersitTokenCRLF);
       
    52 	iVersit.Append(_L8("FN;CHARSET=ISO-8859-8;VALUE=URL;TYPE=GIF:Mr. John Q. Public, Esq."));
       
    53 	iVersit.Append(KVersitTokenCRLF);
       
    54 	iVersit.Append(_L8("N:Public;John;Quinlan;Mr.;Esq."));
       
    55 	iVersit.Append(KVersitTokenCRLF);
       
    56 	iVersit.Append(_L8("N:Veni, Vidi, Vici The Restaurant."));
       
    57 	iVersit.Append(KVersitTokenCRLF);
       
    58 	iVersit.Append(_L8("PHOTO;VALUE=URL:file:///jqpublic.gif"));
       
    59 	iVersit.Append(KVersitTokenCRLF);
       
    60 //BASE 64
       
    61 	iVersit.Append(_L8("PHOTO;ENCODING=BASE64;TYPE=GIF:R0lGODdhfgA4AOYAAAAAAK+vr62trVIxa6WlpZ+fnzEpCEpzlAha/0Kc74+PjyGMSuecKRhrtX9/fzExORBSjCEYCGtra2NjYyF7nDGE50JrhAg51qWtOTl7vee1MWu150o5e3PO/3sxcwAx/4R7GBgQOcDAwFoAQt61hJyMGHuUSpRKIf8A/wAY54yMjHtz"));
       
    62 	iVersit.Append(KVersitTokenCRLF);
       
    63 	iVersit.Append(KVersitTokenCRLF); //BASE 64 (needs double CRLF)
       
    64 	iVersit.Append(_L8("BDAY:19950415"));
       
    65 	iVersit.Append(KVersitTokenCRLF);
       
    66 	iVersit.Append(_L8("BDAY:1995-04-15"));
       
    67 	iVersit.Append(KVersitTokenCRLF);
       
    68 	iVersit.Append(_L8("ADR;DOM;HOME:P.O. Box 1;Suite 1;Example Main Street;Any Town;Exampleshire;ZZ99 EXP;"));
       
    69 	iVersit.Append(KVersitTokenCRLF);
       
    70 	iVersit.Append(_L8("ADR;DOM;WORK;HOME;POSTAL:P.O. Box 1;;;Example Town;Exampleshire;ZZ99 EXP;"));
       
    71 	iVersit.Append(KVersitTokenCRLF);
       
    72 //QUOTED-P
       
    73 	iVersit.Append(_L8("LABEL;DOM;POSTAL;ENCODING=QUOTED-PRINTABLE:P. O. Box 456=0D=0A="));
       
    74 	iVersit.Append(KVersitTokenCRLF);
       
    75 	iVersit.Append(_L8("1 Example Road=0D=0A="));
       
    76 	iVersit.Append(KVersitTokenCRLF);
       
    77 	iVersit.Append(_L8("Any Town, Exampleshire ZZ99 EXP"));
       
    78 	iVersit.Append(KVersitTokenCRLF);
       
    79 	/*iVersit.Append(_L8("LABEL;INTL;PARCEL,ENCODING=QUOTED-PRINTABLE:Suite 101=0D=0A="));
       
    80 	iVersit.Append(KVersitTokenCRLF);
       
    81 	iVersit.Append(_L8("1 Example Street=0D=0A="));
       
    82 	iVersit.Append(KVersitTokenCRLF);
       
    83 	iVersit.Append(_L8("Any Town, Exampleshire;ZZ99 EXP=0D=0A="));
       
    84 	iVersit.Append(KVersitTokenCRLF);
       
    85 	iVersit.Append(_L8("U.S.A.")); 
       
    86 	iVersit.Append(KVersitTokenCRLF);*/
       
    87 	iVersit.Append(_L8("TEL;PREF;WORK;MSG;FAX:+44-7700-900-124"));
       
    88 	iVersit.Append(KVersitTokenCRLF);
       
    89 	iVersit.Append(_L8("TEL;WORK;HOME;VOICE;FAX:+44-7700-900-123"));
       
    90 	iVersit.Append(KVersitTokenCRLF);
       
    91 	iVersit.Append(_L8("EMAIL;INTERNET:name.example@symbianfoundation.test"));
       
    92 	iVersit.Append(KVersitTokenCRLF);
       
    93 	iVersit.Append(_L8("MAILER:ccMail 2.2"));
       
    94 	iVersit.Append(KVersitTokenCRLF);
       
    95 	iVersit.Append(_L8("TZ:-0500"));
       
    96 	iVersit.Append(KVersitTokenCRLF);
       
    97 	iVersit.Append(_L8("TZ:-08:00"));
       
    98 	iVersit.Append(KVersitTokenCRLF);
       
    99 	iVersit.Append(_L8("GEO:37.24,-17.87"));
       
   100 	iVersit.Append(KVersitTokenCRLF);
       
   101 	iVersit.Append(_L8("TITLE:V.P., Research and Development"));
       
   102 	iVersit.Append(KVersitTokenCRLF);
       
   103 	iVersit.Append(_L8("ROLE:Executive"));
       
   104 	iVersit.Append(KVersitTokenCRLF);
       
   105 //BASE 64
       
   106 	/*iVersit.Append(_L8("LOGO;ENCODING=BASE64;TYPE=GIF:R0lGODdhfgA4AOYAAAAAAK+vr62trVIxa6WlpZ+fnzEpCEpzlAha/0Kc74+PjyGMSuecKRhrtX9/fzExORBSjCEYCGtra2NjYyF7nDGE50JrhAg51qWtOTl7vee1MWu150o5e3PO/3sxcwAx/4R7GBgQOcDAwFoAQt61hJyMGHuUSpRKIf8A/wAY54yMjHtz..."));
       
   107 	iVersit.Append(KVersitTokenCRLF); */
       
   108 	
       
   109 //AGENT 
       
   110 	iVersit.Append(_L8("AGENT:"));
       
   111 	iVersit.Append(KVersitTokenCRLF);
       
   112 	iVersit.Append(_L8("BEGIN:VCARD"));
       
   113 	iVersit.Append(KVersitTokenCRLF);
       
   114 	iVersit.Append(_L8("VERSION:2.1"));
       
   115 	iVersit.Append(KVersitTokenCRLF);
       
   116 	iVersit.Append(_L8("N:Friday;Fred"));
       
   117 	iVersit.Append(KVersitTokenCRLF);
       
   118 	iVersit.Append(_L8("TEL;WORK;VOICE:+44-7700-900-009"));
       
   119 	iVersit.Append(KVersitTokenCRLF);
       
   120 	iVersit.Append(_L8("TEL;WORK;FAX:+44-7700-900-067"));
       
   121 	iVersit.Append(KVersitTokenCRLF);
       
   122 	iVersit.Append(_L8("UID:0-555-1"));
       
   123 	iVersit.Append(KVersitTokenCRLF);
       
   124 	iVersit.Append(_L8("END:VCARD"));
       
   125 	iVersit.Append(KVersitTokenCRLF);
       
   126 	
       
   127 	iVersit.Append(_L8("ORG:ABC, Inc.;Example State Division;Marketing"));
       
   128 	iVersit.Append(KVersitTokenCRLF);
       
   129 	 
       
   130 //QUOTED-P
       
   131 	iVersit.Append(_L8("NOTE;ENCODING=QUOTED-PRINTABLE:This facsimile machine if operational="));
       
   132 	iVersit.Append(KVersitTokenCRLF);
       
   133 	iVersit.Append(_L8("0830 to 1715 hours"));
       
   134 	iVersit.Append(KVersitTokenCRLF);
       
   135 
       
   136 	iVersit.Append(_L8("REV:19951031T222710"));
       
   137 	iVersit.Append(KVersitTokenCRLF);
       
   138 	iVersit.Append(_L8("REV:1995-10-31T22:27:10Z"));
       
   139 	iVersit.Append(KVersitTokenCRLF);
       
   140 	iVersit.Append(_L8("SOUND:JON Q PUBLIK"));
       
   141 	iVersit.Append(KVersitTokenCRLF);
       
   142 	iVersit.Append(_L8("SOUND;VALUE=URL:file///multimed/audio/jqpublic.wav"));
       
   143 	iVersit.Append(KVersitTokenCRLF);
       
   144 // BASE 64
       
   145 	/*iVersit.Append(_L8("SOUND;WAVE;BASE64:UklGRhAsAABXQVZFZm10IBAAAAABAAEAESsAABErAAABAAgAZGF0YesrAACAg4eCeXR4e3uAhoiIiYmKjIiDfnx5eX6CgoKEhYWDenV5fH6BhISGiIiDfHZ2eXt/hIiKjY2IhH12d3Vyc3uDiIiFf3l7fn18eXl+houFf319fnyAgHl5eoCIiISChIeAfnt2..."));*/
       
   146 	iVersit.Append(_L8("URL:http://abc.com/pub/directory/northam/jpublic.ecd"));
       
   147 	iVersit.Append(KVersitTokenCRLF);
       
   148 	iVersit.Append(_L8("VERSION:2.1"));
       
   149 	iVersit.Append(KVersitTokenCRLF);
       
   150 	iVersit.Append(_L8("X-ABC-VIDEO;MPEG2:http://lonestar.bubbas.org/billibob.mpg"));
       
   151 	iVersit.Append(KVersitTokenCRLF);
       
   152 	iVersit.Append(_L8("X-DL;X-DesignWorkGroup:List Item 1;List Item 2;List Item 3"));
       
   153 	iVersit.Append(KVersitTokenCRLF);
       
   154 	iVersit.Append(_L8("END:VCARD"));
       
   155 	iVersit.Append(KVersitTokenCRLF);
       
   156 	iVersit.Append(_L8("BEGIN:VCARD"));
       
   157 	iVersit.Append(KVersitTokenCRLF);
       
   158 	iVersit.Append(_L8("VERSION:2.1"));
       
   159 	iVersit.Append(KVersitTokenCRLF);
       
   160 	iVersit.Append(_L8("N:A;B;C;;."));
       
   161 	iVersit.Append(KVersitTokenCRLF);
       
   162 	iVersit.Append(_L8("TEL:1111"));
       
   163 	iVersit.Append(KVersitTokenCRLF);
       
   164 	iVersit.Append(_L8("END:VCARD"));
       
   165 	iVersit.Append(KVersitTokenCRLF);
       
   166 	}
       
   167 
       
   168 void CVCardTest::GetSampleVersit2L(TInt aContactId)
       
   169 	{
       
   170 	// this will delete the agent
       
   171 	iVersit.Zero();
       
   172 	iParser=CParserVCard::NewL();
       
   173 	iVersit.Append(_L8("BEGIN:VCARD"));
       
   174 	iVersit.Append(KVersitTokenCRLF);
       
   175 	iVersit.Append(_L8("VERSION:2.1"));
       
   176 	iVersit.Append(KVersitTokenCRLF);
       
   177 	TBuf<32> buf;
       
   178 	buf.Format(_L("UID:0-555-%d"),aContactId);
       
   179 	iVersit.Append(buf);
       
   180 	iVersit.Append(KVersitTokenCRLF);
       
   181 	iVersit.Append(_L8("END:VCARD"));
       
   182 	iVersit.Append(KVersitTokenCRLF);
       
   183 	}
       
   184 
       
   185 void CVCardTest::GetSampleVersit3L()
       
   186 	{
       
   187 	iParser=CParserVCard::NewL();
       
   188 	iVersit.Zero();
       
   189 	iVersit.Append(KVersitTokenCRLF);
       
   190 	iVersit.Append(_L8("     "));
       
   191 	iVersit.Append(KVersitTokenCRLF);
       
   192 	iVersit.Append(KVersitTokenCRLF);
       
   193 	iVersit.Append(_L8("     "));
       
   194 	iVersit.Append(_L8("BEGIN:VCARD"));
       
   195 	iVersit.Append(KVersitTokenCRLF);
       
   196 	iVersit.Append(KVersitTokenCRLF);
       
   197 	iVersit.Append(_L8("VERSION:2.1"));
       
   198 	iVersit.Append(KVersitTokenCRLF);
       
   199 	iVersit.Append(_L8("     "));
       
   200 	iVersit.Append(KVersitTokenCRLF);
       
   201 	iVersit.Append(_L8("TEL;HOME:+44-7700-900-006"));
       
   202 	iVersit.Append(KVersitTokenCRLF);
       
   203 	iVersit.Append(_L8("A.NOTE:This is my vacation home."));
       
   204 	iVersit.Append(KVersitTokenCRLF);
       
   205 	iVersit.Append(_L8("PHOTO:http://www.abc.com/dir_photos/my_photo.gif"));
       
   206 	iVersit.Append(KVersitTokenCRLF);
       
   207 	iVersit.Append(_L8("END:VCARD"));
       
   208 	iVersit.Append(KVersitTokenCRLF);
       
   209 //
       
   210 	iVersit.Append(_L8(" "));
       
   211 	iVersit.Append(KVersitTokenCRLF);
       
   212 	iVersit.Append(_L8("BEGIN:VCARD"));
       
   213 	iVersit.Append(KVersitTokenCRLF);
       
   214 	iVersit.Append(KVersitTokenCRLF);
       
   215 	iVersit.Append(_L8("VERSION:2.1"));
       
   216 	iVersit.Append(KVersitTokenCRLF);
       
   217 	iVersit.Append(_L8("     "));
       
   218 	iVersit.Append(KVersitTokenCRLF);
       
   219 	iVersit.Append(_L8("TEL;HOME:+44-7700-900-005"));
       
   220 	iVersit.Append(KVersitTokenCRLF);
       
   221 	iVersit.Append(_L8("TEL;WORK;VOICE:+44-7700-900-006"));
       
   222 	iVersit.Append(KVersitTokenCRLF);
       
   223 	iVersit.Append(_L8("END:VCARD"));
       
   224 	iVersit.Append(KVersitTokenCRLF);
       
   225 	}
       
   226