|
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/huimesh.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::TestCHuiMeshVisualAddNewL |
|
34 // ----------------------------------------------------------------------------- |
|
35 // |
|
36 TInt CTestUiAifCoreToolkit::TestCHuiMeshVisualAddNewL( CStifItemParser& /*aItem*/ ) |
|
37 { |
|
38 |
|
39 // Print to UI |
|
40 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
41 _LIT( KTestCHuiMesh, "In TestCHuiMeshVisualAddNewL" ); |
|
42 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
43 // Print to log file |
|
44 iLog->Log( KTestCHuiMesh ); |
|
45 |
|
46 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
47 CHuiMeshVisual* visual = CHuiMeshVisual::AddNewL( *iHuiControl, EHuiMeshTypeM3G, layout ); |
|
48 STIF_ASSERT_NOT_NULL( visual ); |
|
49 |
|
50 return KErrNone; |
|
51 } |
|
52 |
|
53 // ----------------------------------------------------------------------------- |
|
54 // CTestUiAifCoreToolkit::TestCHuiMeshVisualCreateMeshL |
|
55 // ----------------------------------------------------------------------------- |
|
56 // |
|
57 TInt CTestUiAifCoreToolkit::TestCHuiMeshVisualCreateMeshL( CStifItemParser& /*aItem*/ ) |
|
58 { |
|
59 |
|
60 // Print to UI |
|
61 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
62 _LIT( KTestCHuiMesh, "In TestCHuiMeshVisualCreateMeshL" ); |
|
63 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
64 // Print to log file |
|
65 iLog->Log( KTestCHuiMesh ); |
|
66 |
|
67 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
68 CHuiMeshVisual* visual = CHuiMeshVisual::AddNewL( *iHuiControl, EHuiMeshTypeM3G, layout ); |
|
69 STIF_ASSERT_NOT_NULL( visual ); |
|
70 visual->CreateMeshL( EHuiMeshTypeProcedural ); |
|
71 |
|
72 return KErrNone; |
|
73 } |
|
74 |
|
75 // ----------------------------------------------------------------------------- |
|
76 // CTestUiAifCoreToolkit::TestCHuiMeshVisualSetImageL |
|
77 // ----------------------------------------------------------------------------- |
|
78 // |
|
79 TInt CTestUiAifCoreToolkit::TestCHuiMeshVisualSetImageL( CStifItemParser& /*aItem*/ ) |
|
80 { |
|
81 |
|
82 // Print to UI |
|
83 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
84 _LIT( KTestCHuiMesh, "In TestCHuiMeshVisualSetImageL" ); |
|
85 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
86 // Print to log file |
|
87 iLog->Log( KTestCHuiMesh ); |
|
88 |
|
89 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
90 |
|
91 CHuiMeshVisual* visual = CHuiMeshVisual::AddNewL( *iHuiControl, EHuiMeshTypeM3G, layout ); |
|
92 STIF_ASSERT_NOT_NULL( visual ); |
|
93 THuiImage* image = new( ELeave ) THuiImage(); |
|
94 CleanupStack::PushL( image ); |
|
95 visual->SetImage( *image ); |
|
96 CleanupStack::Pop( image ); |
|
97 delete image; |
|
98 |
|
99 return KErrNone; |
|
100 } |
|
101 |
|
102 // ----------------------------------------------------------------------------- |
|
103 // CTestUiAifCoreToolkit::TestCHuiMeshVisualSetSecondaryImageL |
|
104 // ----------------------------------------------------------------------------- |
|
105 // |
|
106 TInt CTestUiAifCoreToolkit::TestCHuiMeshVisualSetSecondaryImageL( CStifItemParser& /*aItem*/ ) |
|
107 { |
|
108 |
|
109 // Print to UI |
|
110 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
111 _LIT( KTestCHuiMesh, "In TestCHuiMeshVisualSetSecondaryImageL" ); |
|
112 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
113 // Print to log file |
|
114 iLog->Log( KTestCHuiMesh ); |
|
115 |
|
116 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
117 |
|
118 CHuiMeshVisual* visual = CHuiMeshVisual::AddNewL( *iHuiControl, EHuiMeshTypeM3G, layout ); |
|
119 STIF_ASSERT_NOT_NULL( visual ); |
|
120 THuiImage* image = new( ELeave ) THuiImage(); |
|
121 CleanupStack::PushL( image ); |
|
122 visual->SetSecondaryImage( *image ); |
|
123 CleanupStack::Pop( image ); |
|
124 delete image; |
|
125 |
|
126 return KErrNone; |
|
127 } |
|
128 |
|
129 // ----------------------------------------------------------------------------- |
|
130 // CTestUiAifCoreToolkit::TestCHuiMeshVisualSetSpecularImageL |
|
131 // ----------------------------------------------------------------------------- |
|
132 // |
|
133 TInt CTestUiAifCoreToolkit::TestCHuiMeshVisualSetSpecularImageL( CStifItemParser& /*aItem*/ ) |
|
134 { |
|
135 |
|
136 // Print to UI |
|
137 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
138 _LIT( KTestCHuiMesh, "In TestCHuiMeshVisualSetSpecularImageL" ); |
|
139 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
140 // Print to log file |
|
141 iLog->Log( KTestCHuiMesh ); |
|
142 |
|
143 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
144 |
|
145 CHuiMeshVisual* visual = CHuiMeshVisual::AddNewL( *iHuiControl, EHuiMeshTypeM3G, layout ); |
|
146 STIF_ASSERT_NOT_NULL( visual ); |
|
147 THuiImage* image = new( ELeave ) THuiImage(); |
|
148 CleanupStack::PushL( image ); |
|
149 visual->SetSpecularImage( *image ); |
|
150 CleanupStack::Pop( image ); |
|
151 delete image; |
|
152 |
|
153 return KErrNone; |
|
154 } |
|
155 |
|
156 // ----------------------------------------------------------------------------- |
|
157 // CTestUiAifCoreToolkit::TestCHuiMeshVisualMeshL |
|
158 // ----------------------------------------------------------------------------- |
|
159 // |
|
160 TInt CTestUiAifCoreToolkit::TestCHuiMeshVisualMeshL( CStifItemParser& /*aItem*/ ) |
|
161 { |
|
162 |
|
163 // Print to UI |
|
164 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
165 _LIT( KTestCHuiMesh, "In TestCHuiMeshVisualMeshL" ); |
|
166 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
167 // Print to log file |
|
168 iLog->Log( KTestCHuiMesh ); |
|
169 |
|
170 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
171 CHuiMeshVisual* visual = CHuiMeshVisual::AddNewL( *iHuiControl, EHuiMeshTypeM3G, layout ); |
|
172 STIF_ASSERT_NOT_NULL( visual ); |
|
173 visual->Mesh(); |
|
174 |
|
175 return KErrNone; |
|
176 } |
|
177 |
|
178 // ----------------------------------------------------------------------------- |
|
179 // CTestUiAifCoreToolkit::TestCHuiMeshVisualProceduralMeshL |
|
180 // ----------------------------------------------------------------------------- |
|
181 // |
|
182 TInt CTestUiAifCoreToolkit::TestCHuiMeshVisualProceduralMeshL( CStifItemParser& /*aItem*/ ) |
|
183 { |
|
184 |
|
185 // Print to UI |
|
186 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
187 _LIT( KTestCHuiMesh, "In TestCHuiMeshVisualProceduralMeshL" ); |
|
188 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
189 // Print to log file |
|
190 iLog->Log( KTestCHuiMesh ); |
|
191 |
|
192 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
193 |
|
194 CHuiMeshVisual* visual = |
|
195 CHuiMeshVisual::AddNewL( *iHuiControl, EHuiMeshTypeProcedural, layout ); |
|
196 STIF_ASSERT_NOT_NULL( visual ); |
|
197 CHuiProceduralMesh* mesh = visual->ProceduralMesh(); |
|
198 STIF_ASSERT_NOT_NULL( mesh ); |
|
199 |
|
200 return KErrNone; |
|
201 } |
|
202 |
|
203 // ----------------------------------------------------------------------------- |
|
204 // CTestUiAifCoreToolkit::TestCHuiMeshVisualM3GMeshL |
|
205 // ----------------------------------------------------------------------------- |
|
206 // |
|
207 TInt CTestUiAifCoreToolkit::TestCHuiMeshVisualM3GMeshL( CStifItemParser& /*aItem*/ ) |
|
208 { |
|
209 |
|
210 // Print to UI |
|
211 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
212 _LIT( KTestCHuiMesh, "In TestCHuiMeshVisualM3GMeshL" ); |
|
213 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMesh ); |
|
214 // Print to log file |
|
215 iLog->Log( KTestCHuiMesh ); |
|
216 |
|
217 CHuiLayout* layout = CHuiLayout::AddNewL( *iHuiControl ); |
|
218 |
|
219 CHuiMeshVisual* visual = CHuiMeshVisual::AddNewL( *iHuiControl, EHuiMeshTypeM3G, layout ); |
|
220 STIF_ASSERT_NOT_NULL( visual ); |
|
221 CHuiM3GMesh* mesh = visual->M3GMesh(); |
|
222 STIF_ASSERT_NOT_NULL( mesh ); |
|
223 |
|
224 return KErrNone; |
|
225 } |