|
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 // [INCLUDE FILES] |
|
20 #include <e32svr.h> |
|
21 #include <gdi.h> |
|
22 #include <stifparser.h> |
|
23 #include <stiftestinterface.h> |
|
24 #include <uiacceltk/huienv.h> |
|
25 #include <uiacceltk/huistatic.h> |
|
26 #include <uiacceltk/huidisplaybackgrounditem.h> |
|
27 |
|
28 #include "testuiaifcoretoolkit.h" |
|
29 |
|
30 // ----------------------------------------------------------------------------- |
|
31 // CTestUiAifCoreToolkit::TestTTHuiDisplayBackgroundItemL |
|
32 // ----------------------------------------------------------------------------- |
|
33 // |
|
34 TInt CTestUiAifCoreToolkit::TestTTHuiDisplayBackgroundItemL( CStifItemParser& /*aItem*/ ) |
|
35 { |
|
36 |
|
37 // Print to UI |
|
38 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
39 _LIT( KTestTTHuiDisplayBackgroundItemL, "In TestTTHuiDisplayBackgroundItemL" ); |
|
40 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, KTestTTHuiDisplayBackgroundItemL ); |
|
41 // Print to log file |
|
42 iLog->Log( KTestTTHuiDisplayBackgroundItemL ); |
|
43 |
|
44 THuiDisplayBackgroundItem* displayItem = |
|
45 new ( ELeave ) THuiDisplayBackgroundItem(); |
|
46 |
|
47 delete displayItem; |
|
48 |
|
49 return KErrNone; |
|
50 |
|
51 } |
|
52 |
|
53 // ----------------------------------------------------------------------------- |
|
54 // CTestUiAifCoreToolkit::TestTTHuiDisplayBackgroundItemRectL |
|
55 // ----------------------------------------------------------------------------- |
|
56 // |
|
57 TInt CTestUiAifCoreToolkit::TestTTHuiDisplayBackgroundItemRectL( CStifItemParser& /*aItem*/ ) |
|
58 { |
|
59 |
|
60 // Print to UI |
|
61 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
62 _LIT( KTestTTHuiDisplayBackgroundItemRectL, |
|
63 "In TestTTHuiDisplayBackgroundItemRectL" ); |
|
64 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
65 KTestTTHuiDisplayBackgroundItemRectL ); |
|
66 // Print to log file |
|
67 iLog->Log( KTestTTHuiDisplayBackgroundItemRectL ); |
|
68 |
|
69 TRect rect( 0, 10, 0, 20); |
|
70 THuiDisplayBackgroundItem* displayItem = |
|
71 new ( ELeave ) THuiDisplayBackgroundItem( rect ); |
|
72 |
|
73 delete displayItem; |
|
74 |
|
75 return KErrNone; |
|
76 |
|
77 } |
|
78 |
|
79 // ----------------------------------------------------------------------------- |
|
80 // CTestUiAifCoreToolkit::TestTTHuiDisplayBackgroundItemItemIDL |
|
81 // ----------------------------------------------------------------------------- |
|
82 // |
|
83 TInt CTestUiAifCoreToolkit::TestTTHuiDisplayBackgroundItemItemIDL( CStifItemParser& /*aItem*/ ) |
|
84 { |
|
85 |
|
86 // Print to UI |
|
87 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
88 _LIT( KTestTTHuiDisplayBackgroundItemItemIDL, |
|
89 "In TestTTHuiDisplayBackgroundItemItemIDL" ); |
|
90 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
91 KTestTTHuiDisplayBackgroundItemItemIDL ); |
|
92 // Print to log file |
|
93 iLog->Log( KTestTTHuiDisplayBackgroundItemItemIDL ); |
|
94 |
|
95 TRect rect( 0, 10, 0, 20); |
|
96 TAknsItemID itemID = KAknsIIDQsnBgScreen; |
|
97 THuiDisplayBackgroundItem* displayItem = |
|
98 new ( ELeave ) THuiDisplayBackgroundItem( rect, itemID ); |
|
99 |
|
100 delete displayItem; |
|
101 |
|
102 return KErrNone; |
|
103 |
|
104 } |
|
105 |
|
106 // ----------------------------------------------------------------------------- |
|
107 // CTestUiAifCoreToolkit::TestTTHuiDisplayBackgroundColorL |
|
108 // ----------------------------------------------------------------------------- |
|
109 // |
|
110 TInt CTestUiAifCoreToolkit::TestTTHuiDisplayBackgroundColorL( CStifItemParser& /*aItem*/ ) |
|
111 { |
|
112 |
|
113 // Print to UI |
|
114 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
115 _LIT( KTestTTHuiDisplayBackgroundColorL, |
|
116 "In TestTTHuiDisplayBackgroundColorL" ); |
|
117 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
118 KTestTTHuiDisplayBackgroundColorL ); |
|
119 // Print to log file |
|
120 iLog->Log( KTestTTHuiDisplayBackgroundColorL ); |
|
121 |
|
122 TRect rect( 0, 10, 0, 20); |
|
123 TAknsItemID itemID = KAknsIIDQsnBgScreen; |
|
124 TInt color = 1; |
|
125 THuiDisplayBackgroundItem* displayItem = |
|
126 new ( ELeave ) THuiDisplayBackgroundItem( rect, itemID, color ); |
|
127 |
|
128 delete displayItem; |
|
129 |
|
130 return KErrNone; |
|
131 |
|
132 } |
|
133 |
|
134 // ----------------------------------------------------------------------------- |
|
135 // CTestUiAifCoreToolkit::TestTTHuiDisplayBackgroundTRgbL |
|
136 // ----------------------------------------------------------------------------- |
|
137 // |
|
138 TInt CTestUiAifCoreToolkit::TestTTHuiDisplayBackgroundTRgbL( CStifItemParser& /*aItem*/ ) |
|
139 { |
|
140 |
|
141 // Print to UI |
|
142 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
143 _LIT( KTestTTHuiDisplayBackgroundTRgbL, |
|
144 "In TestTTHuiDisplayBackgroundTRgbL" ); |
|
145 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit, |
|
146 KTestTTHuiDisplayBackgroundTRgbL ); |
|
147 // Print to log file |
|
148 iLog->Log( KTestTTHuiDisplayBackgroundTRgbL ); |
|
149 |
|
150 TRect rect( 0, 10, 0, 20); |
|
151 TRgb color; |
|
152 THuiDisplayBackgroundItem* displayItem = |
|
153 new ( ELeave ) THuiDisplayBackgroundItem( rect, color ); |
|
154 |
|
155 delete displayItem; |
|
156 |
|
157 return KErrNone; |
|
158 |
|
159 } |
|
160 |
|
161 // ----------------------------------------------------------------------------- |
|
162 // CTestUiAifCoreToolkit::TestTTHuiTestTSetRectLL |
|
163 // ----------------------------------------------------------------------------- |
|
164 // |
|
165 TInt CTestUiAifCoreToolkit::TestTTHuiTestTSetRectLL( CStifItemParser& /*aItem*/ ) |
|
166 { |
|
167 |
|
168 // Print to UI |
|
169 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
170 _LIT( KTestTTHuiTestTSetRectLL, "In TestTTHuiTestTSetRectLL" ); |
|
171 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit,KTestTTHuiTestTSetRectLL ); |
|
172 // Print to log file |
|
173 iLog->Log( KTestTTHuiTestTSetRectLL ); |
|
174 |
|
175 THuiDisplayBackgroundItem* displayItem = |
|
176 new ( ELeave ) THuiDisplayBackgroundItem(); |
|
177 CleanupStack::PushL( displayItem ); |
|
178 TRect rect; |
|
179 displayItem->SetRect( rect ); |
|
180 |
|
181 CleanupStack::PopAndDestroy( displayItem ); |
|
182 |
|
183 return KErrNone; |
|
184 |
|
185 } |
|
186 |
|
187 // ----------------------------------------------------------------------------- |
|
188 // CTestUiAifCoreToolkit::TestTTHuiSetColorL |
|
189 // ----------------------------------------------------------------------------- |
|
190 // |
|
191 TInt CTestUiAifCoreToolkit::TestTTHuiSetColorL( CStifItemParser& /*aItem*/ ) |
|
192 { |
|
193 |
|
194 // Print to UI |
|
195 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
196 _LIT( KTestTTHuiSetColorL, "In TestTTHuiSetColorL" ); |
|
197 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit,KTestTTHuiSetColorL ); |
|
198 // Print to log file |
|
199 iLog->Log( KTestTTHuiSetColorL ); |
|
200 |
|
201 THuiDisplayBackgroundItem* displayItem = |
|
202 new ( ELeave ) THuiDisplayBackgroundItem(); |
|
203 CleanupStack::PushL( displayItem ); |
|
204 TRgb color; |
|
205 displayItem->SetColor( color ); |
|
206 |
|
207 CleanupStack::PopAndDestroy( displayItem ); |
|
208 |
|
209 return KErrNone; |
|
210 |
|
211 } |
|
212 |
|
213 // ----------------------------------------------------------------------------- |
|
214 // CTestUiAifCoreToolkit::TestTTHuiSetColorItemL |
|
215 // ----------------------------------------------------------------------------- |
|
216 // |
|
217 TInt CTestUiAifCoreToolkit::TestTTHuiSetColorItemL( CStifItemParser& /*aItem*/ ) |
|
218 { |
|
219 |
|
220 // Print to UI |
|
221 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
222 _LIT( KTestTTHuiSetColorItemL, "In TestTTHuiSetColorItemL" ); |
|
223 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit,KTestTTHuiSetColorItemL ); |
|
224 // Print to log file |
|
225 iLog->Log( KTestTTHuiSetColorItemL ); |
|
226 |
|
227 THuiDisplayBackgroundItem* displayItem = |
|
228 new ( ELeave ) THuiDisplayBackgroundItem(); |
|
229 CleanupStack::PushL( displayItem ); |
|
230 |
|
231 TAknsItemID itemID = KAknsIIDQsnBgScreen; |
|
232 |
|
233 displayItem->SetColor( itemID, 1 ); |
|
234 |
|
235 CleanupStack::PopAndDestroy( displayItem ); |
|
236 |
|
237 return KErrNone; |
|
238 |
|
239 } |
|
240 |
|
241 // ----------------------------------------------------------------------------- |
|
242 // CTestUiAifCoreToolkit::TestTTHuiSetSkinBackgroundL |
|
243 // ----------------------------------------------------------------------------- |
|
244 // |
|
245 TInt CTestUiAifCoreToolkit::TestTTHuiSetSkinBackgroundL( CStifItemParser& /*aItem*/ ) |
|
246 { |
|
247 |
|
248 // Print to UI |
|
249 _LIT( Ktestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
250 _LIT( KTestTTHuiSetSkinBackgroundL, "In TestTTHuiSetSkinBackgroundL" ); |
|
251 TestModuleIf().Printf( 0, Ktestuiaifcoretoolkit,KTestTTHuiSetSkinBackgroundL ); |
|
252 // Print to log file |
|
253 iLog->Log( KTestTTHuiSetSkinBackgroundL ); |
|
254 |
|
255 THuiDisplayBackgroundItem* displayItem = |
|
256 new ( ELeave ) THuiDisplayBackgroundItem(); |
|
257 CleanupStack::PushL( displayItem ); |
|
258 |
|
259 TAknsItemID itemID = KAknsIIDQsnBgScreen; |
|
260 |
|
261 displayItem->SetSkinBackground( itemID ); |
|
262 |
|
263 CleanupStack::PopAndDestroy( displayItem ); |
|
264 |
|
265 return KErrNone; |
|
266 |
|
267 } |
|
268 |
|
269 // [End of File] |