|
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/huimetric.h> |
|
25 #include <uiacceltk/huienv.h> |
|
26 #include <uiacceltk/huicontrol.h> |
|
27 #include <uiacceltk/huilayout.h> |
|
28 |
|
29 #include "testuiaifcoretoolkit.h" |
|
30 |
|
31 // ==================================THuiMetric================================= |
|
32 // ----------------------------------------------------------------------------- |
|
33 // CTestUiAifCoreToolkit::TestTHMConstructor |
|
34 // ----------------------------------------------------------------------------- |
|
35 // |
|
36 TInt CTestUiAifCoreToolkit::TestTHMConstructor( CStifItemParser& /*aItem*/ ) |
|
37 { |
|
38 |
|
39 // Print to UI |
|
40 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
41 _LIT( KTestCHuiMetric, "In TestTHMConstructor" ); |
|
42 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMetric ); |
|
43 // Print to log file |
|
44 iLog->Log( KTestCHuiMetric ); |
|
45 |
|
46 THuiMetric metric; |
|
47 |
|
48 return KErrNone; |
|
49 } |
|
50 |
|
51 // ----------------------------------------------------------------------------- |
|
52 // CTestUiAifCoreToolkit::TestTHMConstructorWithPixel |
|
53 // ----------------------------------------------------------------------------- |
|
54 // |
|
55 TInt CTestUiAifCoreToolkit::TestTHMConstructorWithPixel( CStifItemParser& /*aItem*/ ) |
|
56 { |
|
57 |
|
58 // Print to UI |
|
59 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
60 _LIT( KTestCHuiMetric, "In TestTHMConstructorWithPixel" ); |
|
61 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMetric ); |
|
62 // Print to log file |
|
63 iLog->Log( KTestCHuiMetric ); |
|
64 |
|
65 THuiMetric metric( 1 ); |
|
66 |
|
67 return KErrNone; |
|
68 } |
|
69 |
|
70 // ----------------------------------------------------------------------------- |
|
71 // CTestUiAifCoreToolkit::TestTHMAbs |
|
72 // ----------------------------------------------------------------------------- |
|
73 // |
|
74 TInt CTestUiAifCoreToolkit::TestTHMAbs( CStifItemParser& /*aItem*/ ) |
|
75 { |
|
76 |
|
77 // Print to UI |
|
78 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
79 _LIT( KTestCHuiMetric, "In TestTHMAbs" ); |
|
80 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMetric ); |
|
81 // Print to log file |
|
82 iLog->Log( KTestCHuiMetric ); |
|
83 |
|
84 THuiMetric metric; |
|
85 metric.Abs(); |
|
86 |
|
87 return KErrNone; |
|
88 } |
|
89 |
|
90 // ----------------------------------------------------------------------------- |
|
91 // CTestUiAifCoreToolkit::TestTHMoperator |
|
92 // ----------------------------------------------------------------------------- |
|
93 // |
|
94 TInt CTestUiAifCoreToolkit::TestTHMoperator( CStifItemParser& /*aItem*/ ) |
|
95 { |
|
96 |
|
97 // Print to UI |
|
98 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
99 _LIT( KTestCHuiMetric, "In TestTHMoperator" ); |
|
100 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMetric ); |
|
101 // Print to log file |
|
102 iLog->Log( KTestCHuiMetric ); |
|
103 |
|
104 THuiMetric metric; |
|
105 metric = metric * 1; |
|
106 |
|
107 return KErrNone; |
|
108 } |
|
109 |
|
110 // =================================THuiXYMetric================================ |
|
111 // ----------------------------------------------------------------------------- |
|
112 // CTestUiAifCoreToolkit::TestTHXYMConstructor |
|
113 // ----------------------------------------------------------------------------- |
|
114 // |
|
115 TInt CTestUiAifCoreToolkit::TestTHXYMConstructor( CStifItemParser& /*aItem*/ ) |
|
116 { |
|
117 |
|
118 // Print to UI |
|
119 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
120 _LIT( KTestCHuiMetric, "In TestTHXYMConstructor" ); |
|
121 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMetric ); |
|
122 // Print to log file |
|
123 iLog->Log( KTestCHuiMetric ); |
|
124 |
|
125 THuiXYMetric metric; |
|
126 |
|
127 return KErrNone; |
|
128 } |
|
129 |
|
130 // ----------------------------------------------------------------------------- |
|
131 // CTestUiAifCoreToolkit::TestTHXYMConstructorWithMetric |
|
132 // ----------------------------------------------------------------------------- |
|
133 // |
|
134 TInt CTestUiAifCoreToolkit::TestTHXYMConstructorWithMetric( CStifItemParser& /*aItem*/ ) |
|
135 { |
|
136 |
|
137 // Print to UI |
|
138 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
139 _LIT( KTestCHuiMetric, "In TestTHXYMConstructorWithMetric" ); |
|
140 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMetric ); |
|
141 // Print to log file |
|
142 iLog->Log( KTestCHuiMetric ); |
|
143 |
|
144 THuiMetric metric; |
|
145 THuiXYMetric xyMetric( metric ); |
|
146 |
|
147 return KErrNone; |
|
148 } |
|
149 |
|
150 // ----------------------------------------------------------------------------- |
|
151 // CTestUiAifCoreToolkit::TestTHXYMConstructorWithTwo |
|
152 // ----------------------------------------------------------------------------- |
|
153 // |
|
154 TInt CTestUiAifCoreToolkit::TestTHXYMConstructorWithTwo( CStifItemParser& /*aItem*/ ) |
|
155 { |
|
156 |
|
157 // Print to UI |
|
158 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
159 _LIT( KTestCHuiMetric, "In TestTHXYMConstructorWithTwo" ); |
|
160 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMetric ); |
|
161 // Print to log file |
|
162 iLog->Log( KTestCHuiMetric ); |
|
163 |
|
164 THuiMetric metric1; |
|
165 THuiMetric metric2; |
|
166 THuiXYMetric xyMetric( metric1, metric2 ); |
|
167 |
|
168 return KErrNone; |
|
169 } |
|
170 |
|
171 // ----------------------------------------------------------------------------- |
|
172 // CTestUiAifCoreToolkit::TestTHXYMoperator |
|
173 // ----------------------------------------------------------------------------- |
|
174 // |
|
175 TInt CTestUiAifCoreToolkit::TestTHXYMoperator( CStifItemParser& /*aItem*/ ) |
|
176 { |
|
177 |
|
178 // Print to UI |
|
179 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
180 _LIT( KTestCHuiMetric, "In TestTHXYMoperator" ); |
|
181 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMetric ); |
|
182 // Print to log file |
|
183 iLog->Log( KTestCHuiMetric ); |
|
184 |
|
185 THuiXYMetric metric; |
|
186 THuiRealPoint point( 1, 1 ); |
|
187 metric = metric * point; |
|
188 |
|
189 return KErrNone; |
|
190 } |
|
191 |
|
192 // ----------------------------------------------------------------------------- |
|
193 // CTestUiAifCoreToolkit::TestTHXYMAbs |
|
194 // ----------------------------------------------------------------------------- |
|
195 // |
|
196 TInt CTestUiAifCoreToolkit::TestTHXYMAbs( CStifItemParser& /*aItem*/ ) |
|
197 { |
|
198 |
|
199 // Print to UI |
|
200 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
201 _LIT( KTestCHuiMetric, "In TestTHXYMAbs" ); |
|
202 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMetric ); |
|
203 // Print to log file |
|
204 iLog->Log( KTestCHuiMetric ); |
|
205 |
|
206 THuiXYMetric metric; |
|
207 metric.Abs(); |
|
208 |
|
209 return KErrNone; |
|
210 } |
|
211 |
|
212 // ================================THuiBoxMetric================================ |
|
213 // ----------------------------------------------------------------------------- |
|
214 // CTestUiAifCoreToolkit::TestTHBMConstructor |
|
215 // ----------------------------------------------------------------------------- |
|
216 // |
|
217 TInt CTestUiAifCoreToolkit::TestTHBMConstructor( CStifItemParser& /*aItem*/ ) |
|
218 { |
|
219 |
|
220 // Print to UI |
|
221 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
222 _LIT( KTestCHuiMetric, "In TestTHBMConstructor" ); |
|
223 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMetric ); |
|
224 // Print to log file |
|
225 iLog->Log( KTestCHuiMetric ); |
|
226 |
|
227 THuiBoxMetric metric; |
|
228 |
|
229 return KErrNone; |
|
230 } |
|
231 |
|
232 // ----------------------------------------------------------------------------- |
|
233 // CTestUiAifCoreToolkit::TestTHBMConstructorWithMetric |
|
234 // ----------------------------------------------------------------------------- |
|
235 // |
|
236 TInt CTestUiAifCoreToolkit::TestTHBMConstructorWithMetric( CStifItemParser& /*aItem*/ ) |
|
237 { |
|
238 |
|
239 // Print to UI |
|
240 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
241 _LIT( KTestCHuiMetric, "In TestTHBMConstructorWithMetric" ); |
|
242 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMetric ); |
|
243 // Print to log file |
|
244 iLog->Log( KTestCHuiMetric ); |
|
245 |
|
246 THuiMetric metric; |
|
247 THuiBoxMetric boxMetric( metric ); |
|
248 |
|
249 return KErrNone; |
|
250 } |
|
251 |
|
252 // ----------------------------------------------------------------------------- |
|
253 // CTestUiAifCoreToolkit::TestTHBMConstructorWithXYMetric |
|
254 // ----------------------------------------------------------------------------- |
|
255 // |
|
256 TInt CTestUiAifCoreToolkit::TestTHBMConstructorWithXYMetric( CStifItemParser& /*aItem*/ ) |
|
257 { |
|
258 |
|
259 // Print to UI |
|
260 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
261 _LIT( KTestCHuiMetric, "In TestTHBMConstructorWithXYMetric" ); |
|
262 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMetric ); |
|
263 // Print to log file |
|
264 iLog->Log( KTestCHuiMetric ); |
|
265 |
|
266 THuiMetric metric; |
|
267 THuiXYMetric xyMetric( metric ); |
|
268 THuiBoxMetric boxMetric( xyMetric ); |
|
269 |
|
270 return KErrNone; |
|
271 } |
|
272 |
|
273 // ----------------------------------------------------------------------------- |
|
274 // CTestUiAifCoreToolkit::TestTHBMConstructorWithTwo |
|
275 // ----------------------------------------------------------------------------- |
|
276 // |
|
277 TInt CTestUiAifCoreToolkit::TestTHBMConstructorWithTwo( CStifItemParser& /*aItem*/ ) |
|
278 { |
|
279 |
|
280 // Print to UI |
|
281 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
282 _LIT( KTestCHuiMetric, "In TestTHBMConstructorWithTwo" ); |
|
283 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMetric ); |
|
284 // Print to log file |
|
285 iLog->Log( KTestCHuiMetric ); |
|
286 |
|
287 THuiMetric metric; |
|
288 THuiXYMetric xyMetric1( metric ); |
|
289 THuiXYMetric xyMetric2( metric ); |
|
290 THuiBoxMetric boxMetric( xyMetric1, xyMetric2 ); |
|
291 |
|
292 return KErrNone; |
|
293 } |
|
294 |
|
295 // ----------------------------------------------------------------------------- |
|
296 // CTestUiAifCoreToolkit::TestTHBMConstructorWithFour |
|
297 // ----------------------------------------------------------------------------- |
|
298 // |
|
299 TInt CTestUiAifCoreToolkit::TestTHBMConstructorWithFour( CStifItemParser& /*aItem*/ ) |
|
300 { |
|
301 |
|
302 // Print to UI |
|
303 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
304 _LIT( KTestCHuiMetric, "In TestTHBMConstructorWithFour" ); |
|
305 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KTestCHuiMetric ); |
|
306 // Print to log file |
|
307 iLog->Log( KTestCHuiMetric ); |
|
308 |
|
309 THuiMetric metric1; |
|
310 THuiMetric metric2; |
|
311 THuiMetric metric3; |
|
312 THuiMetric metric4; |
|
313 THuiBoxMetric boxMetric( metric1, metric2, metric3, metric4 ); |
|
314 |
|
315 return KErrNone; |
|
316 } |