|
1 /* |
|
2 * Copyright (c) 2002 - 2007 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: Test alfvisualhandlers.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // [INCLUDE FILES] |
|
20 #include "testalfext.h" |
|
21 #include "testalfvisualhandlers.h" |
|
22 |
|
23 // CONSTANTS |
|
24 const TInt KBufSize = 64; |
|
25 // ============================ MEMBER FUNCTIONS ========================= |
|
26 |
|
27 |
|
28 // -------------------------------------------------------------------------- |
|
29 // CTestAlfExt::TestVisualHandlerConstructL |
|
30 // -------------------------------------------------------------------------- |
|
31 // |
|
32 TInt CTestAlfExt::TestVisualHandlerConstructL( CStifItemParser& /*aItem*/ ) |
|
33 { |
|
34 _LIT(Kctestalfext, "CTestAlfExt"); |
|
35 _LIT(Ktestcalfvisualhandlernewl, "In TestCAlfVisualHandlerNewL"); |
|
36 TestModuleIf().Printf(0, Kctestalfext, Ktestcalfvisualhandlernewl); |
|
37 iLog->Log(Ktestcalfvisualhandlernewl); |
|
38 |
|
39 CAlfVisualHandler*handler = new ( ELeave ) CAlfVisualHandler( *iInterface ); |
|
40 CleanupStack::PushL(handler ); |
|
41 handler->ConstructL( iHuiVisual, *iHuiControl, NULL ); |
|
42 THuiInterfaceSupport interface = EAlfVisualHandler; |
|
43 TInt cmd = EAlfVisualEnableDropShadow; |
|
44 TBuf8<KBufSize> input; |
|
45 TBuf8<KBufSize> response; |
|
46 handler->GetInterface( interface ); |
|
47 handler->HandleCmdL( cmd, input, response ); |
|
48 handler->Release(); |
|
49 CleanupStack::Pop(handler ); |
|
50 handler = NULL; |
|
51 handler = static_cast<CAlfVisualHandler*> |
|
52 ( CAlfVisualHandler::NewL( *iInterface, iHuiControl, NULL ) ); |
|
53 CleanupStack::PushL(handler ); |
|
54 CleanupStack::PopAndDestroy(handler ); |
|
55 |
|
56 return KErrNone; |
|
57 } |
|
58 |
|
59 // -------------------------------------------------------------------------- |
|
60 // CTestAlfExt::TestVisualHandlerMutualL |
|
61 // -------------------------------------------------------------------------- |
|
62 // |
|
63 TInt CTestAlfExt::TestVisualHandlerMutualL( CStifItemParser& aItem ) |
|
64 { |
|
65 _LIT(Kctestalfext, "CTestAlfExt"); |
|
66 _LIT(Ktestcalfvisualhandlercalfvisualhandler, "In TestCAlfVisualHandlerCAlfVisualHandler"); |
|
67 TestModuleIf().Printf(0, Kctestalfext, Ktestcalfvisualhandlercalfvisualhandler); |
|
68 iLog->Log(Ktestcalfvisualhandlercalfvisualhandler); |
|
69 |
|
70 CTestCAlfVisualHandler*handler = new ( ELeave ) |
|
71 CTestCAlfVisualHandler( *iInterface ); |
|
72 CleanupStack::PushL(handler ); |
|
73 handler->ConstructL( iHuiVisual, *iHuiControl, NULL ); |
|
74 handler->TestProtected( aItem ); |
|
75 CleanupStack::Pop(handler ); |
|
76 |
|
77 return KErrNone; |
|
78 } |
|
79 |
|
80 |
|
81 // -------------------------------------------------------------------------- |
|
82 // CTestAlfExt::TestTextVisualHandlerConstructL |
|
83 // -------------------------------------------------------------------------- |
|
84 // |
|
85 TInt CTestAlfExt::TestTextVisualHandlerConstructL( CStifItemParser& /*aItem*/ ) |
|
86 { |
|
87 _LIT(Kctestalfext, "CTestAlfExt"); |
|
88 _LIT(Ktestcalfvisualhandlernewl, "In TestCAlfVisualHandlerNewL"); |
|
89 TestModuleIf().Printf(0, Kctestalfext, Ktestcalfvisualhandlernewl); |
|
90 iLog->Log(Ktestcalfvisualhandlernewl); |
|
91 |
|
92 CAlfTextVisualHandler*handler = new ( ELeave ) |
|
93 CAlfTextVisualHandler( *iInterface ); |
|
94 CleanupStack::PushL(handler ); |
|
95 handler->ConstructL( iHuiVisual, *iHuiControl, NULL ); |
|
96 THuiInterfaceSupport interface = EAlfVisualHandler; |
|
97 TInt cmd = EAlfTextVisualSetText; |
|
98 TBuf8<KBufSize> input; |
|
99 TBuf8<KBufSize> response; |
|
100 handler->GetInterface( interface ); |
|
101 handler->HandleCmdL( cmd, input, response ); |
|
102 handler->Release(); |
|
103 CleanupStack::Pop(handler ); |
|
104 handler = NULL; |
|
105 handler = static_cast<CAlfTextVisualHandler*> |
|
106 ( CAlfTextVisualHandler::NewL( *iInterface, iHuiControl, NULL ) ); |
|
107 CleanupStack::PushL(handler ); |
|
108 CleanupStack::PopAndDestroy(handler ); |
|
109 |
|
110 return KErrNone; |
|
111 } |
|
112 |
|
113 // -------------------------------------------------------------------------- |
|
114 // CTestAlfExt::TestTextVisualHandlerMutualL |
|
115 // -------------------------------------------------------------------------- |
|
116 // |
|
117 TInt CTestAlfExt::TestTextVisualHandlerMutualL( CStifItemParser& aItem ) |
|
118 { |
|
119 _LIT(Kctestalfext, "CTestAlfExt"); |
|
120 _LIT(Ktestcalfvisualhandlercalfvisualhandler, "In TestCAlfVisualHandlerCAlfVisualHandler"); |
|
121 TestModuleIf().Printf(0, Kctestalfext, Ktestcalfvisualhandlercalfvisualhandler); |
|
122 iLog->Log(Ktestcalfvisualhandlercalfvisualhandler); |
|
123 |
|
124 CTestCAlfTextVisualHandler*handler = new ( ELeave ) |
|
125 CTestCAlfTextVisualHandler( *iInterface ); |
|
126 CleanupStack::PushL(handler ); |
|
127 handler->ConstructL( iHuiVisual, *iHuiControl, NULL ); |
|
128 handler->TestProtected( aItem ); |
|
129 CleanupStack::Pop(handler ); |
|
130 |
|
131 return KErrNone; |
|
132 } |
|
133 |
|
134 // -------------------------------------------------------------------------- |
|
135 // CTestAlfExt::TestLCTTextVisualHandlerConstructL |
|
136 // -------------------------------------------------------------------------- |
|
137 // |
|
138 TInt CTestAlfExt::TestLCTTextVisualHandlerConstructL( CStifItemParser& /*aItem*/ ) |
|
139 { |
|
140 _LIT(Kctestalfext, "CTestAlfExt"); |
|
141 _LIT(Ktestcalfvisualhandlernewl, "In TestCAlfVisualHandlerNewL"); |
|
142 TestModuleIf().Printf(0, Kctestalfext, Ktestcalfvisualhandlernewl); |
|
143 iLog->Log(Ktestcalfvisualhandlernewl); |
|
144 |
|
145 CAlfLCTTextVisualHandler*handler = new ( ELeave ) |
|
146 CAlfLCTTextVisualHandler( *iInterface ); |
|
147 CleanupStack::PushL(handler ); |
|
148 handler->ConstructL( iHuiVisual, *iHuiControl, NULL ); |
|
149 THuiInterfaceSupport interface = EAlfVisualHandler; |
|
150 TInt cmd = EAlfTextVisualSetText; |
|
151 TBuf8<KBufSize> input; |
|
152 TBuf8<KBufSize> response; |
|
153 handler->GetInterface( interface ); |
|
154 handler->HandleCmdL( cmd, input, response ); |
|
155 handler->Release(); |
|
156 CleanupStack::Pop(handler ); |
|
157 handler = NULL; |
|
158 handler = static_cast<CAlfLCTTextVisualHandler*> |
|
159 ( CAlfLCTTextVisualHandler::NewL( *iInterface, iHuiControl, NULL ) ); |
|
160 CleanupStack::PushL(handler ); |
|
161 CleanupStack::PopAndDestroy(handler ); |
|
162 |
|
163 return KErrNone; |
|
164 } |
|
165 |
|
166 // -------------------------------------------------------------------------- |
|
167 // CTestAlfExt::TestLCTTextVisualHandlerMutualL |
|
168 // -------------------------------------------------------------------------- |
|
169 // |
|
170 TInt CTestAlfExt::TestLCTTextVisualHandlerMutualL( CStifItemParser& aItem ) |
|
171 { |
|
172 _LIT(Kctestalfext, "CTestAlfExt"); |
|
173 _LIT(Ktestcalfvisualhandlercalfvisualhandler, "In TestCAlfVisualHandlerCAlfVisualHandler"); |
|
174 TestModuleIf().Printf(0, Kctestalfext, Ktestcalfvisualhandlercalfvisualhandler); |
|
175 iLog->Log(Ktestcalfvisualhandlercalfvisualhandler); |
|
176 |
|
177 CTestCAlfLCTTextVisualHandler*handler = new ( ELeave ) |
|
178 CTestCAlfLCTTextVisualHandler( *iInterface ); |
|
179 CleanupStack::PushL(handler ); |
|
180 handler->ConstructL( iHuiVisual, *iHuiControl, NULL ); |
|
181 handler->TestProtected( aItem ); |
|
182 CleanupStack::Pop(handler ); |
|
183 |
|
184 return KErrNone; |
|
185 } |
|
186 |
|
187 // -------------------------------------------------------------------------- |
|
188 // CTestAlfExt::TestImageVisualHandlerConstructL |
|
189 // -------------------------------------------------------------------------- |
|
190 // |
|
191 TInt CTestAlfExt::TestImageVisualHandlerConstructL( CStifItemParser& /*aItem*/ ) |
|
192 { |
|
193 _LIT(Kctestalfext, "CTestAlfExt"); |
|
194 _LIT(Ktestcalfvisualhandlernewl, "In TestCAlfVisualHandlerNewL"); |
|
195 TestModuleIf().Printf(0, Kctestalfext, Ktestcalfvisualhandlernewl); |
|
196 iLog->Log(Ktestcalfvisualhandlernewl); |
|
197 |
|
198 CAlfImageVisualHandler*handler = new ( ELeave ) |
|
199 CAlfImageVisualHandler( *iInterface ); |
|
200 CleanupStack::PushL(handler ); |
|
201 handler->ConstructL( iHuiVisual, *iHuiControl, NULL ); |
|
202 THuiInterfaceSupport interface = EAlfVisualHandler; |
|
203 TInt cmd = EAlfImageVisualSetOffset; |
|
204 TBuf8<KBufSize> input; |
|
205 TBuf8<KBufSize> response; |
|
206 handler->GetInterface( interface ); |
|
207 handler->HandleCmdL( cmd, input, response ); |
|
208 handler->Release(); |
|
209 CleanupStack::Pop(handler ); |
|
210 handler = NULL; |
|
211 handler = static_cast<CAlfImageVisualHandler*> |
|
212 ( CAlfImageVisualHandler::NewL( *iInterface, iHuiControl, NULL ) ); |
|
213 CleanupStack::PushL(handler ); |
|
214 CleanupStack::PopAndDestroy(handler ); |
|
215 |
|
216 return KErrNone; |
|
217 } |
|
218 |
|
219 // -------------------------------------------------------------------------- |
|
220 // CTestAlfExt::TestImageVisualHandlerMutualL |
|
221 // -------------------------------------------------------------------------- |
|
222 // |
|
223 TInt CTestAlfExt::TestImageVisualHandlerMutualL( CStifItemParser& aItem ) |
|
224 { |
|
225 _LIT(Kctestalfext, "CTestAlfExt"); |
|
226 _LIT(Ktestcalfvisualhandlercalfvisualhandler, "In TestCAlfVisualHandlerCAlfVisualHandler"); |
|
227 TestModuleIf().Printf(0, Kctestalfext, Ktestcalfvisualhandlercalfvisualhandler); |
|
228 iLog->Log(Ktestcalfvisualhandlercalfvisualhandler); |
|
229 |
|
230 CTestCAlfImageVisualHandler*handler = new ( ELeave ) |
|
231 CTestCAlfImageVisualHandler( *iInterface ); |
|
232 CleanupStack::PushL(handler ); |
|
233 handler->ConstructL( iHuiVisual, *iHuiControl, NULL ); |
|
234 handler->TestProtected( aItem ); |
|
235 CleanupStack::Pop(handler ); |
|
236 |
|
237 return KErrNone; |
|
238 } |
|
239 |
|
240 |
|
241 // -------------------------------------------------------------------------- |
|
242 // CTestAlfExt::TestLineVisualHandlerConstructL |
|
243 // -------------------------------------------------------------------------- |
|
244 // |
|
245 TInt CTestAlfExt::TestLineVisualHandlerConstructL( CStifItemParser& /*aItem*/ ) |
|
246 { |
|
247 _LIT(Kctestalfext, "CTestAlfExt"); |
|
248 _LIT(Ktestcalfvisualhandlernewl, "In TestCAlfVisualHandlerNewL"); |
|
249 TestModuleIf().Printf(0, Kctestalfext, Ktestcalfvisualhandlernewl); |
|
250 iLog->Log(Ktestcalfvisualhandlernewl); |
|
251 |
|
252 CAlfLineVisualHandler*handler = new ( ELeave ) |
|
253 CAlfLineVisualHandler( *iInterface ); |
|
254 CleanupStack::PushL(handler ); |
|
255 handler->ConstructL( iHuiVisual, *iHuiControl, NULL ); |
|
256 THuiInterfaceSupport interface = EAlfVisualHandler; |
|
257 TInt cmd = EAlfVisualSetSize; |
|
258 TBuf8<KBufSize> input; |
|
259 TBuf8<KBufSize> response; |
|
260 handler->GetInterface( interface ); |
|
261 handler->HandleCmdL( cmd, input, response ); |
|
262 handler->Release(); |
|
263 CleanupStack::Pop(handler ); |
|
264 handler = NULL; |
|
265 handler = static_cast<CAlfLineVisualHandler*> |
|
266 ( CAlfLineVisualHandler::NewL( *iInterface, iHuiControl, NULL ) ); |
|
267 CleanupStack::PushL(handler ); |
|
268 CleanupStack::PopAndDestroy(handler ); |
|
269 |
|
270 return KErrNone; |
|
271 } |
|
272 |
|
273 // -------------------------------------------------------------------------- |
|
274 // CTestAlfExt::TestLineVisualHandlerMutualL |
|
275 // -------------------------------------------------------------------------- |
|
276 // |
|
277 TInt CTestAlfExt::TestLineVisualHandlerMutualL( CStifItemParser& aItem ) |
|
278 { |
|
279 _LIT(Kctestalfext, "CTestAlfExt"); |
|
280 _LIT(Ktestcalfvisualhandlercalfvisualhandler, "In TestCAlfVisualHandlerCAlfVisualHandler"); |
|
281 TestModuleIf().Printf(0, Kctestalfext, Ktestcalfvisualhandlercalfvisualhandler); |
|
282 iLog->Log(Ktestcalfvisualhandlercalfvisualhandler); |
|
283 |
|
284 CTestCAlfLineVisualHandler*handler = new ( ELeave ) |
|
285 CTestCAlfLineVisualHandler( *iInterface ); |
|
286 CleanupStack::PushL(handler ); |
|
287 handler->ConstructL( iHuiVisual, *iHuiControl, NULL ); |
|
288 handler->TestProtected( aItem ); |
|
289 CleanupStack::Pop(handler ); |
|
290 |
|
291 return KErrNone; |
|
292 } |
|
293 |
|
294 // -------------------------------------------------------------------------- |
|
295 // CTestAlfExt::TestMeshVisualHandlerConstructL |
|
296 // -------------------------------------------------------------------------- |
|
297 // |
|
298 TInt CTestAlfExt::TestMeshVisualHandlerConstructL( CStifItemParser& /*aItem*/ ) |
|
299 { |
|
300 _LIT(Kctestalfext, "CTestAlfExt"); |
|
301 _LIT(Ktestcalfvisualhandlernewl, "In TestCAlfVisualHandlerNewL"); |
|
302 TestModuleIf().Printf(0, Kctestalfext, Ktestcalfvisualhandlernewl); |
|
303 iLog->Log(Ktestcalfvisualhandlernewl); |
|
304 |
|
305 CAlfMeshVisualHandler*handler = new ( ELeave ) |
|
306 CAlfMeshVisualHandler( *iInterface ); |
|
307 CleanupStack::PushL(handler ); |
|
308 handler->ConstructL( iHuiVisual, *iHuiControl, EHuiMeshTypeM3G, NULL ); |
|
309 THuiInterfaceSupport interface = EAlfVisualHandler; |
|
310 TInt cmd = EAlfVisualSetSize; |
|
311 TBuf8<KBufSize> input; |
|
312 TBuf8<KBufSize> response; |
|
313 handler->GetInterface( interface ); |
|
314 handler->HandleCmdL( cmd, input, response ); |
|
315 handler->Release(); |
|
316 CleanupStack::Pop(handler ); |
|
317 handler = NULL; |
|
318 handler = static_cast<CAlfMeshVisualHandler*> |
|
319 ( CAlfMeshVisualHandler::NewL( *iInterface, iHuiControl, |
|
320 EHuiMeshTypeM3G, NULL ) ); |
|
321 CleanupStack::PushL(handler ); |
|
322 handler->Release(); |
|
323 CleanupStack::Pop(handler ); |
|
324 |
|
325 return KErrNone; |
|
326 } |
|
327 |
|
328 // -------------------------------------------------------------------------- |
|
329 // CTestAlfExt::TestMeshVisualHandlerMutualL |
|
330 // -------------------------------------------------------------------------- |
|
331 // |
|
332 TInt CTestAlfExt::TestMeshVisualHandlerMutualL( CStifItemParser& aItem ) |
|
333 { |
|
334 _LIT(Kctestalfext, "CTestAlfExt"); |
|
335 _LIT(Ktestcalfvisualhandlercalfvisualhandler, "In TestCAlfVisualHandlerCAlfVisualHandler"); |
|
336 TestModuleIf().Printf(0, Kctestalfext, Ktestcalfvisualhandlercalfvisualhandler); |
|
337 iLog->Log(Ktestcalfvisualhandlercalfvisualhandler); |
|
338 |
|
339 CTestCAlfMeshVisualHandler*handler = new ( ELeave ) |
|
340 CTestCAlfMeshVisualHandler( *iInterface ); |
|
341 CleanupStack::PushL(handler ); |
|
342 handler->ConstructL( iHuiVisual, *iHuiControl, EHuiMeshTypeM3G, NULL ); |
|
343 handler->TestProtected( aItem ); |
|
344 CleanupStack::Pop(handler ); |
|
345 |
|
346 return KErrNone; |
|
347 } |
|
348 // End of file |
|
349 |
|
350 |