|
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 AknPopupHeadingPane.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] |
|
21 |
|
22 #include <aknpopupheadingpane.h> |
|
23 #include <barsread.h> |
|
24 #include <coemain.h> |
|
25 #include <coeaui.h> |
|
26 #include <eiklabel.h> |
|
27 #include <akniconutils.h> |
|
28 #include <testsdkpopups.rsg> |
|
29 #include <avkon.mbg> |
|
30 |
|
31 #include "testsdkpopups.hrh" |
|
32 #include "testsdkpopups.h" |
|
33 #include "testsdkpopupscontrol.h" |
|
34 |
|
35 const TInt KLength = 20; |
|
36 // ============================ MEMBER FUNCTIONS =============================== |
|
37 // ----------------------------------------------------------------------------- |
|
38 // CTestSDKPopups::TestCPHPCAknPopupHeadingPaneL |
|
39 // ----------------------------------------------------------------------------- |
|
40 // |
|
41 TInt CTestSDKPopups::TestCPHPCAknPopupHeadingPaneL( CStifItemParser& /*aItem*/ ) |
|
42 { |
|
43 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
44 CleanupStack::PushL( headingPane ); |
|
45 STIF_ASSERT_NOT_NULL( headingPane ); |
|
46 |
|
47 CleanupStack::PopAndDestroy( headingPane ); |
|
48 |
|
49 return KErrNone; |
|
50 |
|
51 } |
|
52 |
|
53 // ----------------------------------------------------------------------------- |
|
54 // CTestSDKPopups::TestCPHPDeconstructorL |
|
55 // ----------------------------------------------------------------------------- |
|
56 // |
|
57 TInt CTestSDKPopups::TestCPHPDeconstructorL( CStifItemParser& /*aItem*/ ) |
|
58 { |
|
59 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
60 CleanupStack::PushL( headingPane ); |
|
61 STIF_ASSERT_NOT_NULL( headingPane ); |
|
62 |
|
63 CleanupStack::Pop( headingPane ); |
|
64 delete headingPane; |
|
65 |
|
66 return KErrNone; |
|
67 |
|
68 } |
|
69 |
|
70 // ----------------------------------------------------------------------------- |
|
71 // CTestSDKPopups::TestCPHPSizeChangedL |
|
72 // ----------------------------------------------------------------------------- |
|
73 // |
|
74 TInt CTestSDKPopups::TestCPHPSizeChangedL( CStifItemParser& /*aItem*/ ) |
|
75 { |
|
76 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
77 CleanupStack::PushL( headingPane ); |
|
78 STIF_ASSERT_NOT_NULL( headingPane ); |
|
79 |
|
80 TResourceReader reader; |
|
81 CCoeEnv::Static()->CreateResourceReaderLC(reader, R_TESTSDK_HEADING ); |
|
82 headingPane->ConstructFromResourceL( reader ); |
|
83 CleanupStack::PopAndDestroy(); |
|
84 |
|
85 headingPane->SizeChanged(); |
|
86 |
|
87 CleanupStack::PopAndDestroy( headingPane ); |
|
88 |
|
89 return KErrNone; |
|
90 |
|
91 } |
|
92 |
|
93 // ----------------------------------------------------------------------------- |
|
94 // CTestSDKPopups::TestCPHPMinimumSizeL |
|
95 // ----------------------------------------------------------------------------- |
|
96 // |
|
97 TInt CTestSDKPopups::TestCPHPMinimumSizeL( CStifItemParser& /*aItem*/ ) |
|
98 { |
|
99 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
100 CleanupStack::PushL( headingPane ); |
|
101 STIF_ASSERT_NOT_NULL( headingPane ); |
|
102 |
|
103 TResourceReader reader; |
|
104 CCoeEnv::Static()->CreateResourceReaderLC(reader, R_TESTSDK_HEADING ); |
|
105 headingPane->ConstructFromResourceL( reader ); |
|
106 CleanupStack::PopAndDestroy(); |
|
107 |
|
108 TSize size = headingPane->MinimumSize(); |
|
109 TPoint point = size.AsPoint(); |
|
110 STIF_ASSERT_NOT_EQUALS( point.iX, 0 ); |
|
111 STIF_ASSERT_NOT_EQUALS( point.iY, 0 ); |
|
112 |
|
113 CleanupStack::PopAndDestroy( headingPane ); |
|
114 |
|
115 return KErrNone; |
|
116 |
|
117 } |
|
118 |
|
119 // ----------------------------------------------------------------------------- |
|
120 // CTestSDKPopups::TestCPHPConstructL |
|
121 // ----------------------------------------------------------------------------- |
|
122 // |
|
123 TInt CTestSDKPopups::TestCPHPConstructL( CStifItemParser& /*aItem*/ ) |
|
124 { |
|
125 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
126 CleanupStack::PushL( headingPane ); |
|
127 STIF_ASSERT_NOT_NULL( headingPane ); |
|
128 |
|
129 _LIT( KText, "text" ); |
|
130 TBuf<KLength> text( KText ); |
|
131 headingPane->ConstructL( text ); |
|
132 |
|
133 CleanupStack::PopAndDestroy( headingPane ); |
|
134 |
|
135 return KErrNone; |
|
136 |
|
137 } |
|
138 |
|
139 // ----------------------------------------------------------------------------- |
|
140 // CTestSDKPopups::TestCPHPConstructFromResourceL |
|
141 // ----------------------------------------------------------------------------- |
|
142 // |
|
143 TInt CTestSDKPopups::TestCPHPConstructFromResourceL( CStifItemParser& /*aItem*/ ) |
|
144 { |
|
145 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
146 CleanupStack::PushL( headingPane ); |
|
147 STIF_ASSERT_NOT_NULL( headingPane ); |
|
148 |
|
149 TResourceReader reader; |
|
150 CCoeEnv::Static()->CreateResourceReaderLC(reader, R_TESTSDK_HEADING ); |
|
151 headingPane->ConstructFromResourceL( reader ); |
|
152 CleanupStack::PopAndDestroy(); |
|
153 |
|
154 CleanupStack::PopAndDestroy( headingPane ); |
|
155 |
|
156 return KErrNone; |
|
157 |
|
158 } |
|
159 |
|
160 // ----------------------------------------------------------------------------- |
|
161 // CTestSDKPopups::TestCPHPPromptL |
|
162 // ----------------------------------------------------------------------------- |
|
163 // |
|
164 TInt CTestSDKPopups::TestCPHPPromptL( CStifItemParser& /*aItem*/ ) |
|
165 { |
|
166 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
167 CleanupStack::PushL( headingPane ); |
|
168 STIF_ASSERT_NOT_NULL( headingPane ); |
|
169 |
|
170 TResourceReader reader; |
|
171 CCoeEnv::Static()->CreateResourceReaderLC(reader, R_TESTSDK_HEADING ); |
|
172 headingPane->ConstructFromResourceL( reader ); |
|
173 CleanupStack::PopAndDestroy(); |
|
174 |
|
175 CEikLabel* label = headingPane->Prompt(); |
|
176 STIF_ASSERT_NOT_NULL( label ); |
|
177 |
|
178 _LIT( KLabel, "label" ); |
|
179 STIF_ASSERT_TRUE( label->Text()->Compare( KLabel ) == 0 ); |
|
180 |
|
181 CleanupStack::PopAndDestroy( headingPane ); |
|
182 |
|
183 return KErrNone; |
|
184 |
|
185 } |
|
186 |
|
187 // ----------------------------------------------------------------------------- |
|
188 // CTestSDKPopups::TestCPHPPromptTextL |
|
189 // ----------------------------------------------------------------------------- |
|
190 // |
|
191 TInt CTestSDKPopups::TestCPHPPromptTextL( CStifItemParser& /*aItem*/ ) |
|
192 { |
|
193 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
194 CleanupStack::PushL( headingPane ); |
|
195 STIF_ASSERT_NOT_NULL( headingPane ); |
|
196 |
|
197 TResourceReader reader; |
|
198 CCoeEnv::Static()->CreateResourceReaderLC(reader, R_TESTSDK_HEADING ); |
|
199 headingPane->ConstructFromResourceL( reader ); |
|
200 CleanupStack::PopAndDestroy(); |
|
201 |
|
202 _LIT( KLabel, "label" ); |
|
203 STIF_ASSERT_TRUE( headingPane->PromptText().Compare( KLabel ) == 0 ); |
|
204 |
|
205 CleanupStack::PopAndDestroy( headingPane ); |
|
206 |
|
207 return KErrNone; |
|
208 |
|
209 } |
|
210 |
|
211 // ----------------------------------------------------------------------------- |
|
212 // CTestSDKPopups::TestCPHPSetTextL |
|
213 // ----------------------------------------------------------------------------- |
|
214 // |
|
215 TInt CTestSDKPopups::TestCPHPSetTextL( CStifItemParser& /*aItem*/ ) |
|
216 { |
|
217 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
218 CleanupStack::PushL( headingPane ); |
|
219 STIF_ASSERT_NOT_NULL( headingPane ); |
|
220 |
|
221 TResourceReader reader; |
|
222 CCoeEnv::Static()->CreateResourceReaderLC(reader, R_TESTSDK_HEADING ); |
|
223 headingPane->ConstructFromResourceL( reader ); |
|
224 CleanupStack::PopAndDestroy(); |
|
225 |
|
226 _LIT( KText, "text" ); |
|
227 TBuf<KLength> text( KText ); |
|
228 headingPane->SetTextL( text ); |
|
229 |
|
230 STIF_ASSERT_TRUE( headingPane->PromptText().Compare( text ) == 0 ); |
|
231 |
|
232 CleanupStack::PopAndDestroy( headingPane ); |
|
233 |
|
234 return KErrNone; |
|
235 |
|
236 } |
|
237 |
|
238 // ----------------------------------------------------------------------------- |
|
239 // CTestSDKPopups::TestCPHPSetHeaderImageOwnedL |
|
240 // ----------------------------------------------------------------------------- |
|
241 // |
|
242 TInt CTestSDKPopups::TestCPHPSetHeaderImageOwnedL( CStifItemParser& /*aItem*/ ) |
|
243 { |
|
244 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
245 CleanupStack::PushL( headingPane ); |
|
246 STIF_ASSERT_NOT_NULL( headingPane ); |
|
247 |
|
248 TResourceReader reader; |
|
249 CCoeEnv::Static()->CreateResourceReaderLC(reader, R_TESTSDK_HEADING ); |
|
250 headingPane->ConstructFromResourceL( reader ); |
|
251 CleanupStack::PopAndDestroy(); |
|
252 |
|
253 CEikImage* image =new (ELeave) CEikImage; |
|
254 CleanupStack::PushL( image ); |
|
255 STIF_ASSERT_NOT_NULL( image ); |
|
256 TResourceReader readerimage; |
|
257 CCoeEnv::Static()->CreateResourceReaderLC(readerimage, R_TESTSDK_IMAGE ); |
|
258 image->ConstructFromResourceL( readerimage ); |
|
259 CleanupStack::PopAndDestroy(); |
|
260 |
|
261 headingPane->SetHeaderImageOwnedL( image ); |
|
262 |
|
263 CleanupStack::Pop( image ); |
|
264 CleanupStack::PopAndDestroy( headingPane ); |
|
265 |
|
266 return KErrNone; |
|
267 |
|
268 } |
|
269 |
|
270 // ----------------------------------------------------------------------------- |
|
271 // CTestSDKPopups::TestCPHPSetHeaderImageL |
|
272 // ----------------------------------------------------------------------------- |
|
273 // |
|
274 TInt CTestSDKPopups::TestCPHPSetHeaderImageL( CStifItemParser& /*aItem*/ ) |
|
275 { |
|
276 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
277 CleanupStack::PushL( headingPane ); |
|
278 STIF_ASSERT_NOT_NULL( headingPane ); |
|
279 |
|
280 TResourceReader reader; |
|
281 CCoeEnv::Static()->CreateResourceReaderLC(reader, R_TESTSDK_HEADING ); |
|
282 headingPane->ConstructFromResourceL( reader ); |
|
283 CleanupStack::PopAndDestroy(); |
|
284 |
|
285 const TInt MaxLength = 50; |
|
286 _LIT( KFile, "\\resource\\apps\\avkon2.mbm" ); |
|
287 TBuf<MaxLength> iconFile( KFile ); |
|
288 |
|
289 CEikImage* image = new( ELeave ) CEikImage; |
|
290 CleanupStack::PushL( image ); |
|
291 CFbsBitmap* bitmap = NULL; |
|
292 CFbsBitmap* bitmapM = NULL; |
|
293 AknIconUtils::CreateIconL( bitmap, bitmapM, iconFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
294 |
|
295 CleanupStack::PushL( bitmap ); |
|
296 CleanupStack::PushL( bitmapM ); |
|
297 |
|
298 image->SetPictureOwnedExternally( TBool( 0 ) ); |
|
299 image->SetPicture( bitmap, bitmapM ); |
|
300 |
|
301 headingPane->SetHeaderImageL( image ); |
|
302 |
|
303 CleanupStack::Pop( bitmapM ); |
|
304 CleanupStack::Pop( bitmap ); |
|
305 CleanupStack::Pop( image ); |
|
306 CleanupStack::PopAndDestroy( headingPane ); |
|
307 |
|
308 return KErrNone; |
|
309 |
|
310 } |
|
311 |
|
312 // ----------------------------------------------------------------------------- |
|
313 // CTestSDKPopups::TestCPHPSetHeaderAnimationL |
|
314 // ----------------------------------------------------------------------------- |
|
315 // |
|
316 TInt CTestSDKPopups::TestCPHPSetHeaderAnimationL( CStifItemParser& /*aItem*/ ) |
|
317 { |
|
318 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
319 CleanupStack::PushL( headingPane ); |
|
320 STIF_ASSERT_NOT_NULL( headingPane ); |
|
321 |
|
322 TResourceReader reader; |
|
323 CCoeEnv::Static()->CreateResourceReaderLC(reader, R_TESTSDK_HEADING ); |
|
324 headingPane->ConstructFromResourceL( reader ); |
|
325 CleanupStack::PopAndDestroy(); |
|
326 |
|
327 headingPane->SetHeaderAnimationL( R_TESTSDK_ANIMATION ); |
|
328 |
|
329 CleanupStack::PopAndDestroy( headingPane ); |
|
330 |
|
331 return KErrNone; |
|
332 |
|
333 } |
|
334 |
|
335 // ----------------------------------------------------------------------------- |
|
336 // CTestSDKPopups::TestCPHPSetLayoutL |
|
337 // ----------------------------------------------------------------------------- |
|
338 // |
|
339 TInt CTestSDKPopups::TestCPHPSetLayoutL( CStifItemParser& /*aItem*/ ) |
|
340 { |
|
341 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
342 CleanupStack::PushL( headingPane ); |
|
343 STIF_ASSERT_NOT_NULL( headingPane ); |
|
344 |
|
345 TResourceReader reader; |
|
346 CCoeEnv::Static()->CreateResourceReaderLC(reader, R_TESTSDK_HEADING ); |
|
347 headingPane->ConstructFromResourceL( reader ); |
|
348 CleanupStack::PopAndDestroy(); |
|
349 |
|
350 headingPane->SetLayout( CAknPopupHeadingPane::EListHeadingPane ); |
|
351 |
|
352 CleanupStack::PopAndDestroy( headingPane ); |
|
353 |
|
354 return KErrNone; |
|
355 |
|
356 } |
|
357 |
|
358 // ----------------------------------------------------------------------------- |
|
359 // CTestSDKPopups::TestCPHPStartAnimationL |
|
360 // ----------------------------------------------------------------------------- |
|
361 // |
|
362 TInt CTestSDKPopups::TestCPHPStartAnimationL( CStifItemParser& /*aItem*/ ) |
|
363 { |
|
364 CTestSDKPopupsControl* control = new (ELeave) CTestSDKPopupsControl; |
|
365 CleanupStack::PushL( control ); |
|
366 STIF_ASSERT_NOT_NULL( control ); |
|
367 |
|
368 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
369 CleanupStack::PushL( headingPane ); |
|
370 STIF_ASSERT_NOT_NULL( headingPane ); |
|
371 |
|
372 headingPane->SetContainerWindowL( *control ); |
|
373 |
|
374 _LIT( KText, "text" ); |
|
375 TBuf<KLength> text( KText ); |
|
376 headingPane->ConstructL( text ); |
|
377 |
|
378 headingPane->SetLayout( CAknPopupHeadingPane::EListHeadingPane ); |
|
379 headingPane->SizeChanged(); |
|
380 |
|
381 const TInt MaxLength = 50; |
|
382 _LIT( KFile, "\\resource\\apps\\avkon2.mbm" ); |
|
383 TBuf<MaxLength> iconFile( KFile ); |
|
384 |
|
385 CEikImage* image = new( ELeave ) CEikImage; |
|
386 CleanupStack::PushL( image ); |
|
387 CFbsBitmap* bitmap = NULL; |
|
388 CFbsBitmap* bitmapM = NULL; |
|
389 AknIconUtils::CreateIconL( bitmap, bitmapM, iconFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
390 |
|
391 CleanupStack::PushL( bitmap ); |
|
392 CleanupStack::PushL( bitmapM ); |
|
393 |
|
394 image->SetPictureOwnedExternally( TBool( 0 ) ); |
|
395 image->SetPicture( bitmap, bitmapM ); |
|
396 |
|
397 headingPane->SetHeaderImageL( image ); |
|
398 |
|
399 CleanupStack::Pop( bitmapM ); |
|
400 CleanupStack::Pop( bitmap ); |
|
401 CleanupStack::Pop( image ); |
|
402 |
|
403 headingPane->SetHeaderAnimationL( R_TESTSDK_ANIMATION ); |
|
404 |
|
405 TAknsItemID aknsItemID; |
|
406 headingPane->SetSkinFrameId( aknsItemID ); |
|
407 headingPane->SetSkinFrameCenterId( aknsItemID ); |
|
408 |
|
409 headingPane->StartAnimationL(); |
|
410 |
|
411 CleanupStack::PopAndDestroy( headingPane ); |
|
412 CleanupStack::PopAndDestroy( control ); |
|
413 |
|
414 return KErrNone; |
|
415 |
|
416 } |
|
417 |
|
418 // ----------------------------------------------------------------------------- |
|
419 // CTestSDKPopups::TestCPHPCancelAnimationL |
|
420 // ----------------------------------------------------------------------------- |
|
421 // |
|
422 TInt CTestSDKPopups::TestCPHPCancelAnimationL( CStifItemParser& /*aItem*/ ) |
|
423 { |
|
424 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
425 CleanupStack::PushL( headingPane ); |
|
426 STIF_ASSERT_NOT_NULL( headingPane ); |
|
427 |
|
428 // TResourceReader reader; |
|
429 // CCoeEnv::Static()->CreateResourceReaderLC(reader, R_TESTSDK_HEADING ); |
|
430 // headingPane->ConstructFromResourceL( reader ); |
|
431 // CleanupStack::PopAndDestroy(); |
|
432 |
|
433 _LIT( KText, "text" ); |
|
434 TBuf<KLength> text( KText ); |
|
435 headingPane->ConstructL( text ); |
|
436 |
|
437 headingPane->SetLayout( CAknPopupHeadingPane::EListHeadingPane ); |
|
438 |
|
439 const TInt MaxLength = 50; |
|
440 _LIT( KFile, "\\resource\\apps\\avkon2.mbm" ); |
|
441 TBuf<MaxLength> iconFile( KFile ); |
|
442 |
|
443 CEikImage* image = new( ELeave ) CEikImage; |
|
444 CleanupStack::PushL( image ); |
|
445 CFbsBitmap* bitmap = NULL; |
|
446 CFbsBitmap* bitmapM = NULL; |
|
447 AknIconUtils::CreateIconL( bitmap, bitmapM, iconFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
448 |
|
449 CleanupStack::PushL( bitmap ); |
|
450 CleanupStack::PushL( bitmapM ); |
|
451 |
|
452 image->SetPictureOwnedExternally( TBool( 0 ) ); |
|
453 image->SetPicture( bitmap, bitmapM ); |
|
454 |
|
455 headingPane->SetHeaderImageL( image ); |
|
456 |
|
457 CleanupStack::Pop( bitmapM ); |
|
458 CleanupStack::Pop( bitmap ); |
|
459 CleanupStack::Pop( image ); |
|
460 |
|
461 CTestSDKPopupsControl* control = new (ELeave) CTestSDKPopupsControl; |
|
462 CleanupStack::PushL( control ); |
|
463 STIF_ASSERT_NOT_NULL( control ); |
|
464 |
|
465 headingPane->SetContainerWindowL( *control ); |
|
466 |
|
467 headingPane->SetHeaderAnimationL( R_TESTSDK_ANIMATION ); |
|
468 |
|
469 headingPane->StartAnimationL(); |
|
470 headingPane->CancelAnimation(); |
|
471 |
|
472 CleanupStack::PopAndDestroy( control ); |
|
473 CleanupStack::Pop( headingPane ); |
|
474 |
|
475 return KErrNone; |
|
476 |
|
477 } |
|
478 |
|
479 // ----------------------------------------------------------------------------- |
|
480 // CTestSDKPopups::TestCPHPHandlePointerEventL |
|
481 // ----------------------------------------------------------------------------- |
|
482 // |
|
483 TInt CTestSDKPopups::TestCPHPHandlePointerEventL( CStifItemParser& /*aItem*/ ) |
|
484 { |
|
485 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
486 CleanupStack::PushL( headingPane ); |
|
487 STIF_ASSERT_NOT_NULL( headingPane ); |
|
488 |
|
489 TResourceReader reader; |
|
490 CCoeEnv::Static()->CreateResourceReaderLC(reader, R_TESTSDK_HEADING ); |
|
491 headingPane->ConstructFromResourceL( reader ); |
|
492 CleanupStack::PopAndDestroy(); |
|
493 |
|
494 TPointerEvent event; |
|
495 event.iType = TPointerEvent::EButton1Down; |
|
496 headingPane->HandlePointerEventL( event ); |
|
497 |
|
498 CleanupStack::PopAndDestroy( headingPane ); |
|
499 |
|
500 return KErrNone; |
|
501 |
|
502 } |
|
503 |
|
504 // ----------------------------------------------------------------------------- |
|
505 // CTestSDKPopups::TestCPHPHandleResourceChangeL |
|
506 // ----------------------------------------------------------------------------- |
|
507 // |
|
508 TInt CTestSDKPopups::TestCPHPHandleResourceChangeL( CStifItemParser& /*aItem*/ ) |
|
509 { |
|
510 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
511 CleanupStack::PushL( headingPane ); |
|
512 STIF_ASSERT_NOT_NULL( headingPane ); |
|
513 |
|
514 TResourceReader reader; |
|
515 CCoeEnv::Static()->CreateResourceReaderLC(reader, R_TESTSDK_HEADING ); |
|
516 headingPane->ConstructFromResourceL( reader ); |
|
517 CleanupStack::PopAndDestroy(); |
|
518 |
|
519 headingPane->HandleResourceChange( KAknsMessageSkinChange ); |
|
520 headingPane->HandleResourceChange( KEikDynamicLayoutVariantSwitch ); |
|
521 |
|
522 CleanupStack::PopAndDestroy( headingPane ); |
|
523 |
|
524 return KErrNone; |
|
525 |
|
526 } |
|
527 |
|
528 // ----------------------------------------------------------------------------- |
|
529 // CTestSDKPopups::TestCPHPSetSkinFrameIdL |
|
530 // ----------------------------------------------------------------------------- |
|
531 // |
|
532 TInt CTestSDKPopups::TestCPHPSetSkinFrameIdL( CStifItemParser& /*aItem*/ ) |
|
533 { |
|
534 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
535 CleanupStack::PushL( headingPane ); |
|
536 STIF_ASSERT_NOT_NULL( headingPane ); |
|
537 |
|
538 TResourceReader reader; |
|
539 CCoeEnv::Static()->CreateResourceReaderLC(reader, R_TESTSDK_HEADING ); |
|
540 headingPane->ConstructFromResourceL( reader ); |
|
541 CleanupStack::PopAndDestroy(); |
|
542 |
|
543 CTestSDKPopupsControl* control = new (ELeave) CTestSDKPopupsControl; |
|
544 CleanupStack::PushL( control ); |
|
545 STIF_ASSERT_NOT_NULL( control ); |
|
546 |
|
547 headingPane->SetContainerWindowL( *control ); |
|
548 |
|
549 TAknsItemID aknsItemID; |
|
550 headingPane->SetSkinFrameId( aknsItemID ); |
|
551 |
|
552 CleanupStack::PopAndDestroy( control ); |
|
553 CleanupStack::PopAndDestroy( headingPane ); |
|
554 |
|
555 return KErrNone; |
|
556 |
|
557 } |
|
558 |
|
559 // ----------------------------------------------------------------------------- |
|
560 // CTestSDKPopups::TestCPHPSetSkinFrameCenterIdL |
|
561 // ----------------------------------------------------------------------------- |
|
562 // |
|
563 TInt CTestSDKPopups::TestCPHPSetSkinFrameCenterIdL( CStifItemParser& /*aItem*/ ) |
|
564 { |
|
565 CAknPopupHeadingPane* headingPane = new (ELeave) CAknPopupHeadingPane; |
|
566 CleanupStack::PushL( headingPane ); |
|
567 STIF_ASSERT_NOT_NULL( headingPane ); |
|
568 |
|
569 TResourceReader reader; |
|
570 CCoeEnv::Static()->CreateResourceReaderLC(reader, R_TESTSDK_HEADING ); |
|
571 headingPane->ConstructFromResourceL( reader ); |
|
572 CleanupStack::PopAndDestroy(); |
|
573 |
|
574 CTestSDKPopupsControl* control = new (ELeave) CTestSDKPopupsControl; |
|
575 CleanupStack::PushL( control ); |
|
576 STIF_ASSERT_NOT_NULL( control ); |
|
577 |
|
578 headingPane->SetContainerWindowL( *control ); |
|
579 |
|
580 TAknsItemID aknsItemID; |
|
581 headingPane->SetSkinFrameCenterId( aknsItemID ); |
|
582 |
|
583 CleanupStack::PopAndDestroy( control ); |
|
584 CleanupStack::PopAndDestroy( headingPane ); |
|
585 |
|
586 return KErrNone; |
|
587 |
|
588 } |