sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
#include "TETextServer.h"
|
sl@0
|
19 |
#include "T_FIELD1.h"
|
sl@0
|
20 |
#include "T_ROMAN.h"
|
sl@0
|
21 |
#include "T_STREAM.h"
|
sl@0
|
22 |
#include "T_RICHOOM.h"
|
sl@0
|
23 |
#include "TRTCOPY.h"
|
sl@0
|
24 |
#include "TRTCUSTM.h"
|
sl@0
|
25 |
#include "TTIMES1.h"
|
sl@0
|
26 |
#include "T_CONVRT.h"
|
sl@0
|
27 |
#include "T_CONVS.h"
|
sl@0
|
28 |
#include "T_CONVS1.h"
|
sl@0
|
29 |
#include "T_CPLAIN.h"
|
sl@0
|
30 |
#include "T_CUTPST.h"
|
sl@0
|
31 |
#include "T_FMT.h"
|
sl@0
|
32 |
#include "T_FMT1.h"
|
sl@0
|
33 |
#include "T_IMPORT.h"
|
sl@0
|
34 |
#include "T_INDTER.h"
|
sl@0
|
35 |
#include "T_LAYDOC.h"
|
sl@0
|
36 |
#include "T_PARSE_for_TEF.h"
|
sl@0
|
37 |
#include "T_PICRES.h"
|
sl@0
|
38 |
#include "T_RICH1A.h"
|
sl@0
|
39 |
#include "T_RTCLIP.h"
|
sl@0
|
40 |
#include "T_SCANDC.h"
|
sl@0
|
41 |
#include "T_STYLE.h"
|
sl@0
|
42 |
#include "T_TIMES.h"
|
sl@0
|
43 |
#include "T_TRAN.h"
|
sl@0
|
44 |
#include "TEtextDefect.h"
|
sl@0
|
45 |
|
sl@0
|
46 |
_LIT(KServerName, "TETextServer");
|
sl@0
|
47 |
|
sl@0
|
48 |
CTETextServer *CTETextServer::NewL()
|
sl@0
|
49 |
/**
|
sl@0
|
50 |
@return - Instance of the test server
|
sl@0
|
51 |
Same code for Secure and non-secure variants
|
sl@0
|
52 |
Called inside the MainL() function to create and start the
|
sl@0
|
53 |
CTestServer derived server.
|
sl@0
|
54 |
*/
|
sl@0
|
55 |
{
|
sl@0
|
56 |
CTETextServer * server = new (ELeave) CTETextServer();
|
sl@0
|
57 |
CleanupStack::PushL(server);
|
sl@0
|
58 |
// CServer base class call
|
sl@0
|
59 |
server->StartL(KServerName);
|
sl@0
|
60 |
CleanupStack::Pop(server);
|
sl@0
|
61 |
return server;
|
sl@0
|
62 |
}
|
sl@0
|
63 |
|
sl@0
|
64 |
|
sl@0
|
65 |
LOCAL_C void MainL()
|
sl@0
|
66 |
//
|
sl@0
|
67 |
// Secure variant
|
sl@0
|
68 |
// Much simpler, uses the new Rendezvous() call to sync with the client
|
sl@0
|
69 |
//
|
sl@0
|
70 |
{
|
sl@0
|
71 |
#if (defined __DATA_CAGING__)
|
sl@0
|
72 |
RProcess().DataCaging(RProcess::EDataCagingOn);
|
sl@0
|
73 |
RProcess().SecureApi(RProcess::ESecureApiOn);
|
sl@0
|
74 |
#endif
|
sl@0
|
75 |
CActiveScheduler* sched=NULL;
|
sl@0
|
76 |
sched=new(ELeave) CActiveScheduler;
|
sl@0
|
77 |
CActiveScheduler::Install(sched);
|
sl@0
|
78 |
CTETextServer *server = NULL;
|
sl@0
|
79 |
// Create the CTestServer derived server
|
sl@0
|
80 |
TRAPD(err,server = CTETextServer::NewL());
|
sl@0
|
81 |
if(!err)
|
sl@0
|
82 |
{
|
sl@0
|
83 |
// Sync with the client and enter the active scheduler
|
sl@0
|
84 |
RProcess::Rendezvous(KErrNone);
|
sl@0
|
85 |
sched->Start();
|
sl@0
|
86 |
}
|
sl@0
|
87 |
delete server;
|
sl@0
|
88 |
delete sched;
|
sl@0
|
89 |
}
|
sl@0
|
90 |
|
sl@0
|
91 |
/** @return - Standard Epoc error code on process exit
|
sl@0
|
92 |
Secure variant only
|
sl@0
|
93 |
Process entry point. Called by client using RProcess API
|
sl@0
|
94 |
*/
|
sl@0
|
95 |
GLDEF_C TInt E32Main()
|
sl@0
|
96 |
{
|
sl@0
|
97 |
__UHEAP_MARK;
|
sl@0
|
98 |
CTrapCleanup* cleanup = CTrapCleanup::New();
|
sl@0
|
99 |
if(cleanup == NULL)
|
sl@0
|
100 |
{
|
sl@0
|
101 |
return KErrNoMemory;
|
sl@0
|
102 |
}
|
sl@0
|
103 |
TRAPD(err,MainL());
|
sl@0
|
104 |
// This if statement is here just to shut up RVCT, which would otherwise warn
|
sl@0
|
105 |
// that err was set but never used
|
sl@0
|
106 |
if (err)
|
sl@0
|
107 |
{
|
sl@0
|
108 |
err = KErrNone;
|
sl@0
|
109 |
}
|
sl@0
|
110 |
delete cleanup;
|
sl@0
|
111 |
__UHEAP_MARKEND;
|
sl@0
|
112 |
return KErrNone;
|
sl@0
|
113 |
}
|
sl@0
|
114 |
|
sl@0
|
115 |
CTestStep *CTETextServer::CreateTestStep(const TDesC& aStepName)
|
sl@0
|
116 |
/**
|
sl@0
|
117 |
@return - A CTestStep derived instance
|
sl@0
|
118 |
Secure and non-secure variants
|
sl@0
|
119 |
Implementation of CTestServer pure virtual
|
sl@0
|
120 |
*/
|
sl@0
|
121 |
{
|
sl@0
|
122 |
if (aStepName == KTestStep_T_FIELD1)
|
sl@0
|
123 |
return new CT_FIELD1();
|
sl@0
|
124 |
else if (aStepName == KTestStep_T_ROMAN)
|
sl@0
|
125 |
return new CT_ROMAN();
|
sl@0
|
126 |
else if (aStepName == KTestStep_T_STREAM)
|
sl@0
|
127 |
return new CT_STREAM();
|
sl@0
|
128 |
else if (aStepName == KTestStep_T_RICHOOM)
|
sl@0
|
129 |
return new CT_RICHOOM();
|
sl@0
|
130 |
else if (aStepName == KTestStep_T_TRTCOPY)
|
sl@0
|
131 |
return new CT_TRTCOPY();
|
sl@0
|
132 |
else if (aStepName == KTestStep_T_TRTCUSTM)
|
sl@0
|
133 |
return new CT_TRTCUSTM();
|
sl@0
|
134 |
else if (aStepName == KTestStep_T_TTIMES1)
|
sl@0
|
135 |
return new CT_TTIMES1();
|
sl@0
|
136 |
else if (aStepName == KTestStep_T_CONVRT)
|
sl@0
|
137 |
return new CT_CONVRT();
|
sl@0
|
138 |
else if (aStepName == KTestStep_T_CONVS)
|
sl@0
|
139 |
return new CT_CONVS();
|
sl@0
|
140 |
else if (aStepName == KTestStep_T_CONVS1)
|
sl@0
|
141 |
return new CT_CONVS1();
|
sl@0
|
142 |
else if (aStepName == KTestStep_T_CPLAIN)
|
sl@0
|
143 |
return new CT_CPLAIN();
|
sl@0
|
144 |
else if (aStepName == KTestStep_T_CUTPST)
|
sl@0
|
145 |
return new CT_CUTPST();
|
sl@0
|
146 |
else if (aStepName == KTestStep_T_FMT)
|
sl@0
|
147 |
return new CT_FMT();
|
sl@0
|
148 |
else if (aStepName == KTestStep_T_FMT1)
|
sl@0
|
149 |
return new CT_FMT1();
|
sl@0
|
150 |
else if (aStepName == KTestStep_T_IMPORT)
|
sl@0
|
151 |
return new CT_IMPORT();
|
sl@0
|
152 |
else if (aStepName == KTestStep_T_INDTER)
|
sl@0
|
153 |
return new CT_INDTER();
|
sl@0
|
154 |
else if (aStepName == KTestStep_T_LAYDOC)
|
sl@0
|
155 |
return new CT_LAYDOC();
|
sl@0
|
156 |
else if (aStepName == KTestStep_T_PARSE)
|
sl@0
|
157 |
return new CT_PARSE();
|
sl@0
|
158 |
else if (aStepName == KTestStep_T_PICRES)
|
sl@0
|
159 |
return new CT_PICRES();
|
sl@0
|
160 |
else if (aStepName == KTestStep_T_RICH1A)
|
sl@0
|
161 |
return new CT_RICH1A();
|
sl@0
|
162 |
else if (aStepName == KTestStep_T_RTCLIP)
|
sl@0
|
163 |
return new CT_RTCLIP();
|
sl@0
|
164 |
else if (aStepName == KTestStep_T_SCANDC)
|
sl@0
|
165 |
return new CT_SCANDC();
|
sl@0
|
166 |
else if (aStepName == KTestStep_T_STYLE)
|
sl@0
|
167 |
return new CT_STYLE();
|
sl@0
|
168 |
else if (aStepName == KTestStep_T_TIMES)
|
sl@0
|
169 |
return new CT_TIMES();
|
sl@0
|
170 |
else if (aStepName == KTestStep_T_TRAN)
|
sl@0
|
171 |
return new CT_TRAN();
|
sl@0
|
172 |
else if (aStepName == KTestStep_TEtextDefect)
|
sl@0
|
173 |
return new CTEtextDefect();
|
sl@0
|
174 |
return NULL;
|
sl@0
|
175 |
}
|