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 api of alf_core_toolkit |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] |
|
21 #include <e32svr.h> |
|
22 #include <stifparser.h> |
|
23 #include <stiftestinterface.h> |
|
24 #include <uiacceltk/huilayout.h> |
|
25 #include <uiacceltk/huienv.h> |
|
26 #include <uiacceltk/huicontrol.h> |
|
27 #include <uiacceltk/huigc.h> |
|
28 #include <uiacceltk/huiskin.h> |
|
29 #include <uiacceltk/huistatic.h> |
|
30 |
|
31 #include "testuiaifcoretoolkit.h" |
|
32 |
|
33 _LIT( KName, "instance" ); |
|
34 |
|
35 class CHuiLayoutExt : public CHuiLayout |
|
36 { |
|
37 friend class CTestUiAifCoreToolkit; |
|
38 |
|
39 public: |
|
40 CHuiLayoutExt( MHuiVisualOwner& aOwner ) : CHuiLayout( aOwner ) |
|
41 { |
|
42 } |
|
43 |
|
44 }; |
|
45 |
|
46 // ----------------------------------------------------------------------------- |
|
47 // CTestUiAifCoreToolkit::TestCHuiLayoutAddNewL |
|
48 // ----------------------------------------------------------------------------- |
|
49 // |
|
50 TInt CTestUiAifCoreToolkit::TestCHuiLayoutAddNewL( CStifItemParser& /*aItem*/ ) |
|
51 { |
|
52 |
|
53 // Print to UI |
|
54 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
55 _LIT( KTestCHuiLayout, "In TestCHuiLayoutAddNewL" ); |
|
56 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
57 // Print to log file |
|
58 iLog->Log( KTestCHuiLayout ); |
|
59 |
|
60 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
61 STIF_ASSERT_NOT_NULL( layout ); |
|
62 |
|
63 return KErrNone; |
|
64 } |
|
65 |
|
66 // ----------------------------------------------------------------------------- |
|
67 // CTestUiAifCoreToolkit::TestCHuiLayoutConstructorL |
|
68 // ----------------------------------------------------------------------------- |
|
69 // |
|
70 TInt CTestUiAifCoreToolkit::TestCHuiLayoutConstructorL( CStifItemParser& /*aItem*/ ) |
|
71 { |
|
72 |
|
73 // Print to UI |
|
74 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
75 _LIT( KTestCHuiLayout, "In TestCHuiLayoutConstructorL" ); |
|
76 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
77 // Print to log file |
|
78 iLog->Log( KTestCHuiLayout ); |
|
79 |
|
80 CHuiLayout* layout = new( ELeave ) CHuiLayout( *iHuiControl ); |
|
81 STIF_ASSERT_NOT_NULL( layout ); |
|
82 |
|
83 return KErrNone; |
|
84 } |
|
85 |
|
86 // ----------------------------------------------------------------------------- |
|
87 // CTestUiAifCoreToolkit::TestCHuiLayoutDestructorL |
|
88 // ----------------------------------------------------------------------------- |
|
89 // |
|
90 TInt CTestUiAifCoreToolkit::TestCHuiLayoutDestructorL( CStifItemParser& /*aItem*/ ) |
|
91 { |
|
92 |
|
93 // Print to UI |
|
94 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
95 _LIT( KTestCHuiLayout, "In TestCHuiLayoutDestructorL" ); |
|
96 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
97 // Print to log file |
|
98 iLog->Log( KTestCHuiLayout ); |
|
99 |
|
100 CHuiLayout* layout = new( ELeave ) CHuiLayout( *iHuiControl ); |
|
101 STIF_ASSERT_NOT_NULL( layout ); |
|
102 |
|
103 return KErrNone; |
|
104 } |
|
105 |
|
106 // ----------------------------------------------------------------------------- |
|
107 // CTestUiAifCoreToolkit::TestCHuiLayoutConstructL |
|
108 // ----------------------------------------------------------------------------- |
|
109 // |
|
110 TInt CTestUiAifCoreToolkit::TestCHuiLayoutConstructL( CStifItemParser& /*aItem*/ ) |
|
111 { |
|
112 |
|
113 // Print to UI |
|
114 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
115 _LIT( KTestCHuiLayout, "In TestCHuiLayoutConstructL" ); |
|
116 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
117 // Print to log file |
|
118 iLog->Log( KTestCHuiLayout ); |
|
119 |
|
120 CHuiLayout* layout = new( ELeave ) CHuiLayout( *iHuiControl ); |
|
121 STIF_ASSERT_NOT_NULL( layout ); |
|
122 layout->ConstructL(); |
|
123 |
|
124 return KErrNone; |
|
125 } |
|
126 |
|
127 // ----------------------------------------------------------------------------- |
|
128 // CTestUiAifCoreToolkit::TestCHuiLayoutRemoveAndDestroyAllDL |
|
129 // ----------------------------------------------------------------------------- |
|
130 // |
|
131 TInt CTestUiAifCoreToolkit::TestCHuiLayoutRemoveAndDestroyAllDL( CStifItemParser& /*aItem*/ ) |
|
132 { |
|
133 |
|
134 // Print to UI |
|
135 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
136 _LIT( KTestCHuiLayout, "In TestCHuiLayoutRemoveAndDestroyAllDL" ); |
|
137 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
138 // Print to log file |
|
139 iLog->Log( KTestCHuiLayout ); |
|
140 |
|
141 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
142 STIF_ASSERT_NOT_NULL( layout ); |
|
143 layout->RemoveAndDestroyAllD(); |
|
144 layout = NULL; |
|
145 |
|
146 return KErrNone; |
|
147 } |
|
148 |
|
149 // ----------------------------------------------------------------------------- |
|
150 // CTestUiAifCoreToolkit::TestCHuiLayoutFindTagL |
|
151 // ----------------------------------------------------------------------------- |
|
152 // |
|
153 TInt CTestUiAifCoreToolkit::TestCHuiLayoutFindTagL( CStifItemParser& /*aItem*/ ) |
|
154 { |
|
155 |
|
156 // Print to UI |
|
157 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
158 _LIT( KTestCHuiLayout, "In TestCHuiLayoutFindTagL" ); |
|
159 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
160 // Print to log file |
|
161 iLog->Log( KTestCHuiLayout ); |
|
162 |
|
163 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
164 STIF_ASSERT_NOT_NULL( layout ); |
|
165 CHuiVisual* visual = layout->FindTag( _L8( "CannotFindVisual" ) ); |
|
166 STIF_ASSERT_NULL( visual ); |
|
167 |
|
168 return KErrNone; |
|
169 } |
|
170 |
|
171 // ----------------------------------------------------------------------------- |
|
172 // CTestUiAifCoreToolkit::TestCHuiLayoutAppendL |
|
173 // ----------------------------------------------------------------------------- |
|
174 // |
|
175 TInt CTestUiAifCoreToolkit::TestCHuiLayoutAppendL( CStifItemParser& /*aItem*/ ) |
|
176 { |
|
177 |
|
178 // Print to UI |
|
179 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
180 _LIT( KTestCHuiLayout, "In TestCHuiLayoutAppendL" ); |
|
181 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
182 // Print to log file |
|
183 iLog->Log( KTestCHuiLayout ); |
|
184 |
|
185 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
186 STIF_ASSERT_NOT_NULL( layout ); |
|
187 |
|
188 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
189 layout->AppendL( visual ); |
|
190 |
|
191 return KErrNone; |
|
192 } |
|
193 |
|
194 // ----------------------------------------------------------------------------- |
|
195 // CTestUiAifCoreToolkit::TestCHuiLayoutInsertL |
|
196 // ----------------------------------------------------------------------------- |
|
197 // |
|
198 TInt CTestUiAifCoreToolkit::TestCHuiLayoutInsertL( CStifItemParser& /*aItem*/ ) |
|
199 { |
|
200 |
|
201 // Print to UI |
|
202 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
203 _LIT( KTestCHuiLayout, "In TestCHuiLayoutInsertL" ); |
|
204 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
205 // Print to log file |
|
206 iLog->Log( KTestCHuiLayout ); |
|
207 |
|
208 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
209 STIF_ASSERT_NOT_NULL( layout ); |
|
210 |
|
211 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
212 layout->InsertL( visual, 0 ); |
|
213 |
|
214 return KErrNone; |
|
215 } |
|
216 |
|
217 // ----------------------------------------------------------------------------- |
|
218 // CTestUiAifCoreToolkit::TestCHuiLayoutRemoveL |
|
219 // ----------------------------------------------------------------------------- |
|
220 // |
|
221 TInt CTestUiAifCoreToolkit::TestCHuiLayoutRemoveL( CStifItemParser& /*aItem*/ ) |
|
222 { |
|
223 |
|
224 // Print to UI |
|
225 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
226 _LIT( KTestCHuiLayout, "In TestCHuiLayoutRemoveL" ); |
|
227 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
228 // Print to log file |
|
229 iLog->Log( KTestCHuiLayout ); |
|
230 |
|
231 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
232 STIF_ASSERT_NOT_NULL( layout ); |
|
233 |
|
234 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
235 layout->AppendL( visual ); |
|
236 layout->Remove( visual ); |
|
237 |
|
238 return KErrNone; |
|
239 } |
|
240 |
|
241 // ----------------------------------------------------------------------------- |
|
242 // CTestUiAifCoreToolkit::TestCHuiLayoutCountL |
|
243 // ----------------------------------------------------------------------------- |
|
244 // |
|
245 TInt CTestUiAifCoreToolkit::TestCHuiLayoutCountL( CStifItemParser& /*aItem*/ ) |
|
246 { |
|
247 |
|
248 // Print to UI |
|
249 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
250 _LIT( KTestCHuiLayout, "In TestCHuiLayoutCountL" ); |
|
251 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
252 // Print to log file |
|
253 iLog->Log( KTestCHuiLayout ); |
|
254 |
|
255 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
256 STIF_ASSERT_NOT_NULL( layout ); |
|
257 TInt num = layout->Count(); |
|
258 STIF_ASSERT_EQUALS( num, 0 ); |
|
259 |
|
260 return KErrNone; |
|
261 } |
|
262 |
|
263 // ----------------------------------------------------------------------------- |
|
264 // CTestUiAifCoreToolkit::TestCHuiLayoutVisualL |
|
265 // ----------------------------------------------------------------------------- |
|
266 // |
|
267 TInt CTestUiAifCoreToolkit::TestCHuiLayoutVisualL( CStifItemParser& /*aItem*/ ) |
|
268 { |
|
269 |
|
270 // Print to UI |
|
271 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
272 _LIT( KTestCHuiLayout, "In TestCHuiLayoutRemoveL" ); |
|
273 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
274 // Print to log file |
|
275 iLog->Log( KTestCHuiLayout ); |
|
276 |
|
277 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
278 STIF_ASSERT_NOT_NULL( layout ); |
|
279 |
|
280 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
281 layout->AppendL( visual ); |
|
282 layout->Visual( 0 ); |
|
283 |
|
284 return KErrNone; |
|
285 } |
|
286 |
|
287 // ----------------------------------------------------------------------------- |
|
288 // CTestUiAifCoreToolkit::TestCHuiLayoutFindVisualL |
|
289 // ----------------------------------------------------------------------------- |
|
290 // |
|
291 TInt CTestUiAifCoreToolkit::TestCHuiLayoutFindVisualL( CStifItemParser& /*aItem*/ ) |
|
292 { |
|
293 |
|
294 // Print to UI |
|
295 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
296 _LIT( KTestCHuiLayout, "In TestCHuiLayoutFindVisualL" ); |
|
297 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
298 // Print to log file |
|
299 iLog->Log( KTestCHuiLayout ); |
|
300 |
|
301 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
302 STIF_ASSERT_NOT_NULL( layout ); |
|
303 |
|
304 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
305 layout->AppendL( visual ); |
|
306 TInt num = layout->FindVisual( visual ); |
|
307 STIF_ASSERT_NOT_EQUALS( num, KErrNotFound ); |
|
308 |
|
309 return KErrNone; |
|
310 } |
|
311 |
|
312 // ----------------------------------------------------------------------------- |
|
313 // CTestUiAifCoreToolkit::TestCHuiLayoutSetPosL |
|
314 // ----------------------------------------------------------------------------- |
|
315 // |
|
316 TInt CTestUiAifCoreToolkit::TestCHuiLayoutSetPosL( CStifItemParser& /*aItem*/ ) |
|
317 { |
|
318 |
|
319 // Print to UI |
|
320 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
321 _LIT( KTestCHuiLayout, "In TestCHuiLayoutSetPosL" ); |
|
322 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
323 // Print to log file |
|
324 iLog->Log( KTestCHuiLayout ); |
|
325 |
|
326 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
327 STIF_ASSERT_NOT_NULL( layout ); |
|
328 |
|
329 THuiRealPoint pos( 0, 0 ); |
|
330 layout->SetPos( pos ); |
|
331 |
|
332 return KErrNone; |
|
333 } |
|
334 |
|
335 // ----------------------------------------------------------------------------- |
|
336 // CTestUiAifCoreToolkit::TestCHuiLayoutSetSizeL |
|
337 // ----------------------------------------------------------------------------- |
|
338 // |
|
339 TInt CTestUiAifCoreToolkit::TestCHuiLayoutSetSizeL( CStifItemParser& /*aItem*/ ) |
|
340 { |
|
341 |
|
342 // Print to UI |
|
343 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
344 _LIT( KTestCHuiLayout, "In TestCHuiLayoutSetSizeL" ); |
|
345 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
346 // Print to log file |
|
347 iLog->Log( KTestCHuiLayout ); |
|
348 |
|
349 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
350 STIF_ASSERT_NOT_NULL( layout ); |
|
351 |
|
352 THuiRealSize size( 0, 0 ); |
|
353 layout->SetSize( size ); |
|
354 |
|
355 return KErrNone; |
|
356 } |
|
357 |
|
358 // ----------------------------------------------------------------------------- |
|
359 // CTestUiAifCoreToolkit::TestCHuiLayoutUpdateChildrenLayoutL |
|
360 // ----------------------------------------------------------------------------- |
|
361 // |
|
362 TInt CTestUiAifCoreToolkit::TestCHuiLayoutUpdateChildrenLayoutL( CStifItemParser& /*aItem*/ ) |
|
363 { |
|
364 |
|
365 // Print to UI |
|
366 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
367 _LIT( KTestCHuiLayout, "In TestCHuiLayoutUpdateChildrenLayoutL" ); |
|
368 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
369 // Print to log file |
|
370 iLog->Log( KTestCHuiLayout ); |
|
371 |
|
372 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
373 STIF_ASSERT_NOT_NULL( layout ); |
|
374 |
|
375 layout->UpdateChildrenLayout(); |
|
376 |
|
377 return KErrNone; |
|
378 } |
|
379 |
|
380 // ----------------------------------------------------------------------------- |
|
381 // CTestUiAifCoreToolkit::TestCHuiLayoutUpdateChildLayoutL |
|
382 // ----------------------------------------------------------------------------- |
|
383 // |
|
384 TInt CTestUiAifCoreToolkit::TestCHuiLayoutUpdateChildLayoutL( CStifItemParser& /*aItem*/ ) |
|
385 { |
|
386 |
|
387 // Print to UI |
|
388 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
389 _LIT( KTestCHuiLayout, "In TestCHuiLayoutUpdateChildLayoutL" ); |
|
390 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
391 // Print to log file |
|
392 iLog->Log( KTestCHuiLayout ); |
|
393 |
|
394 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
395 STIF_ASSERT_NOT_NULL( layout ); |
|
396 |
|
397 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
398 layout->AppendL( visual ); |
|
399 layout->UpdateChildLayout( 0 ); |
|
400 |
|
401 return KErrNone; |
|
402 } |
|
403 |
|
404 // ----------------------------------------------------------------------------- |
|
405 // CTestUiAifCoreToolkit::TestCHuiLayoutSetInnerPaddingL |
|
406 // ----------------------------------------------------------------------------- |
|
407 // |
|
408 TInt CTestUiAifCoreToolkit::TestCHuiLayoutSetInnerPaddingL( CStifItemParser& /*aItem*/ ) |
|
409 { |
|
410 |
|
411 // Print to UI |
|
412 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
413 _LIT( KTestCHuiLayout, "In TestCHuiLayoutSetInnerPaddingL" ); |
|
414 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
415 // Print to log file |
|
416 iLog->Log( KTestCHuiLayout ); |
|
417 |
|
418 const TPoint KInnerPadding1(8, 3); |
|
419 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
420 STIF_ASSERT_NOT_NULL( layout ); |
|
421 layout->SetInnerPadding( KInnerPadding1 ); |
|
422 |
|
423 return KErrNone; |
|
424 } |
|
425 |
|
426 // ----------------------------------------------------------------------------- |
|
427 // CTestUiAifCoreToolkit::TestCHuiLayoutSetInnerPaddingWithMetricL |
|
428 // ----------------------------------------------------------------------------- |
|
429 // |
|
430 TInt CTestUiAifCoreToolkit::TestCHuiLayoutSetInnerPaddingWithMetricL( CStifItemParser& /*aItem*/ ) |
|
431 { |
|
432 |
|
433 // Print to UI |
|
434 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
435 _LIT( KTestCHuiLayout, "In TestCHuiLayoutSetInnerPaddingWithMetricL" ); |
|
436 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
437 // Print to log file |
|
438 iLog->Log( KTestCHuiLayout ); |
|
439 |
|
440 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
441 STIF_ASSERT_NOT_NULL( layout ); |
|
442 |
|
443 THuiXYMetric metric( 1, 1 ); |
|
444 layout->SetInnerPadding( metric ); |
|
445 |
|
446 return KErrNone; |
|
447 } |
|
448 |
|
449 // ----------------------------------------------------------------------------- |
|
450 // CTestUiAifCoreToolkit::TestCHuiLayoutInnerPaddingL |
|
451 // ----------------------------------------------------------------------------- |
|
452 // |
|
453 TInt CTestUiAifCoreToolkit::TestCHuiLayoutInnerPaddingL( CStifItemParser& /*aItem*/ ) |
|
454 { |
|
455 |
|
456 // Print to UI |
|
457 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
458 _LIT( KTestCHuiLayout, "In TestCHuiLayoutInnerPaddingL" ); |
|
459 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
460 // Print to log file |
|
461 iLog->Log( KTestCHuiLayout ); |
|
462 |
|
463 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
464 STIF_ASSERT_NOT_NULL( layout ); |
|
465 |
|
466 THuiXYMetric metric( 1, 1 ); |
|
467 layout->SetInnerPadding( metric ); |
|
468 THuiXYMetric getMetric = layout->InnerPadding(); |
|
469 |
|
470 return KErrNone; |
|
471 } |
|
472 |
|
473 // ----------------------------------------------------------------------------- |
|
474 // CTestUiAifCoreToolkit::TestCHuiLayoutHorizontalInnerPaddingL |
|
475 // ----------------------------------------------------------------------------- |
|
476 // |
|
477 TInt CTestUiAifCoreToolkit::TestCHuiLayoutHorizontalInnerPaddingL( CStifItemParser& /*aItem*/ ) |
|
478 { |
|
479 |
|
480 // Print to UI |
|
481 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
482 _LIT( KTestCHuiLayout, "In TestCHuiLayoutHorizontalInnerPaddingL" ); |
|
483 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
484 // Print to log file |
|
485 iLog->Log( KTestCHuiLayout ); |
|
486 |
|
487 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
488 STIF_ASSERT_NOT_NULL( layout ); |
|
489 |
|
490 THuiXYMetric metric( 1, 1 ); |
|
491 layout->SetInnerPadding( metric ); |
|
492 TInt horizontal = layout->HorizontalInnerPadding(); |
|
493 |
|
494 return KErrNone; |
|
495 } |
|
496 |
|
497 // ----------------------------------------------------------------------------- |
|
498 // CTestUiAifCoreToolkit::TestCHuiLayoutVerticalInnerPaddingL |
|
499 // ----------------------------------------------------------------------------- |
|
500 // |
|
501 TInt CTestUiAifCoreToolkit::TestCHuiLayoutVerticalInnerPaddingL( CStifItemParser& /*aItem*/ ) |
|
502 { |
|
503 |
|
504 // Print to UI |
|
505 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
506 _LIT( KTestCHuiLayout, "In TestCHuiLayoutVerticalInnerPaddingL" ); |
|
507 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
508 // Print to log file |
|
509 iLog->Log( KTestCHuiLayout ); |
|
510 |
|
511 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
512 STIF_ASSERT_NOT_NULL( layout ); |
|
513 |
|
514 TInt vertical = layout->VerticalInnerPadding(); |
|
515 |
|
516 return KErrNone; |
|
517 } |
|
518 |
|
519 // ----------------------------------------------------------------------------- |
|
520 // CTestUiAifCoreToolkit::TestCHuiLayoutInnerPaddingInBaseUnitsL |
|
521 // ----------------------------------------------------------------------------- |
|
522 // |
|
523 TInt CTestUiAifCoreToolkit::TestCHuiLayoutInnerPaddingInBaseUnitsL( CStifItemParser& /*aItem*/ ) |
|
524 { |
|
525 |
|
526 // Print to UI |
|
527 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
528 _LIT( KTestCHuiLayout, "In TestCHuiLayoutInnerPaddingInBaseUnitsL" ); |
|
529 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
530 // Print to log file |
|
531 iLog->Log( KTestCHuiLayout ); |
|
532 |
|
533 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
534 STIF_ASSERT_NOT_NULL( layout ); |
|
535 layout->InnerPaddingInBaseUnits(); |
|
536 |
|
537 return KErrNone; |
|
538 } |
|
539 |
|
540 // ----------------------------------------------------------------------------- |
|
541 // CTestUiAifCoreToolkit::TestCHuiLayoutEnableScrollingL |
|
542 // ----------------------------------------------------------------------------- |
|
543 // |
|
544 TInt CTestUiAifCoreToolkit::TestCHuiLayoutEnableScrollingL( CStifItemParser& /*aItem*/ ) |
|
545 { |
|
546 |
|
547 // Print to UI |
|
548 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
549 _LIT( KTestCHuiLayout, "In TestCHuiLayoutEnableScrollingL" ); |
|
550 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
551 // Print to log file |
|
552 iLog->Log( KTestCHuiLayout ); |
|
553 |
|
554 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
555 STIF_ASSERT_NOT_NULL( layout ); |
|
556 layout->EnableScrollingL(); |
|
557 layout->EnableScrollingL( EFalse ); |
|
558 |
|
559 return KErrNone; |
|
560 } |
|
561 |
|
562 // ----------------------------------------------------------------------------- |
|
563 // CTestUiAifCoreToolkit::TestCHuiLayoutScrollingL |
|
564 // ----------------------------------------------------------------------------- |
|
565 // |
|
566 TInt CTestUiAifCoreToolkit::TestCHuiLayoutScrollingL( CStifItemParser& /*aItem*/ ) |
|
567 { |
|
568 |
|
569 // Print to UI |
|
570 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
571 _LIT( KTestCHuiLayout, "In TestCHuiLayoutScrollingL" ); |
|
572 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
573 // Print to log file |
|
574 iLog->Log( KTestCHuiLayout ); |
|
575 |
|
576 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
577 STIF_ASSERT_NOT_NULL( layout ); |
|
578 layout->EnableScrollingL(); |
|
579 TBool isEnable = layout->Scrolling(); |
|
580 STIF_ASSERT_TRUE( isEnable ); |
|
581 |
|
582 return KErrNone; |
|
583 } |
|
584 |
|
585 // ----------------------------------------------------------------------------- |
|
586 // CTestUiAifCoreToolkit::TestCHuiLayoutScrollOffsetL |
|
587 // ----------------------------------------------------------------------------- |
|
588 // |
|
589 TInt CTestUiAifCoreToolkit::TestCHuiLayoutScrollOffsetL( CStifItemParser& /*aItem*/ ) |
|
590 { |
|
591 |
|
592 // Print to UI |
|
593 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
594 _LIT( KTestCHuiLayout, "In TestCHuiLayoutScrollOffsetL" ); |
|
595 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
596 // Print to log file |
|
597 iLog->Log( KTestCHuiLayout ); |
|
598 |
|
599 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
600 STIF_ASSERT_NOT_NULL( layout ); |
|
601 layout->EnableScrollingL(); |
|
602 THuiTimedPoint point = layout->ScrollOffset(); |
|
603 |
|
604 return KErrNone; |
|
605 } |
|
606 |
|
607 // ----------------------------------------------------------------------------- |
|
608 // CTestUiAifCoreToolkit::TestCHuiLayoutScrollOffsetWithconstL |
|
609 // ----------------------------------------------------------------------------- |
|
610 // |
|
611 TInt CTestUiAifCoreToolkit::TestCHuiLayoutScrollOffsetWithconstL( CStifItemParser& /*aItem*/ ) |
|
612 { |
|
613 |
|
614 // Print to UI |
|
615 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
616 _LIT( KTestCHuiLayout, "In TestCHuiLayoutScrollOffsetWithconstL" ); |
|
617 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
618 // Print to log file |
|
619 iLog->Log( KTestCHuiLayout ); |
|
620 |
|
621 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
622 STIF_ASSERT_NOT_NULL( layout ); |
|
623 layout->EnableScrollingL(); |
|
624 const THuiTimedPoint point = const_cast< const CHuiLayout* > ( layout )->ScrollOffset(); |
|
625 |
|
626 return KErrNone; |
|
627 } |
|
628 |
|
629 // ----------------------------------------------------------------------------- |
|
630 // CTestUiAifCoreToolkit::TestCHuiLayoutSetScrollOffsetInBaseUnitsL |
|
631 // ----------------------------------------------------------------------------- |
|
632 // |
|
633 TInt CTestUiAifCoreToolkit::TestCHuiLayoutSetScrollOffsetInBaseUnitsL( CStifItemParser& /*aItem*/ ) |
|
634 { |
|
635 |
|
636 // Print to UI |
|
637 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
638 _LIT( KTestCHuiLayout, "In TestCHuiLayoutSetScrollOffsetInBaseUnitsL" ); |
|
639 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
640 // Print to log file |
|
641 iLog->Log( KTestCHuiLayout ); |
|
642 |
|
643 TPoint pos; |
|
644 TSize size; |
|
645 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
646 STIF_ASSERT_NOT_NULL( layout ); |
|
647 CHuiVisual* child = CHuiVisual::AddNewL(*iHuiControl, layout); |
|
648 |
|
649 const TSize KChildSize( 50, 89 ); |
|
650 const THuiRealPoint KChildPosition( 5.0, 12.0 ); |
|
651 const TReal32 KPositiveHorizontalScroll = 13.6; |
|
652 const TReal32 KNegativeHorizontalScroll = -9.4; |
|
653 const TReal32 KPositiveVerticalScroll = 5.5; |
|
654 const TReal32 KNegativeVerticalScroll = -2.3; |
|
655 |
|
656 // Position child manually |
|
657 child->SetFlag( EHuiVisualFlagManualLayout ); |
|
658 child->SetPos( KChildPosition ); |
|
659 child->SetSize( KChildSize ); |
|
660 |
|
661 // Enable scrolling |
|
662 // Note: Since scrolling is applied directly to child visual display rectangles |
|
663 // we don't have to call UpdateLayoutChildren to apply changes. For the same |
|
664 // reason we have to retrieve the modified coordinates using LocalToDisplay() method |
|
665 // of individual child visuals. |
|
666 layout->EnableScrollingL( ETrue ); |
|
667 |
|
668 // Positive horizontal scroll offset |
|
669 layout->SetScrollOffsetInBaseUnits( THuiRealPoint( KPositiveHorizontalScroll, 0 ) ); |
|
670 pos = child->LocalToDisplay( child->Pos().Target() ); |
|
671 size = child->Size().Target().AsSize(); |
|
672 STIF_ASSERT_EQUALS( ( TInt )( KChildPosition.iX - KPositiveHorizontalScroll ), pos.iX ); |
|
673 STIF_ASSERT_TRUE( KChildPosition.iY == pos.iY ); |
|
674 STIF_ASSERT_TRUE( size.iWidth == KChildSize.iWidth ); |
|
675 STIF_ASSERT_TRUE( size.iHeight == KChildSize.iHeight ); |
|
676 |
|
677 // Negative horizontal scroll offset |
|
678 layout->SetScrollOffsetInBaseUnits( THuiRealPoint( KNegativeHorizontalScroll, 0 ) ); |
|
679 pos = child->LocalToDisplay( child->Pos().Target() ); |
|
680 size = child->Size().Target().AsSize(); |
|
681 STIF_ASSERT_EQUALS( ( TInt )( KChildPosition.iX - KNegativeHorizontalScroll ), pos.iX ); |
|
682 STIF_ASSERT_TRUE( KChildPosition.iY == pos.iY ); |
|
683 STIF_ASSERT_TRUE( size.iWidth == KChildSize.iWidth ); |
|
684 STIF_ASSERT_TRUE( size.iHeight == KChildSize.iHeight ); |
|
685 |
|
686 // Positive vertical scroll offset |
|
687 layout->SetScrollOffsetInBaseUnits( THuiRealPoint( 0, KPositiveVerticalScroll ) ); |
|
688 pos = child->LocalToDisplay( child->Pos().Target() ); |
|
689 size = child->Size().Target().AsSize(); |
|
690 STIF_ASSERT_TRUE( KChildPosition.iX == pos.iX ); |
|
691 STIF_ASSERT_EQUALS( (TInt)(KChildPosition.iY - KPositiveVerticalScroll ), pos.iY ); |
|
692 STIF_ASSERT_TRUE( size.iWidth == KChildSize.iWidth ); |
|
693 STIF_ASSERT_TRUE( size.iHeight == KChildSize.iHeight ); |
|
694 |
|
695 // Negative vertical scroll offset |
|
696 layout->SetScrollOffsetInBaseUnits( THuiRealPoint( 0, KNegativeVerticalScroll ) ); |
|
697 pos = child->LocalToDisplay( child->Pos().Target() ); |
|
698 size = child->Size().Target().AsSize(); |
|
699 STIF_ASSERT_TRUE( KChildPosition.iX == pos.iX ); |
|
700 STIF_ASSERT_EQUALS( (TInt )( KChildPosition.iY - KNegativeVerticalScroll ), pos.iY ); |
|
701 STIF_ASSERT_TRUE( size.iWidth == KChildSize.iWidth ); |
|
702 STIF_ASSERT_TRUE( size.iHeight == KChildSize.iHeight ); |
|
703 |
|
704 return KErrNone; |
|
705 } |
|
706 |
|
707 // ----------------------------------------------------------------------------- |
|
708 // CTestUiAifCoreToolkit::TestCHuiLayoutVirtualSizeL |
|
709 // ----------------------------------------------------------------------------- |
|
710 // |
|
711 TInt CTestUiAifCoreToolkit::TestCHuiLayoutVirtualSizeL( CStifItemParser& /*aItem*/ ) |
|
712 { |
|
713 |
|
714 // Print to UI |
|
715 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
716 _LIT( KTestCHuiLayout, "In TestCHuiLayoutVirtualSizeL" ); |
|
717 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
718 // Print to log file |
|
719 iLog->Log( KTestCHuiLayout ); |
|
720 |
|
721 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
722 STIF_ASSERT_NOT_NULL( layout ); |
|
723 layout->EnableScrollingL(); |
|
724 layout->VirtualSize(); |
|
725 |
|
726 return KErrNone; |
|
727 } |
|
728 |
|
729 // ----------------------------------------------------------------------------- |
|
730 // CTestUiAifCoreToolkit::TestCHuiLayoutEffectiveLayoutOrdinalL |
|
731 // ----------------------------------------------------------------------------- |
|
732 // |
|
733 TInt CTestUiAifCoreToolkit::TestCHuiLayoutEffectiveLayoutOrdinalL( CStifItemParser& /*aItem*/ ) |
|
734 { |
|
735 |
|
736 // Print to UI |
|
737 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
738 _LIT( KTestCHuiLayout, "In TestCHuiLayoutEffectiveLayoutOrdinalL" ); |
|
739 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
740 // Print to log file |
|
741 iLog->Log( KTestCHuiLayout ); |
|
742 |
|
743 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
744 STIF_ASSERT_NOT_NULL( layout ); |
|
745 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
746 layout->AppendL( visual ); |
|
747 layout->EffectiveLayoutOrdinal( *visual ); |
|
748 |
|
749 return KErrNone; |
|
750 } |
|
751 |
|
752 // ----------------------------------------------------------------------------- |
|
753 // CTestUiAifCoreToolkit::TestCHuiLayoutReorderL |
|
754 // ----------------------------------------------------------------------------- |
|
755 // |
|
756 TInt CTestUiAifCoreToolkit::TestCHuiLayoutReorderL( CStifItemParser& /*aItem*/ ) |
|
757 { |
|
758 |
|
759 // Print to UI |
|
760 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
761 _LIT( KTestCHuiLayout, "In TestCHuiLayoutReorderL" ); |
|
762 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
763 // Print to log file |
|
764 iLog->Log( KTestCHuiLayout ); |
|
765 |
|
766 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
767 STIF_ASSERT_NOT_NULL( layout ); |
|
768 |
|
769 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
770 layout->AppendL( visual ); |
|
771 layout->Reorder( *visual, 0 ); |
|
772 |
|
773 return KErrNone; |
|
774 } |
|
775 |
|
776 // ----------------------------------------------------------------------------- |
|
777 // CTestUiAifCoreToolkit::TestCHuiLayoutMoveVisualToFrontL |
|
778 // ----------------------------------------------------------------------------- |
|
779 // |
|
780 TInt CTestUiAifCoreToolkit::TestCHuiLayoutMoveVisualToFrontL( CStifItemParser& /*aItem*/ ) |
|
781 { |
|
782 |
|
783 // Print to UI |
|
784 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
785 _LIT( KTestCHuiLayout, "In TestCHuiLayoutMoveVisualToFrontL" ); |
|
786 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
787 // Print to log file |
|
788 iLog->Log( KTestCHuiLayout ); |
|
789 |
|
790 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
791 STIF_ASSERT_NOT_NULL( layout ); |
|
792 |
|
793 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
794 layout->AppendL( visual ); |
|
795 layout->MoveVisualToFront( *visual ); |
|
796 |
|
797 return KErrNone; |
|
798 } |
|
799 |
|
800 // ----------------------------------------------------------------------------- |
|
801 // CTestUiAifCoreToolkit::TestCHuiLayoutMoveVisualToBackL |
|
802 // ----------------------------------------------------------------------------- |
|
803 // |
|
804 TInt CTestUiAifCoreToolkit::TestCHuiLayoutMoveVisualToBackL( CStifItemParser& /*aItem*/ ) |
|
805 { |
|
806 |
|
807 // Print to UI |
|
808 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
809 _LIT( KTestCHuiLayout, "In TestCHuiLayoutMoveVisualToBackL" ); |
|
810 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
811 // Print to log file |
|
812 iLog->Log( KTestCHuiLayout ); |
|
813 |
|
814 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
815 STIF_ASSERT_NOT_NULL( layout ); |
|
816 |
|
817 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
818 layout->AppendL( visual ); |
|
819 layout->MoveVisualToBack( *visual ); |
|
820 |
|
821 return KErrNone; |
|
822 } |
|
823 |
|
824 // ----------------------------------------------------------------------------- |
|
825 // CTestUiAifCoreToolkit::TestCHuiLayoutNotifySkinChangedL |
|
826 // ----------------------------------------------------------------------------- |
|
827 // |
|
828 TInt CTestUiAifCoreToolkit::TestCHuiLayoutNotifySkinChangedL( CStifItemParser& /*aItem*/ ) |
|
829 { |
|
830 |
|
831 // Print to UI |
|
832 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
833 _LIT( KTestCHuiLayout, "In TestCHuiLayoutNotifySkinChangedL" ); |
|
834 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
835 // Print to log file |
|
836 iLog->Log( KTestCHuiLayout ); |
|
837 |
|
838 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
839 STIF_ASSERT_NOT_NULL( layout ); |
|
840 |
|
841 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
842 layout->AppendL( visual ); |
|
843 layout->NotifySkinChangedL(); |
|
844 |
|
845 return KErrNone; |
|
846 } |
|
847 |
|
848 // ----------------------------------------------------------------------------- |
|
849 // CTestUiAifCoreToolkit::TestCHuiLayoutSetTransitionTimeL |
|
850 // ----------------------------------------------------------------------------- |
|
851 // |
|
852 TInt CTestUiAifCoreToolkit::TestCHuiLayoutSetTransitionTimeL( CStifItemParser& /*aItem*/ ) |
|
853 { |
|
854 |
|
855 // Print to UI |
|
856 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
857 _LIT( KTestCHuiLayout, "In TestCHuiLayoutSetTransitionTimeL" ); |
|
858 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
859 // Print to log file |
|
860 iLog->Log( KTestCHuiLayout ); |
|
861 |
|
862 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
863 STIF_ASSERT_NOT_NULL( layout ); |
|
864 |
|
865 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
866 layout->AppendL( visual ); |
|
867 layout->SetTransitionTime( 10 ); |
|
868 |
|
869 return KErrNone; |
|
870 } |
|
871 |
|
872 // ----------------------------------------------------------------------------- |
|
873 // CTestUiAifCoreToolkit::TestCHuiLayoutTransitionTimeL |
|
874 // ----------------------------------------------------------------------------- |
|
875 // |
|
876 TInt CTestUiAifCoreToolkit::TestCHuiLayoutTransitionTimeL( CStifItemParser& /*aItem*/ ) |
|
877 { |
|
878 |
|
879 // Print to UI |
|
880 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
881 _LIT( KTestCHuiLayout, "In TestCHuiLayoutTransitionTimeL" ); |
|
882 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
883 // Print to log file |
|
884 iLog->Log( KTestCHuiLayout ); |
|
885 |
|
886 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
887 STIF_ASSERT_NOT_NULL( layout ); |
|
888 |
|
889 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
890 layout->AppendL( visual ); |
|
891 layout->SetTransitionTime( 10 ); |
|
892 TInt time = layout->TransitionTime(); |
|
893 STIF_ASSERT_EQUALS( time, 10 ); |
|
894 |
|
895 return KErrNone; |
|
896 } |
|
897 |
|
898 // ----------------------------------------------------------------------------- |
|
899 // CTestUiAifCoreToolkit::TestCHuiLayoutChildOrdinalL |
|
900 // ----------------------------------------------------------------------------- |
|
901 // |
|
902 TInt CTestUiAifCoreToolkit::TestCHuiLayoutChildOrdinalL( CStifItemParser& /*aItem*/ ) |
|
903 { |
|
904 |
|
905 // Print to UI |
|
906 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
907 _LIT( KTestCHuiLayout, "In TestCHuiLayoutChildOrdinalL" ); |
|
908 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
909 // Print to log file |
|
910 iLog->Log( KTestCHuiLayout ); |
|
911 |
|
912 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
913 STIF_ASSERT_NOT_NULL( layout ); |
|
914 |
|
915 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
916 layout->AppendL( visual ); |
|
917 TInt index = layout->ChildOrdinal( 0 ); |
|
918 STIF_ASSERT_EQUALS( index, 0 ); |
|
919 |
|
920 return KErrNone; |
|
921 } |
|
922 |
|
923 // ----------------------------------------------------------------------------- |
|
924 // CTestUiAifCoreToolkit::TestCHuiLayoutPrepareDrawL |
|
925 // ----------------------------------------------------------------------------- |
|
926 // |
|
927 TInt CTestUiAifCoreToolkit::TestCHuiLayoutPrepareDrawL( CStifItemParser& /*aItem*/ ) |
|
928 { |
|
929 |
|
930 // Print to UI |
|
931 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
932 _LIT( KTestCHuiLayout, "In TestCHuiLayoutPrepareDrawL" ); |
|
933 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
934 // Print to log file |
|
935 iLog->Log( KTestCHuiLayout ); |
|
936 |
|
937 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
938 STIF_ASSERT_NOT_NULL( layout ); |
|
939 |
|
940 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
941 layout->AppendL( visual ); |
|
942 layout->PrepareDrawL(); |
|
943 |
|
944 return KErrNone; |
|
945 } |
|
946 |
|
947 // ----------------------------------------------------------------------------- |
|
948 // CTestUiAifCoreToolkit::TestCHuiLayoutDrawL |
|
949 // ----------------------------------------------------------------------------- |
|
950 // |
|
951 TInt CTestUiAifCoreToolkit::TestCHuiLayoutDrawL( CStifItemParser& /*aItem*/ ) |
|
952 { |
|
953 |
|
954 // Print to UI |
|
955 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
956 _LIT( KTestCHuiLayout, "In TestCHuiLayoutDrawL" ); |
|
957 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
958 // Print to log file |
|
959 iLog->Log( KTestCHuiLayout ); |
|
960 |
|
961 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
962 STIF_ASSERT_NOT_NULL( layout ); |
|
963 |
|
964 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
965 layout->AppendL( visual ); |
|
966 CHuiEnv::RefreshCallBack( iHuiEnv ); |
|
967 CHuiGc* gc = &iHuiEnv->Skin().Context(); |
|
968 layout->Draw( *gc ); |
|
969 |
|
970 return KErrNone; |
|
971 } |
|
972 |
|
973 // ----------------------------------------------------------------------------- |
|
974 // CTestUiAifCoreToolkit::TestCHuiLayoutReportChangedL |
|
975 // ----------------------------------------------------------------------------- |
|
976 // |
|
977 TInt CTestUiAifCoreToolkit::TestCHuiLayoutReportChangedL( CStifItemParser& /*aItem*/ ) |
|
978 { |
|
979 |
|
980 // Print to UI |
|
981 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
982 _LIT( KTestCHuiLayout, "In TestCHuiLayoutReportChangedL" ); |
|
983 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
984 // Print to log file |
|
985 iLog->Log( KTestCHuiLayout ); |
|
986 |
|
987 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
988 STIF_ASSERT_NOT_NULL( layout ); |
|
989 |
|
990 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
991 layout->AppendL( visual ); |
|
992 layout->ReportChanged(); |
|
993 |
|
994 return KErrNone; |
|
995 } |
|
996 |
|
997 // ----------------------------------------------------------------------------- |
|
998 // CTestUiAifCoreToolkit::TestCHuiLayoutClearChangedL |
|
999 // ----------------------------------------------------------------------------- |
|
1000 // |
|
1001 TInt CTestUiAifCoreToolkit::TestCHuiLayoutClearChangedL( CStifItemParser& /*aItem*/ ) |
|
1002 { |
|
1003 |
|
1004 // Print to UI |
|
1005 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1006 _LIT( KTestCHuiLayout, "In TestCHuiLayoutClearChangedL" ); |
|
1007 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1008 // Print to log file |
|
1009 iLog->Log( KTestCHuiLayout ); |
|
1010 |
|
1011 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1012 STIF_ASSERT_NOT_NULL( layout ); |
|
1013 |
|
1014 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1015 layout->AppendL( visual ); |
|
1016 layout->ClearChanged(); |
|
1017 |
|
1018 return KErrNone; |
|
1019 } |
|
1020 |
|
1021 // ----------------------------------------------------------------------------- |
|
1022 // CTestUiAifCoreToolkit::TestCHuiLayoutChangedL |
|
1023 // ----------------------------------------------------------------------------- |
|
1024 // |
|
1025 TInt CTestUiAifCoreToolkit::TestCHuiLayoutChangedL( CStifItemParser& /*aItem*/ ) |
|
1026 { |
|
1027 |
|
1028 // Print to UI |
|
1029 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1030 _LIT( KTestCHuiLayout, "In TestCHuiLayoutChangedL" ); |
|
1031 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1032 // Print to log file |
|
1033 iLog->Log( KTestCHuiLayout ); |
|
1034 |
|
1035 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1036 STIF_ASSERT_NOT_NULL( layout ); |
|
1037 |
|
1038 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1039 layout->AppendL( visual ); |
|
1040 layout->Changed(); |
|
1041 |
|
1042 return KErrNone; |
|
1043 } |
|
1044 |
|
1045 // ----------------------------------------------------------------------------- |
|
1046 // CTestUiAifCoreToolkit::TestCHuiLayoutDumpTreeL |
|
1047 // ----------------------------------------------------------------------------- |
|
1048 // |
|
1049 TInt CTestUiAifCoreToolkit::TestCHuiLayoutDumpTreeL( CStifItemParser& /*aItem*/ ) |
|
1050 { |
|
1051 |
|
1052 // Print to UI |
|
1053 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1054 _LIT( KTestCHuiLayout, "In TestCHuiLayoutDumpTreeL" ); |
|
1055 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1056 // Print to log file |
|
1057 iLog->Log( KTestCHuiLayout ); |
|
1058 |
|
1059 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1060 STIF_ASSERT_NOT_NULL( layout ); |
|
1061 |
|
1062 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1063 layout->AppendL( visual ); |
|
1064 layout->DumpTree(); |
|
1065 |
|
1066 return KErrNone; |
|
1067 } |
|
1068 |
|
1069 // ----------------------------------------------------------------------------- |
|
1070 // CTestUiAifCoreToolkit::TestCHuiLayoutSetBaseUnitL |
|
1071 // ----------------------------------------------------------------------------- |
|
1072 // |
|
1073 TInt CTestUiAifCoreToolkit::TestCHuiLayoutSetBaseUnitL( CStifItemParser& /*aItem*/ ) |
|
1074 { |
|
1075 |
|
1076 // Print to UI |
|
1077 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1078 _LIT( KTestCHuiLayout, "In TestCHuiLayoutSetBaseUnitL" ); |
|
1079 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1080 // Print to log file |
|
1081 iLog->Log( KTestCHuiLayout ); |
|
1082 |
|
1083 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1084 STIF_ASSERT_NOT_NULL( layout ); |
|
1085 |
|
1086 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1087 layout->AppendL( visual ); |
|
1088 THuiMetric metric( 1 ); |
|
1089 layout->SetBaseUnit( metric ); |
|
1090 |
|
1091 return KErrNone; |
|
1092 } |
|
1093 |
|
1094 // ----------------------------------------------------------------------------- |
|
1095 // CTestUiAifCoreToolkit::TestCHuiLayoutSetBaseUnitXYL |
|
1096 // ----------------------------------------------------------------------------- |
|
1097 // |
|
1098 TInt CTestUiAifCoreToolkit::TestCHuiLayoutSetBaseUnitXYL( CStifItemParser& /*aItem*/ ) |
|
1099 { |
|
1100 |
|
1101 // Print to UI |
|
1102 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1103 _LIT( KTestCHuiLayout, "In TestCHuiLayoutSetBaseUnitXYL" ); |
|
1104 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1105 // Print to log file |
|
1106 iLog->Log( KTestCHuiLayout ); |
|
1107 |
|
1108 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1109 STIF_ASSERT_NOT_NULL( layout ); |
|
1110 |
|
1111 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1112 layout->AppendL( visual ); |
|
1113 THuiXYMetric metric( 1, 1 ); |
|
1114 layout->SetBaseUnit( metric ); |
|
1115 |
|
1116 return KErrNone; |
|
1117 } |
|
1118 |
|
1119 // ----------------------------------------------------------------------------- |
|
1120 // CTestUiAifCoreToolkit::TestCHuiLayoutBaseUnitL |
|
1121 // ----------------------------------------------------------------------------- |
|
1122 // |
|
1123 TInt CTestUiAifCoreToolkit::TestCHuiLayoutBaseUnitL( CStifItemParser& /*aItem*/ ) |
|
1124 { |
|
1125 |
|
1126 // Print to UI |
|
1127 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1128 _LIT( KTestCHuiLayout, "In TestCHuiLayoutBaseUnitL" ); |
|
1129 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1130 // Print to log file |
|
1131 iLog->Log( KTestCHuiLayout ); |
|
1132 |
|
1133 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1134 STIF_ASSERT_NOT_NULL( layout ); |
|
1135 |
|
1136 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1137 layout->AppendL( visual ); |
|
1138 THuiXYMetric metric( 1, 1 ); |
|
1139 layout->SetBaseUnit( metric ); |
|
1140 layout->BaseUnit(); |
|
1141 |
|
1142 return KErrNone; |
|
1143 } |
|
1144 |
|
1145 // ----------------------------------------------------------------------------- |
|
1146 // CTestUiAifCoreToolkit::TestCHuiLayoutInnerSizeL |
|
1147 // ----------------------------------------------------------------------------- |
|
1148 // |
|
1149 TInt CTestUiAifCoreToolkit::TestCHuiLayoutInnerSizeL( CStifItemParser& /*aItem*/ ) |
|
1150 { |
|
1151 |
|
1152 // Print to UI |
|
1153 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1154 _LIT( KTestCHuiLayout, "In TestCHuiLayoutInnerSizeL" ); |
|
1155 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1156 // Print to log file |
|
1157 iLog->Log( KTestCHuiLayout ); |
|
1158 |
|
1159 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1160 STIF_ASSERT_NOT_NULL( layout ); |
|
1161 |
|
1162 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1163 layout->AppendL( visual ); |
|
1164 layout->InnerSize(); |
|
1165 |
|
1166 return KErrNone; |
|
1167 } |
|
1168 |
|
1169 // ----------------------------------------------------------------------------- |
|
1170 // CTestUiAifCoreToolkit::TestCHuiLayoutInnerTopLeftL |
|
1171 // ----------------------------------------------------------------------------- |
|
1172 // |
|
1173 TInt CTestUiAifCoreToolkit::TestCHuiLayoutInnerTopLeftL( CStifItemParser& /*aItem*/ ) |
|
1174 { |
|
1175 |
|
1176 // Print to UI |
|
1177 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1178 _LIT( KTestCHuiLayout, "In TestCHuiLayoutInnerTopLeftL" ); |
|
1179 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1180 // Print to log file |
|
1181 iLog->Log( KTestCHuiLayout ); |
|
1182 |
|
1183 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1184 STIF_ASSERT_NOT_NULL( layout ); |
|
1185 |
|
1186 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1187 layout->AppendL( visual ); |
|
1188 layout->InnerTopLeft(); |
|
1189 |
|
1190 return KErrNone; |
|
1191 } |
|
1192 |
|
1193 // ----------------------------------------------------------------------------- |
|
1194 // CTestUiAifCoreToolkit::TestCHuiLayoutChildSizeL |
|
1195 // ----------------------------------------------------------------------------- |
|
1196 // |
|
1197 TInt CTestUiAifCoreToolkit::TestCHuiLayoutChildSizeL( CStifItemParser& /*aItem*/ ) |
|
1198 { |
|
1199 |
|
1200 // Print to UI |
|
1201 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1202 _LIT( KTestCHuiLayout, "In TestCHuiLayoutChildSizeL" ); |
|
1203 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1204 // Print to log file |
|
1205 iLog->Log( KTestCHuiLayout ); |
|
1206 |
|
1207 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1208 STIF_ASSERT_NOT_NULL( layout ); |
|
1209 |
|
1210 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1211 layout->AppendL( visual ); |
|
1212 TSize size( 1, 1 ); |
|
1213 layout->ChildSize( 0, size ); |
|
1214 |
|
1215 return KErrNone; |
|
1216 } |
|
1217 |
|
1218 // ----------------------------------------------------------------------------- |
|
1219 // CTestUiAifCoreToolkit::TestCHuiLayoutChildPosL |
|
1220 // ----------------------------------------------------------------------------- |
|
1221 // |
|
1222 TInt CTestUiAifCoreToolkit::TestCHuiLayoutChildPosL( CStifItemParser& /*aItem*/ ) |
|
1223 { |
|
1224 |
|
1225 // Print to UI |
|
1226 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1227 _LIT( KTestCHuiLayout, "In TestCHuiLayoutChildPosL" ); |
|
1228 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1229 // Print to log file |
|
1230 iLog->Log( KTestCHuiLayout ); |
|
1231 |
|
1232 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1233 STIF_ASSERT_NOT_NULL( layout ); |
|
1234 |
|
1235 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1236 layout->AppendL( visual ); |
|
1237 TPoint point( 1, 1 ); |
|
1238 layout->ChildPos( 0, point ); |
|
1239 |
|
1240 return KErrNone; |
|
1241 } |
|
1242 |
|
1243 // ----------------------------------------------------------------------------- |
|
1244 // CTestUiAifCoreToolkit::TestCHuiLayoutChildRectL |
|
1245 // ----------------------------------------------------------------------------- |
|
1246 // |
|
1247 TInt CTestUiAifCoreToolkit::TestCHuiLayoutChildRectL( CStifItemParser& /*aItem*/ ) |
|
1248 { |
|
1249 |
|
1250 // Print to UI |
|
1251 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1252 _LIT( KTestCHuiLayout, "In TestCHuiLayoutChildRectL" ); |
|
1253 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1254 // Print to log file |
|
1255 iLog->Log( KTestCHuiLayout ); |
|
1256 |
|
1257 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1258 STIF_ASSERT_NOT_NULL( layout ); |
|
1259 |
|
1260 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1261 layout->AppendL( visual ); |
|
1262 TRect rect( 1, 1, 1, 1 ); |
|
1263 THuiRealRect realRect( rect ); |
|
1264 layout->ChildRect( 0, realRect ); |
|
1265 |
|
1266 return KErrNone; |
|
1267 } |
|
1268 |
|
1269 // ----------------------------------------------------------------------------- |
|
1270 // CTestUiAifCoreToolkit::TestCHuiLayoutBrushOpacityL |
|
1271 // ----------------------------------------------------------------------------- |
|
1272 // |
|
1273 TInt CTestUiAifCoreToolkit::TestCHuiLayoutBrushOpacityL( CStifItemParser& /*aItem*/ ) |
|
1274 { |
|
1275 |
|
1276 // Print to UI |
|
1277 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1278 _LIT( KTestCHuiLayout, "In TestCHuiLayoutBrushOpacityL" ); |
|
1279 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1280 // Print to log file |
|
1281 iLog->Log( KTestCHuiLayout ); |
|
1282 |
|
1283 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1284 STIF_ASSERT_NOT_NULL( layout ); |
|
1285 |
|
1286 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1287 layout->AppendL( visual ); |
|
1288 layout->BrushOpacity(); |
|
1289 |
|
1290 return KErrNone; |
|
1291 } |
|
1292 |
|
1293 // ----------------------------------------------------------------------------- |
|
1294 // CTestUiAifCoreToolkit::TestCHuiLayoutBrushRectL |
|
1295 // ----------------------------------------------------------------------------- |
|
1296 // |
|
1297 TInt CTestUiAifCoreToolkit::TestCHuiLayoutBrushRectL( CStifItemParser& /*aItem*/ ) |
|
1298 { |
|
1299 |
|
1300 // Print to UI |
|
1301 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1302 _LIT( KTestCHuiLayout, "In TestCHuiLayoutBrushRectL" ); |
|
1303 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1304 // Print to log file |
|
1305 iLog->Log( KTestCHuiLayout ); |
|
1306 |
|
1307 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1308 STIF_ASSERT_NOT_NULL( layout ); |
|
1309 |
|
1310 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1311 layout->AppendL( visual ); |
|
1312 layout->BrushRect(); |
|
1313 |
|
1314 return KErrNone; |
|
1315 } |
|
1316 |
|
1317 // ----------------------------------------------------------------------------- |
|
1318 // CTestUiAifCoreToolkit::TestCHuiLayoutBrushSkinL |
|
1319 // ----------------------------------------------------------------------------- |
|
1320 // |
|
1321 TInt CTestUiAifCoreToolkit::TestCHuiLayoutBrushSkinL( CStifItemParser& /*aItem*/ ) |
|
1322 { |
|
1323 |
|
1324 // Print to UI |
|
1325 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1326 _LIT( KTestCHuiLayout, "In TestCHuiLayoutBrushSkinL" ); |
|
1327 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1328 // Print to log file |
|
1329 iLog->Log( KTestCHuiLayout ); |
|
1330 |
|
1331 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1332 STIF_ASSERT_NOT_NULL( layout ); |
|
1333 |
|
1334 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1335 layout->AppendL( visual ); |
|
1336 layout->BrushSkin(); |
|
1337 |
|
1338 return KErrNone; |
|
1339 } |
|
1340 |
|
1341 // ----------------------------------------------------------------------------- |
|
1342 // CTestUiAifCoreToolkit::TestCHuiLayoutGetInstanceNameL |
|
1343 // ----------------------------------------------------------------------------- |
|
1344 // |
|
1345 TInt CTestUiAifCoreToolkit::TestCHuiLayoutGetInstanceNameL( CStifItemParser& /*aItem*/ ) |
|
1346 { |
|
1347 |
|
1348 // Print to UI |
|
1349 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1350 _LIT( KTestCHuiLayout, "In TestCHuiLayoutGetInstanceNameL" ); |
|
1351 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1352 // Print to log file |
|
1353 iLog->Log( KTestCHuiLayout ); |
|
1354 |
|
1355 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1356 STIF_ASSERT_NOT_NULL( layout ); |
|
1357 |
|
1358 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1359 layout->AppendL( visual ); |
|
1360 TBuf<20> txt( KName ); |
|
1361 layout->GetInstanceName( txt ); |
|
1362 |
|
1363 return KErrNone; |
|
1364 } |
|
1365 |
|
1366 // ----------------------------------------------------------------------------- |
|
1367 // CTestUiAifCoreToolkit::TestCHuiLayoutGetClassNameL |
|
1368 // ----------------------------------------------------------------------------- |
|
1369 // |
|
1370 TInt CTestUiAifCoreToolkit::TestCHuiLayoutGetClassNameL( CStifItemParser& /*aItem*/ ) |
|
1371 { |
|
1372 |
|
1373 // Print to UI |
|
1374 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1375 _LIT( KTestCHuiLayout, "In TestCHuiLayoutGetClassNameL" ); |
|
1376 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1377 // Print to log file |
|
1378 iLog->Log( KTestCHuiLayout ); |
|
1379 |
|
1380 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1381 STIF_ASSERT_NOT_NULL( layout ); |
|
1382 |
|
1383 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1384 layout->AppendL( visual ); |
|
1385 TBuf<20> txt( KName ); |
|
1386 layout->GetClassName( txt ); |
|
1387 |
|
1388 return KErrNone; |
|
1389 } |
|
1390 |
|
1391 // ----------------------------------------------------------------------------- |
|
1392 // CTestUiAifCoreToolkit::TestCHuiLayoutTypeL |
|
1393 // ----------------------------------------------------------------------------- |
|
1394 // |
|
1395 TInt CTestUiAifCoreToolkit::TestCHuiLayoutTypeL( CStifItemParser& /*aItem*/ ) |
|
1396 { |
|
1397 |
|
1398 // Print to UI |
|
1399 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1400 _LIT( KTestCHuiLayout, "In TestCHuiLayoutTypeL" ); |
|
1401 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1402 // Print to log file |
|
1403 iLog->Log( KTestCHuiLayout ); |
|
1404 |
|
1405 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1406 STIF_ASSERT_NOT_NULL( layout ); |
|
1407 |
|
1408 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1409 layout->AppendL( visual ); |
|
1410 CHuiLayout::TType type= layout->Type(); |
|
1411 STIF_ASSERT_EQUALS( type, CHuiLayout::ETypeVisual ); |
|
1412 |
|
1413 return KErrNone; |
|
1414 } |
|
1415 |
|
1416 // ----------------------------------------------------------------------------- |
|
1417 // CTestUiAifCoreToolkit::TestCHuiLayoutSessionIdL |
|
1418 // ----------------------------------------------------------------------------- |
|
1419 // |
|
1420 TInt CTestUiAifCoreToolkit::TestCHuiLayoutSessionIdL( CStifItemParser& /*aItem*/ ) |
|
1421 { |
|
1422 |
|
1423 // Print to UI |
|
1424 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1425 _LIT( KTestCHuiLayout, "In TestCHuiLayoutSessionIdL" ); |
|
1426 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1427 // Print to log file |
|
1428 iLog->Log( KTestCHuiLayout ); |
|
1429 |
|
1430 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1431 STIF_ASSERT_NOT_NULL( layout ); |
|
1432 |
|
1433 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1434 layout->AppendL( visual ); |
|
1435 layout->SessionId(); |
|
1436 |
|
1437 return KErrNone; |
|
1438 } |
|
1439 |
|
1440 // ----------------------------------------------------------------------------- |
|
1441 // CTestUiAifCoreToolkit::TestCHuiLayoutSetSessionIdL |
|
1442 // ----------------------------------------------------------------------------- |
|
1443 // |
|
1444 TInt CTestUiAifCoreToolkit::TestCHuiLayoutSetSessionIdL( CStifItemParser& /*aItem*/ ) |
|
1445 { |
|
1446 |
|
1447 // Print to UI |
|
1448 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1449 _LIT( KTestCHuiLayout, "In TestCHuiLayoutSetSessionIdL" ); |
|
1450 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1451 // Print to log file |
|
1452 iLog->Log( KTestCHuiLayout ); |
|
1453 |
|
1454 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
1455 STIF_ASSERT_NOT_NULL( layout ); |
|
1456 |
|
1457 CHuiVisual* visual = CHuiVisual::AddNewL( *iHuiControl ); |
|
1458 layout->AppendL( visual ); |
|
1459 layout->SetSessionId( 1 ); |
|
1460 TInt id = layout->SessionId(); |
|
1461 STIF_ASSERT_EQUALS( id, 1 ); |
|
1462 |
|
1463 return KErrNone; |
|
1464 } |
|
1465 |
|
1466 // ----------------------------------------------------------------------------- |
|
1467 // CTestUiAifCoreToolkit::TestCHuiLayoutDrawSelfL |
|
1468 // ----------------------------------------------------------------------------- |
|
1469 // |
|
1470 TInt CTestUiAifCoreToolkit::TestCHuiLayoutDrawSelfL( CStifItemParser& /*aItem*/ ) |
|
1471 { |
|
1472 |
|
1473 // Print to UI |
|
1474 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1475 _LIT( KTestCHuiLayout, "In TestCHuiLayoutDrawSelfL" ); |
|
1476 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1477 // Print to log file |
|
1478 iLog->Log( KTestCHuiLayout ); |
|
1479 |
|
1480 CHuiLayoutExt* layout = new( ELeave ) CHuiLayoutExt( *iHuiControl ); |
|
1481 layout->ConstructL(); |
|
1482 CHuiEnv::RefreshCallBack( iHuiEnv ); |
|
1483 CHuiGc* gc = &iHuiEnv->Skin().Context(); |
|
1484 TRect rect( 1, 1, 1, 1 ); |
|
1485 layout->DrawSelf( *gc, rect ); |
|
1486 |
|
1487 return KErrNone; |
|
1488 } |
|
1489 |
|
1490 // ----------------------------------------------------------------------------- |
|
1491 // CTestUiAifCoreToolkit::TestHLMetricReferenceForLayoutInPixelsWithLayoutL |
|
1492 // ----------------------------------------------------------------------------- |
|
1493 // |
|
1494 TInt CTestUiAifCoreToolkit::TestHLMetricReferenceForLayoutInPixelsWithLayoutL( CStifItemParser& /*aItem*/ ) |
|
1495 { |
|
1496 |
|
1497 // Print to UI |
|
1498 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1499 _LIT( KTestCHuiLayout, "In TestHLMetricReferenceForLayoutInPixelsWithLayoutL" ); |
|
1500 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1501 // Print to log file |
|
1502 iLog->Log( KTestCHuiLayout ); |
|
1503 |
|
1504 CHuiLayoutExt* layout = new( ELeave ) CHuiLayoutExt( *iHuiControl ); |
|
1505 STIF_ASSERT_NOT_NULL( layout ); |
|
1506 layout->ConstructL(); |
|
1507 THuiXYMetric metric( 1, 1 ); |
|
1508 layout->MetricReferenceForLayoutInPixels( layout, metric ); |
|
1509 |
|
1510 return KErrNone; |
|
1511 } |
|
1512 |
|
1513 // ----------------------------------------------------------------------------- |
|
1514 // CTestUiAifCoreToolkit::TestHLMetricReferenceForLayoutInPixelsL |
|
1515 // ----------------------------------------------------------------------------- |
|
1516 // |
|
1517 TInt CTestUiAifCoreToolkit::TestHLMetricReferenceForLayoutInPixelsL( CStifItemParser& /*aItem*/ ) |
|
1518 { |
|
1519 |
|
1520 // Print to UI |
|
1521 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1522 _LIT( KTestCHuiLayout, "In TestHLMetricReferenceForLayoutInPixelsL" ); |
|
1523 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1524 // Print to log file |
|
1525 iLog->Log( KTestCHuiLayout ); |
|
1526 |
|
1527 CHuiLayoutExt* layout = new( ELeave ) CHuiLayoutExt( *iHuiControl ); |
|
1528 STIF_ASSERT_NOT_NULL( layout ); |
|
1529 layout->ConstructL(); |
|
1530 THuiXYMetric metric( 1, 1 ); |
|
1531 layout->MetricReferenceForLayoutInPixels( metric ); |
|
1532 |
|
1533 return KErrNone; |
|
1534 } |
|
1535 |
|
1536 // ----------------------------------------------------------------------------- |
|
1537 // CTestUiAifCoreToolkit::TestCHuiLayoutExpandRectWithContentL |
|
1538 // ----------------------------------------------------------------------------- |
|
1539 // |
|
1540 TInt CTestUiAifCoreToolkit::TestCHuiLayoutExpandRectWithContentL( CStifItemParser& /*aItem*/ ) |
|
1541 { |
|
1542 |
|
1543 // Print to UI |
|
1544 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1545 _LIT( KTestCHuiLayout, "In TestCHuiLayoutExpandRectWithContentL" ); |
|
1546 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1547 // Print to log file |
|
1548 iLog->Log( KTestCHuiLayout ); |
|
1549 |
|
1550 CHuiLayoutExt* layout = new( ELeave ) CHuiLayoutExt( *iHuiControl ); |
|
1551 STIF_ASSERT_NOT_NULL( layout ); |
|
1552 layout->ConstructL(); |
|
1553 TRect rect( 0, 0, 1, 1 ); |
|
1554 layout->ExpandRectWithContent( rect ); |
|
1555 |
|
1556 return KErrNone; |
|
1557 } |
|
1558 |
|
1559 // ----------------------------------------------------------------------------- |
|
1560 // CTestUiAifCoreToolkit::TestCHuiLayoutVisualExtensionL |
|
1561 // ----------------------------------------------------------------------------- |
|
1562 // |
|
1563 TInt CTestUiAifCoreToolkit::TestCHuiLayoutVisualExtensionL( CStifItemParser& /*aItem*/ ) |
|
1564 { |
|
1565 |
|
1566 // Print to UI |
|
1567 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
1568 _LIT( KTestCHuiLayout, "In TestCHuiLayoutVisualExtensionL" ); |
|
1569 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiLayout ); |
|
1570 // Print to log file |
|
1571 iLog->Log( KTestCHuiLayout ); |
|
1572 |
|
1573 CHuiLayoutExt* layout = new( ELeave ) CHuiLayoutExt( *iHuiControl ); |
|
1574 STIF_ASSERT_NOT_NULL( layout ); |
|
1575 layout->ConstructL(); |
|
1576 TUid uid = TUid::Null(); |
|
1577 TAny** any = NULL; |
|
1578 layout->VisualExtension( uid, any ); |
|
1579 |
|
1580 return KErrNone; |
|
1581 } |
|