os/textandloc/charconvfw/charconvplugins/test/rtest/tsrc/main/t_charconvpluginserver.cpp
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/textandloc/charconvfw/charconvplugins/test/rtest/tsrc/main/t_charconvpluginserver.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,321 @@
1.4 +/*
1.5 +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#include "t_charconvpluginserver.h"
1.23 +#include "t_big5.h"
1.24 +#include "t_cp949.h"
1.25 +#include "t_autodetect.h"
1.26 +#include "t_win1250.h"
1.27 +#include "t_win1251.h"
1.28 +#include "t_win1253.h"
1.29 +#include "t_win1254.h"
1.30 +#include "t_win1255.h"
1.31 +#include "t_win1256.h"
1.32 +#include "t_win1257.h"
1.33 +#include "t_win1258.h"
1.34 +#include "t_win874.h"
1.35 +#include "t_ucs2.h"
1.36 +#include "t_turkishsingle.h"
1.37 +#include "t_turkishlockingsingle.h"
1.38 +#include "t_turkishlocking.h"
1.39 +#include "t_tis_620.h"
1.40 +#include "t_spanishgsmsingle.h"
1.41 +#include "t_snm.h"
1.42 +#include "t_replacement.h"
1.43 +#include "t_portugueselockingsingle.h"
1.44 +#include "t_portugueselocking.h"
1.45 +#include "t_portuguesesingle.h"
1.46 +#include "t_iso8859x.h"
1.47 +#include "t_iscii.h"
1.48 +#include "t_gb2312.h"
1.49 +#include "t_gbk.h"
1.50 +#include "t_hz.h"
1.51 +#include "t_extendedsms.h"
1.52 +#include "t_koi8r.h"
1.53 +#include "t_koi8u.h"
1.54 +#include "t_gb18030.h"
1.55 +#include "t_multi_plugins.h"
1.56 +#include "t_generalforeign.h"
1.57 +#include "t_jis.h"
1.58 +#include "t_builtin.h"
1.59 +#include "t_j5_kddiau.h"
1.60 +#include "t_j5_docomo.h"
1.61 +#include "t_eucjpdirectmap.h"
1.62 +#include "t_shiftjisdirectmap.h"
1.63 +#include "t_eucjp_packed.h"
1.64 +#include "t_eucjp_packed_2.h"
1.65 +#include "t_iso2022jp.h"
1.66 +#include "t_iso2022jp_2.h"
1.67 +#include "t_iso2022jp1_2.h"
1.68 +#include "t_shiftjis_kddiau.h"
1.69 +#include "t_shiftjis_docomo.h"
1.70 +
1.71 +/* Path to the script
1.72 +
1.73 +c:\z:\t_TEF\t_TEF_All.script
1.74 +
1.75 +*/
1.76 +
1.77 +_LIT(KServerName,"t_charconvpluginserver");
1.78 +
1.79 +CT_CharconvPluginsServer *CT_CharconvPluginsServer::NewL()
1.80 + {
1.81 + CT_CharconvPluginsServer * server = new (ELeave) CT_CharconvPluginsServer();
1.82 + CleanupStack::PushL(server);
1.83 + server->StartL(KServerName);
1.84 + CleanupStack::Pop(server);
1.85 + return server;
1.86 + }
1.87 +
1.88 +
1.89 +LOCAL_C void MainL()
1.90 + {
1.91 +#if (defined __DATA_CAGING__)
1.92 + RProcess().DataCaging(RProcess::EDataCagingOn);
1.93 + RProcess().SecureApi(RProcess::ESecureApiOn);
1.94 +#endif
1.95 + CActiveScheduler* sched=NULL;
1.96 + sched=new(ELeave) CActiveScheduler;
1.97 + CActiveScheduler::Install(sched);
1.98 + CT_CharconvPluginsServer *server = NULL;
1.99 + TRAPD(err,server = CT_CharconvPluginsServer::NewL());
1.100 + if(!err)
1.101 + {
1.102 + // Sync with the client and enter the active scheduler
1.103 + RProcess::Rendezvous(KErrNone);
1.104 + sched->Start();
1.105 + }
1.106 + delete server;
1.107 + delete sched;
1.108 + }
1.109 +
1.110 +
1.111 +GLDEF_C TInt E32Main()
1.112 + {
1.113 + __UHEAP_MARK;
1.114 + CTrapCleanup* cleanup = CTrapCleanup::New();
1.115 + if(cleanup == NULL)
1.116 + {
1.117 + return KErrNoMemory;
1.118 + }
1.119 + TRAPD(err,MainL());
1.120 + // This if statement is here just to shut up RVCT, which would otherwise warn
1.121 + // that err was set but never used
1.122 + if (err)
1.123 + {
1.124 + err = KErrNone;
1.125 + }
1.126 + delete cleanup;
1.127 + __UHEAP_MARKEND;
1.128 + return KErrNone;
1.129 + }
1.130 +
1.131 +CTestStep *CT_CharconvPluginsServer::CreateTestStep(const TDesC& aStepName)
1.132 + {
1.133 + if(aStepName == KTestStep_T_BIG5)
1.134 + {
1.135 + return new CT_BIG5();
1.136 + }
1.137 + else if(aStepName == KTestStep_T_CP949)
1.138 + {
1.139 + return new CT_CP949();
1.140 + }
1.141 + else if(aStepName == KTestStep_T_AUTODETECT)
1.142 + {
1.143 + return new CT_AUTODETECT();
1.144 + }
1.145 +
1.146 + else if(aStepName == KTestStep_T_WIN1250)
1.147 + {
1.148 + return new CT_WIN1250();
1.149 + }
1.150 + else if(aStepName == KTestStep_T_WIN1251)
1.151 + {
1.152 + return new CT_WIN1251();
1.153 + }
1.154 + else if(aStepName == KTestStep_T_WIN1253)
1.155 + {
1.156 + return new CT_WIN1253();
1.157 + }
1.158 + else if(aStepName == KTestStep_T_WIN1254)
1.159 + {
1.160 + return new CT_WIN1254();
1.161 + }
1.162 + else if(aStepName == KTestStep_T_WIN1255)
1.163 + {
1.164 + return new CT_WIN1255();
1.165 + }
1.166 + else if(aStepName == KTestStep_T_WIN1256)
1.167 + {
1.168 + return new CT_WIN1256();
1.169 + }
1.170 + else if(aStepName == KTestStep_T_WIN1257)
1.171 + {
1.172 + return new CT_WIN1257();
1.173 + }
1.174 + else if(aStepName == KTestStep_T_WIN1258)
1.175 + {
1.176 + return new CT_WIN1258();
1.177 + }
1.178 + else if(aStepName == KTestStep_T_WIN874)
1.179 + {
1.180 + return new CT_WIN874();
1.181 + }
1.182 + else if(aStepName == KTestStep_T_UCS2)
1.183 + {
1.184 + return new CT_UCS2();
1.185 + }
1.186 + else if(aStepName == KTestStep_T_TURKISHSINGLE)
1.187 + {
1.188 + return new CT_TURKISHSINGLE();
1.189 + }
1.190 + else if(aStepName == KTestStep_T_TURKISHLOCKINGSINGLE)
1.191 + {
1.192 + return new CT_TURKISHLOCKINGSINGLE();
1.193 + }
1.194 + else if(aStepName == KTestStep_T_TURKISHLOCKING)
1.195 + {
1.196 + return new CT_TURKISHLOCKING();
1.197 + }
1.198 + else if(aStepName == KTestStep_T_TIS_620)
1.199 + {
1.200 + return new CT_TIS_620();
1.201 + }
1.202 + else if(aStepName == KTestStep_T_SPANISHGSMSINGLE)
1.203 + {
1.204 + return new CT_SPANISHGSMSINGLE();
1.205 + }
1.206 + else if(aStepName == KTestStep_T_SNM)
1.207 + {
1.208 + return new CT_SNM();
1.209 + }
1.210 + else if(aStepName == KTestStep_T_REPLACEMENT)
1.211 + {
1.212 + return new CT_REPLACEMENT();
1.213 + }
1.214 + else if(aStepName == KTestStep_T_PORTUGUESELOCKINGSINGLE)
1.215 + {
1.216 + return new CT_PORTUGUESELOCKINGSINGLE();
1.217 + }
1.218 + else if(aStepName == KTestStep_T_PORTUGUESELOCKING)
1.219 + {
1.220 + return new CT_PORTUGUESELOCKING();
1.221 + }
1.222 + else if(aStepName == KTestStep_T_PORTUGUESESINGLE)
1.223 + {
1.224 + return new CT_PORTUGUESESINGLE();
1.225 + }
1.226 + else if(aStepName == KTestStep_T_ISO8859X)
1.227 + {
1.228 + return new CT_ISO8859X();
1.229 + }
1.230 + else if(aStepName == KTestStep_T_ISCII)
1.231 + {
1.232 + return new CT_ISCII();
1.233 + }
1.234 + else if(aStepName == KTestStep_T_GB2312)
1.235 + {
1.236 + return new CT_GB2312();
1.237 + }
1.238 + else if(aStepName == KTestStep_T_GBK)
1.239 + {
1.240 + return new CT_GBK();
1.241 + }
1.242 + else if(aStepName == KTestStep_T_HZ)
1.243 + {
1.244 + return new CT_HZ();
1.245 + }
1.246 + else if(aStepName == KTestStep_T_EXTENDEDSMS)
1.247 + {
1.248 + return new CT_EXTENDEDSMS();
1.249 + }
1.250 + else if(aStepName == KTestStep_T_KOI8R)
1.251 + {
1.252 + return new CT_KOI8R();
1.253 + }
1.254 + else if(aStepName == KTestStep_T_KOI8U)
1.255 + {
1.256 + return new CT_KOI8U();
1.257 + }
1.258 + else if(aStepName == KTestStep_T_GB18030)
1.259 + {
1.260 + return new CT_GB18030();
1.261 + }
1.262 + else if(aStepName == KTestStep_T_MULTI_PLUGINS)
1.263 + {
1.264 + return new CT_MULTI_PLUGINS();
1.265 + }
1.266 + else if(aStepName == KTestStep_T_GENERALFOREIGN)
1.267 + {
1.268 + return new CT_GENERALFOREIGN();
1.269 + }
1.270 + else if(aStepName == KTestStep_T_JIS)
1.271 + {
1.272 + return new CT_JIS();
1.273 + }
1.274 + else if(aStepName == KTestStep_T_BUILTIN)
1.275 + {
1.276 + return new CT_BUILTIN();
1.277 + }
1.278 + else if(aStepName == KTestStep_T_J5_KDDIAU)
1.279 + {
1.280 + return new CT_J5_KDDIAU();
1.281 + }
1.282 + else if(aStepName == KTestStep_T_J5_DOCOMO)
1.283 + {
1.284 + return new CT_J5_DOCOMO();
1.285 + }
1.286 + else if(aStepName == KTestStep_T_EUCJPDIRECTMAP)
1.287 + {
1.288 + return new CT_EUCJPDIRECTMAP();
1.289 + }
1.290 + else if(aStepName == KTestStep_T_SHIFTJISDIRECTMAP)
1.291 + {
1.292 + return new CT_SHIFTJISDIRECTMAP();
1.293 + }
1.294 + else if(aStepName == KTestStep_T_EUCJP_PACKED)
1.295 + {
1.296 + return new CT_EUCJP_PACKED();
1.297 + }
1.298 + else if(aStepName == KTestStep_T_EUCJP_PACKED_2)
1.299 + {
1.300 + return new CT_EUCJP_PACKED_2();
1.301 + }
1.302 + else if(aStepName == KTestStep_T_ISO2022JP)
1.303 + {
1.304 + return new CT_ISO2022JP();
1.305 + }
1.306 + else if(aStepName == KTestStep_T_ISO2022JP_2)
1.307 + {
1.308 + return new CT_ISO2022JP_2();
1.309 + }
1.310 + else if(aStepName == KTestStep_T_ISO2022JP1_2)
1.311 + {
1.312 + return new CT_ISO2022JP1_2();
1.313 + }
1.314 + else if(aStepName == KTestStep_T_SHIFTJIS_KDDIAU)
1.315 + {
1.316 + return new CT_SHIFTJIS_KDDIAU();
1.317 + }
1.318 + else if(aStepName == KTestStep_T_SHIFTJIS_DOCOMO)
1.319 + {
1.320 + return new CT_SHIFTJIS_DOCOMO();
1.321 + }
1.322 + return NULL;
1.323 + }
1.324 +