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/huiborderbrush.h> |
|
25 |
|
26 #include "testuiaifcoretoolkit.h" |
|
27 // ----------------------------------------------------------------------------- |
|
28 // CTestUiAifCoreToolkit::TestCHuiBdeBrshNewL |
|
29 // ----------------------------------------------------------------------------- |
|
30 // |
|
31 TInt CTestUiAifCoreToolkit::TestCHuiBdeBrshNewL( CStifItemParser& /*aItem*/ ) |
|
32 { |
|
33 |
|
34 // Print to UI |
|
35 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
36 _LIT( KTestCHuiBdeBrshNewL, "In TestCHuiBdeBrshNewL" ); |
|
37 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestCHuiBdeBrshNewL ); |
|
38 // Print to log file |
|
39 iLog->Log( KTestCHuiBdeBrshNewL ); |
|
40 |
|
41 THuiXYMetric aThickness; |
|
42 THuiXYMetric aEdgeOffset; |
|
43 CHuiBorderBrush* borderBrush = CHuiBorderBrush::NewL( aThickness, aEdgeOffset ); |
|
44 STIF_ASSERT_NOT_NULL( borderBrush ); |
|
45 CleanupStack::PushL( borderBrush ); |
|
46 CleanupStack::PopAndDestroy( borderBrush ); |
|
47 |
|
48 return KErrNone; |
|
49 } |
|
50 // ----------------------------------------------------------------------------- |
|
51 // CTestUiAifCoreToolkit::TestCHuiBdeBrshNewCL |
|
52 // ----------------------------------------------------------------------------- |
|
53 // |
|
54 TInt CTestUiAifCoreToolkit::TestCHuiBdeBrshNewCL( CStifItemParser& /*aItem*/ ) |
|
55 { |
|
56 |
|
57 // Print to UI |
|
58 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
59 _LIT( KTestCHuiBdeBrshNewCL, "In TestCHuiBdeBrshNewCL" ); |
|
60 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestCHuiBdeBrshNewCL ); |
|
61 // Print to log file |
|
62 iLog->Log( KTestCHuiBdeBrshNewCL ); |
|
63 |
|
64 THuiXYMetric aThickness; |
|
65 THuiXYMetric aEdgeOffset; |
|
66 CHuiBorderBrush* borderBrush = CHuiBorderBrush::NewLC( aThickness, aEdgeOffset ); |
|
67 STIF_ASSERT_NOT_NULL( borderBrush ); |
|
68 CleanupStack::PopAndDestroy( borderBrush ); |
|
69 |
|
70 return KErrNone; |
|
71 } |
|
72 // ----------------------------------------------------------------------------- |
|
73 // CTestUiAifCoreToolkit::TestCHuiBdeBrshOtherNewL |
|
74 // ----------------------------------------------------------------------------- |
|
75 // |
|
76 TInt CTestUiAifCoreToolkit::TestCHuiBdeBrshOtherNewL( CStifItemParser& /*aItem*/ ) |
|
77 { |
|
78 |
|
79 // Print to UI |
|
80 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
81 _LIT( KTestCHuiBdeBrshOtherNewL, "In TestCHuiBdeBrshOtherNewL" ); |
|
82 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestCHuiBdeBrshOtherNewL ); |
|
83 // Print to log file |
|
84 iLog->Log( KTestCHuiBdeBrshOtherNewL ); |
|
85 |
|
86 THuiXYMetric aThickness; |
|
87 THuiXYMetric aEdgeOffset; |
|
88 CHuiBorderBrush* borderBrush = CHuiBorderBrush::NewL( 2, 2, 1 ,1 ); |
|
89 STIF_ASSERT_NOT_NULL( borderBrush ); |
|
90 CleanupStack::PushL( borderBrush ); |
|
91 CleanupStack::PopAndDestroy( borderBrush ); |
|
92 |
|
93 return KErrNone; |
|
94 } |
|
95 // ----------------------------------------------------------------------------- |
|
96 // CTestUiAifCoreToolkit::TestCHuiBdeBrshOtherNewCL |
|
97 // ----------------------------------------------------------------------------- |
|
98 // |
|
99 TInt CTestUiAifCoreToolkit::TestCHuiBdeBrshOtherNewCL( CStifItemParser& /*aItem*/ ) |
|
100 { |
|
101 |
|
102 // Print to UI |
|
103 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
104 _LIT( KTestCHuiBdeBrshOtherNewCL, "In TestCHuiBdeBrshOtherNewCL" ); |
|
105 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestCHuiBdeBrshOtherNewCL ); |
|
106 // Print to log file |
|
107 iLog->Log( KTestCHuiBdeBrshOtherNewCL ); |
|
108 |
|
109 THuiXYMetric aThickness; |
|
110 THuiXYMetric aEdgeOffset; |
|
111 CHuiBorderBrush* borderBrush = CHuiBorderBrush::NewLC( 0, 0 ,0, 0 ); |
|
112 STIF_ASSERT_NOT_NULL( borderBrush ); |
|
113 CleanupStack::PopAndDestroy( borderBrush ); |
|
114 |
|
115 return KErrNone; |
|
116 } |
|
117 // ----------------------------------------------------------------------------- |
|
118 // CTestUiAifCoreToolkit::TestCHuiBdeBrshSetImageL |
|
119 // ----------------------------------------------------------------------------- |
|
120 // |
|
121 TInt CTestUiAifCoreToolkit::TestCHuiBdeBrshSetImageL( CStifItemParser& /*aItem*/ ) |
|
122 { |
|
123 |
|
124 // Print to UI |
|
125 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
126 _LIT( KTestCHuiBdeBrshSetImageL, "In TestCHuiBdeBrshSetImageL" ); |
|
127 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestCHuiBdeBrshSetImageL ); |
|
128 // Print to log file |
|
129 iLog->Log( KTestCHuiBdeBrshSetImageL ); |
|
130 |
|
131 CHuiBorderBrush* borderBrush = CHuiBorderBrush::NewL( 2, 2, 1 ,1 ); |
|
132 STIF_ASSERT_NOT_NULL( borderBrush ); |
|
133 CleanupStack::PushL( borderBrush ); |
|
134 CHuiTexture& texture = iHuiEnv->TextureManager().BlankTexture(); |
|
135 THuiImage aImage( texture ); |
|
136 borderBrush->SetImage( aImage ); |
|
137 CleanupStack::PopAndDestroy( borderBrush ); |
|
138 |
|
139 return KErrNone; |
|
140 } |
|
141 // ----------------------------------------------------------------------------- |
|
142 // CTestUiAifCoreToolkit::TestCHuiBdeBrshSetColorL |
|
143 // ----------------------------------------------------------------------------- |
|
144 // |
|
145 TInt CTestUiAifCoreToolkit::TestCHuiBdeBrshSetColorL( CStifItemParser& /*aItem*/ ) |
|
146 { |
|
147 |
|
148 // Print to UI |
|
149 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
150 _LIT( KTestCHuiBdeBrshSetColorL, "In TestCHuiBdeBrshSetColorL" ); |
|
151 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestCHuiBdeBrshSetColorL ); |
|
152 // Print to log file |
|
153 iLog->Log( KTestCHuiBdeBrshSetColorL ); |
|
154 |
|
155 CHuiBorderBrush* borderBrush = CHuiBorderBrush::NewL( 2, 2, 1 ,1 ); |
|
156 STIF_ASSERT_NOT_NULL( borderBrush ); |
|
157 CleanupStack::PushL( borderBrush ); |
|
158 borderBrush->SetColor( KRgbBlue ); |
|
159 CleanupStack::PopAndDestroy( borderBrush ); |
|
160 |
|
161 return KErrNone; |
|
162 } |
|
163 // ----------------------------------------------------------------------------- |
|
164 // CTestUiAifCoreToolkit::TestCHuiBdeBrshSetThicknessL |
|
165 // ----------------------------------------------------------------------------- |
|
166 // |
|
167 TInt CTestUiAifCoreToolkit::TestCHuiBdeBrshSetThicknessL( CStifItemParser& /*aItem*/ ) |
|
168 { |
|
169 |
|
170 // Print to UI |
|
171 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
172 _LIT( KTestCHuiBdeBrshSetThicknessL, "In TestCHuiBdeBrshSetThicknessL" ); |
|
173 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestCHuiBdeBrshSetThicknessL ); |
|
174 // Print to log file |
|
175 iLog->Log( KTestCHuiBdeBrshSetThicknessL ); |
|
176 |
|
177 CHuiBorderBrush* borderBrush = CHuiBorderBrush::NewL( 2, 2, 1 ,1 ); |
|
178 STIF_ASSERT_NOT_NULL( borderBrush ); |
|
179 CleanupStack::PushL( borderBrush ); |
|
180 THuiXYMetric aThickness; |
|
181 borderBrush->SetThickness( aThickness ); |
|
182 CleanupStack::PopAndDestroy( borderBrush ); |
|
183 |
|
184 return KErrNone; |
|
185 } |
|
186 // ----------------------------------------------------------------------------- |
|
187 // CTestUiAifCoreToolkit::TestCHuiBdeBrshSetEdgeOffsetL |
|
188 // ----------------------------------------------------------------------------- |
|
189 // |
|
190 TInt CTestUiAifCoreToolkit::TestCHuiBdeBrshSetEdgeOffsetL( CStifItemParser& /*aItem*/ ) |
|
191 { |
|
192 |
|
193 // Print to UI |
|
194 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
195 _LIT( KTestCHuiBdeBrshSetEdgeOffsetL, "In TestCHuiBdeBrshSetEdgeOffsetL" ); |
|
196 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestCHuiBdeBrshSetEdgeOffsetL ); |
|
197 // Print to log file |
|
198 iLog->Log( KTestCHuiBdeBrshSetEdgeOffsetL ); |
|
199 |
|
200 CHuiBorderBrush* borderBrush = CHuiBorderBrush::NewL( 2, 2, 1 ,1 ); |
|
201 STIF_ASSERT_NOT_NULL( borderBrush ); |
|
202 CleanupStack::PushL( borderBrush ); |
|
203 THuiXYMetric aEdgeOffset; |
|
204 borderBrush->SetEdgeOffset( aEdgeOffset ); |
|
205 CleanupStack::PopAndDestroy( borderBrush ); |
|
206 |
|
207 return KErrNone; |
|
208 } |
|
209 // ----------------------------------------------------------------------------- |
|
210 // CTestUiAifCoreToolkit::TestCHuiBdeBrshSetImageOffsetL |
|
211 // ----------------------------------------------------------------------------- |
|
212 // |
|
213 TInt CTestUiAifCoreToolkit::TestCHuiBdeBrshSetImageOffsetL( CStifItemParser& /*aItem*/ ) |
|
214 { |
|
215 |
|
216 // Print to UI |
|
217 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
218 _LIT( KTestCHuiBdeBrshSetImageOffsetL, "In TestCHuiBdeBrshSetImageOffsetL" ); |
|
219 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestCHuiBdeBrshSetImageOffsetL ); |
|
220 // Print to log file |
|
221 iLog->Log( KTestCHuiBdeBrshSetImageOffsetL ); |
|
222 |
|
223 CHuiBorderBrush* borderBrush = CHuiBorderBrush::NewL( 2, 2, 1 ,1 ); |
|
224 STIF_ASSERT_NOT_NULL( borderBrush ); |
|
225 CleanupStack::PushL( borderBrush ); |
|
226 THuiXYMetric aImageOffset; |
|
227 borderBrush->SetImageOffset( aImageOffset ); |
|
228 CleanupStack::PopAndDestroy( borderBrush ); |
|
229 |
|
230 return KErrNone; |
|
231 } |
|
232 |
|
233 // [End of File] |
|