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/huim3gmesh.h> |
|
25 #include <uiacceltk/huienv.h> |
|
26 #include <uiacceltk/huicontrol.h> |
|
27 #include <uiacceltk/huilayout.h> |
|
28 #include <uiacceltk/huimeshvisual.h> |
|
29 |
|
30 #include "testuiaifcoretoolkit.h" |
|
31 |
|
32 // ----------------------------------------------------------------------------- |
|
33 // CTestUiAifCoreToolkit::TestCHM3GMLoadSceneL |
|
34 // ----------------------------------------------------------------------------- |
|
35 // |
|
36 TInt CTestUiAifCoreToolkit::TestCHM3GMLoadSceneL( CStifItemParser& /*aItem*/ ) |
|
37 { |
|
38 |
|
39 // Print to UI |
|
40 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
41 _LIT( KTestCHuiM3GMesh, "In TestCHM3GMLoadSceneL" ); |
|
42 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiM3GMesh ); |
|
43 // Print to log file |
|
44 iLog->Log( KTestCHuiM3GMesh ); |
|
45 |
|
46 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
47 CHuiMeshVisual* visual = CHuiMeshVisual::AddNewL( *iHuiControl, EHuiMeshTypeM3G, layout ); |
|
48 STIF_ASSERT_NOT_NULL( visual ); |
|
49 CHuiM3GMesh* mesh = visual->M3GMesh(); |
|
50 TRAP_IGNORE( mesh->LoadSceneL( _L( "a" ) ) ); |
|
51 |
|
52 return KErrNone; |
|
53 } |
|
54 |
|
55 // ----------------------------------------------------------------------------- |
|
56 // CTestUiAifCoreToolkit::TestCHM3GMSetAnimationPositionL |
|
57 // ----------------------------------------------------------------------------- |
|
58 // |
|
59 TInt CTestUiAifCoreToolkit::TestCHM3GMSetAnimationPositionL( CStifItemParser& /*aItem*/ ) |
|
60 { |
|
61 |
|
62 // Print to UI |
|
63 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
64 _LIT( KTestCHuiM3GMesh, "In TestCHM3GMSetAnimationPositionL" ); |
|
65 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiM3GMesh ); |
|
66 // Print to log file |
|
67 iLog->Log( KTestCHuiM3GMesh ); |
|
68 |
|
69 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
70 CHuiMeshVisual* visual = CHuiMeshVisual::AddNewL( *iHuiControl, EHuiMeshTypeM3G, layout ); |
|
71 STIF_ASSERT_NOT_NULL( visual ); |
|
72 CHuiM3GMesh* mesh = visual->M3GMesh(); |
|
73 mesh->SetAnimationPosition( 0, 0, 0 ); |
|
74 |
|
75 return KErrNone; |
|
76 } |
|
77 |
|
78 // ----------------------------------------------------------------------------- |
|
79 // CTestUiAifCoreToolkit::TestCHM3GMStartAnimationControllerL |
|
80 // ----------------------------------------------------------------------------- |
|
81 // |
|
82 TInt CTestUiAifCoreToolkit::TestCHM3GMStartAnimationControllerL( CStifItemParser& /*aItem*/ ) |
|
83 { |
|
84 |
|
85 // Print to UI |
|
86 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
87 _LIT( KTestCHuiM3GMesh, "In TestCHM3GMStartAnimationControllerL" ); |
|
88 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiM3GMesh ); |
|
89 // Print to log file |
|
90 iLog->Log( KTestCHuiM3GMesh ); |
|
91 |
|
92 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
93 CHuiMeshVisual* visual = CHuiMeshVisual::AddNewL( *iHuiControl, EHuiMeshTypeM3G, layout ); |
|
94 STIF_ASSERT_NOT_NULL( visual ); |
|
95 CHuiM3GMesh* mesh = visual->M3GMesh(); |
|
96 mesh->StartAnimationController( 0 ); |
|
97 |
|
98 return KErrNone; |
|
99 } |
|
100 |
|
101 // ----------------------------------------------------------------------------- |
|
102 // CTestUiAifCoreToolkit::TestCHM3GMStopAnimationControllerL |
|
103 // ----------------------------------------------------------------------------- |
|
104 // |
|
105 TInt CTestUiAifCoreToolkit::TestCHM3GMStopAnimationControllerL( CStifItemParser& /*aItem*/ ) |
|
106 { |
|
107 |
|
108 // Print to UI |
|
109 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
110 _LIT( KTestCHuiM3GMesh, "In TestCHM3GMStopAnimationControllerL" ); |
|
111 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiM3GMesh ); |
|
112 // Print to log file |
|
113 iLog->Log( KTestCHuiM3GMesh ); |
|
114 |
|
115 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
116 CHuiMeshVisual* visual = CHuiMeshVisual::AddNewL( *iHuiControl, EHuiMeshTypeM3G, layout ); |
|
117 STIF_ASSERT_NOT_NULL( visual ); |
|
118 CHuiM3GMesh* mesh = visual->M3GMesh(); |
|
119 mesh->StartAnimationController( 0 ); |
|
120 mesh->StopAnimationController( 0 ); |
|
121 |
|
122 return KErrNone; |
|
123 } |
|