os/textandloc/charconvfw/charconvplugins/test/rtest/tsrc/main/t_charconvpluginserver.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 #include "t_charconvpluginserver.h"
    20 #include "t_big5.h"
    21 #include "t_cp949.h"
    22 #include "t_autodetect.h"
    23 #include "t_win1250.h"
    24 #include "t_win1251.h"
    25 #include "t_win1253.h"
    26 #include "t_win1254.h"
    27 #include "t_win1255.h"
    28 #include "t_win1256.h"
    29 #include "t_win1257.h"
    30 #include "t_win1258.h"
    31 #include "t_win874.h"
    32 #include "t_ucs2.h"
    33 #include "t_turkishsingle.h"
    34 #include "t_turkishlockingsingle.h"
    35 #include "t_turkishlocking.h"
    36 #include "t_tis_620.h"
    37 #include "t_spanishgsmsingle.h"
    38 #include "t_snm.h"
    39 #include "t_replacement.h"
    40 #include "t_portugueselockingsingle.h"
    41 #include "t_portugueselocking.h"
    42 #include "t_portuguesesingle.h"
    43 #include "t_iso8859x.h"
    44 #include "t_iscii.h"
    45 #include "t_gb2312.h"
    46 #include "t_gbk.h"
    47 #include "t_hz.h"
    48 #include "t_extendedsms.h"
    49 #include "t_koi8r.h"
    50 #include "t_koi8u.h"
    51 #include "t_gb18030.h"
    52 #include "t_multi_plugins.h"
    53 #include "t_generalforeign.h"
    54 #include "t_jis.h"
    55 #include "t_builtin.h"
    56 #include "t_j5_kddiau.h"
    57 #include "t_j5_docomo.h"
    58 #include "t_eucjpdirectmap.h"
    59 #include "t_shiftjisdirectmap.h"
    60 #include "t_eucjp_packed.h"
    61 #include "t_eucjp_packed_2.h"
    62 #include "t_iso2022jp.h"
    63 #include "t_iso2022jp_2.h"
    64 #include "t_iso2022jp1_2.h"
    65 #include "t_shiftjis_kddiau.h"
    66 #include "t_shiftjis_docomo.h"
    67 
    68 /* Path to the script
    69 
    70 c:\z:\t_TEF\t_TEF_All.script
    71 
    72 */
    73 
    74 _LIT(KServerName,"t_charconvpluginserver");
    75 
    76 CT_CharconvPluginsServer *CT_CharconvPluginsServer::NewL()
    77     {
    78 	CT_CharconvPluginsServer * server = new (ELeave) CT_CharconvPluginsServer();
    79     CleanupStack::PushL(server);
    80     server->StartL(KServerName);
    81     CleanupStack::Pop(server);
    82     return server;
    83     }
    84 
    85 
    86 LOCAL_C void MainL()
    87     {
    88 #if (defined __DATA_CAGING__)
    89     RProcess().DataCaging(RProcess::EDataCagingOn);
    90     RProcess().SecureApi(RProcess::ESecureApiOn);
    91 #endif
    92     CActiveScheduler* sched=NULL;
    93     sched=new(ELeave) CActiveScheduler;
    94     CActiveScheduler::Install(sched);
    95     CT_CharconvPluginsServer *server = NULL;
    96     TRAPD(err,server = CT_CharconvPluginsServer::NewL());
    97     if(!err)
    98         {
    99         // Sync with the client and enter the active scheduler
   100         RProcess::Rendezvous(KErrNone);
   101         sched->Start();
   102         }
   103     delete server;
   104     delete sched;
   105     }
   106 
   107 
   108 GLDEF_C TInt E32Main()
   109     {
   110     __UHEAP_MARK;
   111     CTrapCleanup* cleanup = CTrapCleanup::New();
   112     if(cleanup == NULL)
   113         {
   114         return KErrNoMemory;
   115         }
   116     TRAPD(err,MainL());
   117     // This if statement is here just to shut up RVCT, which would otherwise warn
   118     // that err was set but never used
   119     if (err)
   120         {
   121         err = KErrNone;
   122         }
   123     delete cleanup;
   124     __UHEAP_MARKEND;
   125     return KErrNone;
   126     }
   127 
   128 CTestStep *CT_CharconvPluginsServer::CreateTestStep(const TDesC& aStepName)
   129     {
   130     if(aStepName == KTestStep_T_BIG5)
   131         {
   132         return new CT_BIG5();
   133         }
   134     else if(aStepName == KTestStep_T_CP949)
   135         {
   136         return new CT_CP949();
   137         }
   138     else if(aStepName == KTestStep_T_AUTODETECT)
   139         {
   140         return new CT_AUTODETECT();
   141         }
   142     
   143     else if(aStepName == KTestStep_T_WIN1250)
   144         {
   145         return new CT_WIN1250();
   146         }
   147     else if(aStepName == KTestStep_T_WIN1251)
   148         {
   149         return new CT_WIN1251();
   150         }
   151     else if(aStepName == KTestStep_T_WIN1253)
   152         {
   153         return new CT_WIN1253();
   154         }
   155     else if(aStepName == KTestStep_T_WIN1254)
   156         {
   157         return new CT_WIN1254();
   158         }
   159     else if(aStepName == KTestStep_T_WIN1255)
   160         {
   161         return new CT_WIN1255();
   162         }
   163     else if(aStepName == KTestStep_T_WIN1256)
   164         {
   165         return new CT_WIN1256();
   166         }
   167     else if(aStepName == KTestStep_T_WIN1257)
   168         {
   169         return new CT_WIN1257();
   170         }
   171     else if(aStepName == KTestStep_T_WIN1258)
   172         {
   173         return new CT_WIN1258();
   174         }
   175     else if(aStepName == KTestStep_T_WIN874)
   176         {
   177         return new CT_WIN874();
   178         }
   179     else if(aStepName == KTestStep_T_UCS2)
   180         {
   181         return new CT_UCS2();
   182         }
   183     else if(aStepName == KTestStep_T_TURKISHSINGLE)
   184         {
   185         return new CT_TURKISHSINGLE();
   186         }
   187     else if(aStepName == KTestStep_T_TURKISHLOCKINGSINGLE)
   188         {
   189         return new CT_TURKISHLOCKINGSINGLE();
   190         }
   191     else if(aStepName == KTestStep_T_TURKISHLOCKING)
   192         {
   193         return new CT_TURKISHLOCKING();
   194         }
   195     else if(aStepName == KTestStep_T_TIS_620)
   196         {
   197         return new CT_TIS_620();
   198         }
   199     else if(aStepName == KTestStep_T_SPANISHGSMSINGLE)
   200         {
   201         return new CT_SPANISHGSMSINGLE();
   202         }
   203     else if(aStepName == KTestStep_T_SNM)
   204         {
   205         return new CT_SNM();
   206         }
   207     else if(aStepName == KTestStep_T_REPLACEMENT)
   208         {
   209         return new CT_REPLACEMENT();
   210         }
   211     else if(aStepName == KTestStep_T_PORTUGUESELOCKINGSINGLE)
   212         {
   213         return new CT_PORTUGUESELOCKINGSINGLE();
   214         }
   215     else if(aStepName == KTestStep_T_PORTUGUESELOCKING)
   216         {
   217         return new CT_PORTUGUESELOCKING();
   218         }
   219     else if(aStepName == KTestStep_T_PORTUGUESESINGLE)
   220         {
   221         return new CT_PORTUGUESESINGLE();
   222         }
   223     else if(aStepName == KTestStep_T_ISO8859X)
   224         {
   225         return new CT_ISO8859X();
   226         }
   227     else if(aStepName == KTestStep_T_ISCII)
   228         {
   229         return new CT_ISCII();
   230         }
   231     else if(aStepName == KTestStep_T_GB2312)
   232         {
   233         return new CT_GB2312();
   234         }
   235     else if(aStepName == KTestStep_T_GBK)
   236         {
   237         return new CT_GBK();
   238         }
   239     else if(aStepName == KTestStep_T_HZ)
   240         {
   241         return new CT_HZ();
   242         }
   243     else if(aStepName == KTestStep_T_EXTENDEDSMS)
   244         {
   245         return new CT_EXTENDEDSMS();
   246         }
   247     else if(aStepName == KTestStep_T_KOI8R)
   248         {
   249         return new CT_KOI8R();
   250         }
   251     else if(aStepName == KTestStep_T_KOI8U)
   252         {
   253         return new CT_KOI8U();
   254         }
   255     else if(aStepName == KTestStep_T_GB18030)
   256         {
   257         return new CT_GB18030();
   258         }
   259     else if(aStepName == KTestStep_T_MULTI_PLUGINS)
   260         {
   261         return new CT_MULTI_PLUGINS();
   262         }
   263     else if(aStepName == KTestStep_T_GENERALFOREIGN)
   264         {
   265         return new CT_GENERALFOREIGN();
   266         }
   267     else if(aStepName == KTestStep_T_JIS)
   268         {
   269         return new CT_JIS();
   270         }
   271     else if(aStepName == KTestStep_T_BUILTIN)
   272         {
   273         return new CT_BUILTIN();
   274         }
   275     else if(aStepName == KTestStep_T_J5_KDDIAU)
   276         {
   277         return new CT_J5_KDDIAU();
   278         }
   279     else if(aStepName == KTestStep_T_J5_DOCOMO)
   280         {
   281         return new CT_J5_DOCOMO();
   282         }
   283     else if(aStepName == KTestStep_T_EUCJPDIRECTMAP)
   284         {
   285         return new CT_EUCJPDIRECTMAP();
   286         }
   287     else if(aStepName == KTestStep_T_SHIFTJISDIRECTMAP)
   288         {
   289         return new CT_SHIFTJISDIRECTMAP();
   290         }
   291     else if(aStepName == KTestStep_T_EUCJP_PACKED)
   292         {
   293         return new CT_EUCJP_PACKED();
   294         }
   295     else if(aStepName == KTestStep_T_EUCJP_PACKED_2)
   296         {
   297         return new CT_EUCJP_PACKED_2();
   298         }
   299     else if(aStepName == KTestStep_T_ISO2022JP)
   300         {
   301         return new CT_ISO2022JP();
   302         }
   303     else if(aStepName == KTestStep_T_ISO2022JP_2)
   304         {
   305         return new CT_ISO2022JP_2();
   306         }
   307     else if(aStepName == KTestStep_T_ISO2022JP1_2)
   308         {
   309         return new CT_ISO2022JP1_2();
   310         }
   311     else if(aStepName == KTestStep_T_SHIFTJIS_KDDIAU)
   312         {
   313         return new CT_SHIFTJIS_KDDIAU();
   314         }
   315     else if(aStepName == KTestStep_T_SHIFTJIS_DOCOMO)
   316         {
   317         return new CT_SHIFTJIS_DOCOMO();
   318         }
   319     return NULL;
   320     }
   321