|
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 in eikcmbut.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] |
|
21 #include <e32svr.h> |
|
22 #include <stifparser.h> |
|
23 #include <stiftestinterface.h> |
|
24 #include <testsdkbuttons.rsg> |
|
25 #include <akniconutils.h> |
|
26 #include <avkon.mbg> |
|
27 #include <s32mem.h> |
|
28 #include <s32file.h> |
|
29 #include <eikcmbut.h> |
|
30 #include <eikalign.h> |
|
31 #include <eiklabel.h> |
|
32 |
|
33 #include "testsdkbuttons.h" |
|
34 #include "testsdkbuttons.hrh" |
|
35 |
|
36 // CONSTANTS |
|
37 const TInt KArraySize = 10; |
|
38 const TInt KHBufSize = 20000; |
|
39 const TInt KBufSize = 64; |
|
40 _LIT( KBitmapFile, "Z:\\resource\\apps\\avkon2.mbm" ); |
|
41 |
|
42 // FORWARD DECLARATIONS |
|
43 // This class is used for testing functions in CEikCommandButtonBase |
|
44 // because it's constructor is protected. |
|
45 class CTestCmdBtBase : public CEikCommandButtonBase |
|
46 { |
|
47 public: |
|
48 /* |
|
49 * constructor |
|
50 * */ |
|
51 CTestCmdBtBase(); |
|
52 /* |
|
53 * deconstructor |
|
54 * */ |
|
55 ~CTestCmdBtBase(); |
|
56 |
|
57 // test protect functon |
|
58 // test StateChanged |
|
59 void DoStateChanged(); |
|
60 |
|
61 // test Draw |
|
62 void DoDraw(const TRect& aRect); |
|
63 |
|
64 // test WriteInternalStateL |
|
65 void DoWriteInternalStateL( RWriteStream& aStream ); |
|
66 |
|
67 // test SetTextL |
|
68 void DoSetTextL( const TDesC& aText ); |
|
69 |
|
70 // test SetPictureL |
|
71 void DoSetPictureL( const CFbsBitmap* aMain,const CFbsBitmap* aMask ); |
|
72 |
|
73 // test SetPictureFromFileL |
|
74 void DoSetPictureFromFileL( const TDesC& aFilename,TInt aMain,TInt aMask ); |
|
75 |
|
76 // set components, aIndex is a number in array. The value is 0 or 1. |
|
77 TInt SetComponentsL( TInt aIndex ); |
|
78 |
|
79 }; |
|
80 // ----------------------------------------------------------------------------- |
|
81 // CTestCmdBtBase::CTestCmdBtBase |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 CTestCmdBtBase::CTestCmdBtBase(){} |
|
85 |
|
86 // ----------------------------------------------------------------------------- |
|
87 // CTestCmdBtBase::~CTestCmdBtBase |
|
88 // ----------------------------------------------------------------------------- |
|
89 // |
|
90 CTestCmdBtBase::~CTestCmdBtBase(){} |
|
91 |
|
92 // ----------------------------------------------------------------------------- |
|
93 // CTestCmdBtBase::DoStateChanged |
|
94 // ----------------------------------------------------------------------------- |
|
95 // |
|
96 void CTestCmdBtBase::DoStateChanged() |
|
97 { |
|
98 StateChanged(); |
|
99 } |
|
100 // ----------------------------------------------------------------------------- |
|
101 // CTestCmdBtBase::DoWriteInternalStateL |
|
102 // ----------------------------------------------------------------------------- |
|
103 // |
|
104 void CTestCmdBtBase::DoWriteInternalStateL( RWriteStream& aStream ) |
|
105 { |
|
106 WriteInternalStateL( aStream ); |
|
107 } |
|
108 |
|
109 // ----------------------------------------------------------------------------- |
|
110 // CTestCmdBtBase::DoSetTextL |
|
111 // ----------------------------------------------------------------------------- |
|
112 // |
|
113 void CTestCmdBtBase::DoSetTextL( const TDesC& aText ) |
|
114 { |
|
115 SetTextL( aText, iComponents[0] ); |
|
116 } |
|
117 |
|
118 // ----------------------------------------------------------------------------- |
|
119 // CTestCmdBtBase::DoSetPictureL |
|
120 // ----------------------------------------------------------------------------- |
|
121 // |
|
122 void CTestCmdBtBase::DoSetPictureL( const CFbsBitmap* aMain,const CFbsBitmap* aMask ) |
|
123 { |
|
124 SetPictureL( aMain, aMask, iComponents[0] ); |
|
125 } |
|
126 |
|
127 // ----------------------------------------------------------------------------- |
|
128 // CTestCmdBtBase::DoSetPictureFromFileL |
|
129 // ----------------------------------------------------------------------------- |
|
130 // |
|
131 void CTestCmdBtBase::DoSetPictureFromFileL( const TDesC& aFilename,TInt aMain,TInt aMask ) |
|
132 { |
|
133 SetPictureFromFileL( aFilename, aMain, aMask, iComponents[0] ); |
|
134 } |
|
135 |
|
136 |
|
137 // ----------------------------------------------------------------------------- |
|
138 // CTestCmdBtBase::DoDraw |
|
139 // ----------------------------------------------------------------------------- |
|
140 // |
|
141 void CTestCmdBtBase::DoDraw(const TRect& aRect) |
|
142 { |
|
143 Draw( aRect ); |
|
144 } |
|
145 |
|
146 // ----------------------------------------------------------------------------- |
|
147 // CTestCmdBtBase::SetComponentsL |
|
148 // ----------------------------------------------------------------------------- |
|
149 // |
|
150 TInt CTestCmdBtBase::SetComponentsL( TInt aIndex ) |
|
151 { |
|
152 const TInt marginsize = 2; |
|
153 switch ( aIndex ) |
|
154 { |
|
155 case 0: |
|
156 { |
|
157 CEikAlignedControl* component = new ( ELeave ) CEikAlignedControl; |
|
158 component->SetAllMarginsTo( marginsize ); |
|
159 component->SetAlignment( EHLeftVCenter ); |
|
160 iComponents[0] = component; |
|
161 break; |
|
162 } |
|
163 case 1: |
|
164 { |
|
165 CEikAlignedControl* component = new ( ELeave ) CEikAlignedControl; |
|
166 component->SetAllMarginsTo( marginsize ); |
|
167 component->SetAlignment( EHLeftVCenter ); |
|
168 iComponents[1] = component; |
|
169 break; |
|
170 } |
|
171 default: |
|
172 return -1; |
|
173 } |
|
174 return 0; |
|
175 } |
|
176 |
|
177 // ============================ MEMBER FUNCTIONS =============================== |
|
178 |
|
179 // ----------------------------------------------------------------------------- |
|
180 // CTestSDKButtons::TestCEikCmdBtBaseConstrutorL |
|
181 // ----------------------------------------------------------------------------- |
|
182 // |
|
183 TInt CTestSDKButtons::TestCEikCmdBtBaseConstrutorL( CStifItemParser& /*aItem*/ ) |
|
184 { |
|
185 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
186 CleanupStack::PushL( cmdbtbase ); |
|
187 STIF_ASSERT_NOT_NULL( cmdbtbase ); |
|
188 CleanupStack::PopAndDestroy( cmdbtbase ); |
|
189 |
|
190 return KErrNone; |
|
191 } |
|
192 |
|
193 // ----------------------------------------------------------------------------- |
|
194 // CTestSDKButtons::TestCEikCmdBtBaseSetButtonLayoutL |
|
195 // ----------------------------------------------------------------------------- |
|
196 // |
|
197 TInt CTestSDKButtons::TestCEikCmdBtBaseSetButtonLayoutL( CStifItemParser& /*aItem*/ ) |
|
198 { |
|
199 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
200 CleanupStack::PushL( cmdbtbase ); |
|
201 CEikCommandButtonBase::TLayout layout = CEikCommandButtonBase::EFirstRightSecondLeft; |
|
202 cmdbtbase->SetButtonLayout( layout ); |
|
203 CleanupStack::PopAndDestroy(); |
|
204 |
|
205 return KErrNone; |
|
206 } |
|
207 |
|
208 // ----------------------------------------------------------------------------- |
|
209 // CTestSDKButtons::TestCEikCmdBtBaseSetExcessSpaceL |
|
210 // ----------------------------------------------------------------------------- |
|
211 // |
|
212 TInt CTestSDKButtons::TestCEikCmdBtBaseSetExcessSpaceL( CStifItemParser& /*aItem*/ ) |
|
213 { |
|
214 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
215 CleanupStack::PushL( cmdbtbase ); |
|
216 CEikCommandButtonBase::TExcess excess = CEikCommandButtonBase::EToFirst; |
|
217 cmdbtbase->SetExcessSpace( excess ); |
|
218 CleanupStack::PopAndDestroy(); |
|
219 |
|
220 return KErrNone; |
|
221 } |
|
222 |
|
223 // ----------------------------------------------------------------------------- |
|
224 // CTestSDKButtons::TestCEikCmdBtBaseSetDisplayContentL |
|
225 // ----------------------------------------------------------------------------- |
|
226 // |
|
227 TInt CTestSDKButtons::TestCEikCmdBtBaseSetDisplayContentL( CStifItemParser& /*aItem*/ ) |
|
228 { |
|
229 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
230 CleanupStack::PushL( cmdbtbase ); |
|
231 CEikCommandButtonBase::TDisplayContent content = CEikCommandButtonBase::EFirstOnly; |
|
232 cmdbtbase->SetDisplayContent( content ); |
|
233 CleanupStack::PopAndDestroy(); |
|
234 |
|
235 return KErrNone; |
|
236 } |
|
237 |
|
238 // ----------------------------------------------------------------------------- |
|
239 // CTestSDKButtons::TestCEikCmdBtBaseLayoutComponentsL |
|
240 // ----------------------------------------------------------------------------- |
|
241 // |
|
242 TInt CTestSDKButtons::TestCEikCmdBtBaseLayoutComponentsL( CStifItemParser& /*aItem*/ ) |
|
243 { |
|
244 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
245 CleanupStack::PushL( cmdbtbase ); |
|
246 TResourceReader reader; |
|
247 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON); |
|
248 cmdbtbase->StartConstructFromResourceL( reader ); |
|
249 cmdbtbase->SetComponentsL( 0 ); |
|
250 cmdbtbase->LayoutComponents(); |
|
251 CleanupStack::PopAndDestroy( 2 ); |
|
252 |
|
253 return KErrNone; |
|
254 } |
|
255 |
|
256 // ----------------------------------------------------------------------------- |
|
257 // CTestSDKButtons::TestCEikCmdBtBaseStartConstructFromResourceL |
|
258 // ----------------------------------------------------------------------------- |
|
259 // |
|
260 TInt CTestSDKButtons::TestCEikCmdBtBaseStartConstructFromResourceL( CStifItemParser& /*aItem*/ ) |
|
261 { |
|
262 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
263 CleanupStack::PushL( cmdbtbase ); |
|
264 TResourceReader reader; |
|
265 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON); |
|
266 cmdbtbase->StartConstructFromResourceL( reader ); |
|
267 CleanupStack::PopAndDestroy( 2 ); |
|
268 |
|
269 return KErrNone; |
|
270 } |
|
271 |
|
272 // ----------------------------------------------------------------------------- |
|
273 // CTestSDKButtons::TestCEikCmdBtBaseConstructLabelAndImageFromResourceL |
|
274 // ----------------------------------------------------------------------------- |
|
275 // |
|
276 TInt CTestSDKButtons::TestCEikCmdBtBaseConstructLabelAndImageFromResourceL( CStifItemParser& /*aItem*/ ) |
|
277 { |
|
278 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
279 CleanupStack::PushL( cmdbtbase ); |
|
280 TResourceReader reader; |
|
281 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
282 cmdbtbase->ConstructLabelFromResourceL( reader, CEikCommandButtonBase::EFirst ); |
|
283 CleanupStack::PopAndDestroy(); |
|
284 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
285 cmdbtbase->ConstructImageFromResourceL( reader, CEikCommandButtonBase::EFirst ); |
|
286 CleanupStack::PopAndDestroy( 2 ); |
|
287 |
|
288 return KErrNone; |
|
289 } |
|
290 |
|
291 // ----------------------------------------------------------------------------- |
|
292 // CTestSDKButtons::TestCEikCmdBtBaseUpdateComponentAlignmentL |
|
293 // ----------------------------------------------------------------------------- |
|
294 // |
|
295 TInt CTestSDKButtons::TestCEikCmdBtBaseUpdateComponentAlignmentL( CStifItemParser& /*aItem*/ ) |
|
296 { |
|
297 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
298 CleanupStack::PushL( cmdbtbase ); |
|
299 TResourceReader reader; |
|
300 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
301 cmdbtbase->ConstructFromResourceL( reader ); |
|
302 cmdbtbase->SetComponentsL( 0 ); |
|
303 cmdbtbase->UpdateComponentAlignment(); |
|
304 CleanupStack::PopAndDestroy( 2 ); |
|
305 |
|
306 return KErrNone; |
|
307 } |
|
308 |
|
309 // ----------------------------------------------------------------------------- |
|
310 // CTestSDKButtons::TestCEikCmdBtBaseSetDefaultL |
|
311 // ----------------------------------------------------------------------------- |
|
312 // |
|
313 TInt CTestSDKButtons::TestCEikCmdBtBaseSetDefaultL( CStifItemParser& /*aItem*/ ) |
|
314 { |
|
315 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
316 CleanupStack::PushL( cmdbtbase ); |
|
317 TResourceReader reader; |
|
318 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
319 cmdbtbase->ConstructFromResourceL( reader ); |
|
320 cmdbtbase->SetDefault( EFalse ); |
|
321 cmdbtbase->SetDefault( ETrue ); |
|
322 |
|
323 CleanupStack::PopAndDestroy( 2 ); |
|
324 |
|
325 return KErrNone; |
|
326 } |
|
327 |
|
328 // ----------------------------------------------------------------------------- |
|
329 // CTestSDKButtons::TestCEikCmdBtBaseSetDimmedL |
|
330 // ----------------------------------------------------------------------------- |
|
331 // |
|
332 TInt CTestSDKButtons::TestCEikCmdBtBaseSetDimmedL( CStifItemParser& /*aItem*/ ) |
|
333 { |
|
334 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
335 CleanupStack::PushL( cmdbtbase ); |
|
336 TResourceReader reader; |
|
337 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
338 cmdbtbase->ConstructFromResourceL( reader ); |
|
339 cmdbtbase->SetDimmed( EFalse ); |
|
340 cmdbtbase->SetDimmed( ETrue ); |
|
341 |
|
342 CleanupStack::PopAndDestroy( 2 ); |
|
343 |
|
344 return KErrNone; |
|
345 } |
|
346 |
|
347 // ----------------------------------------------------------------------------- |
|
348 // CTestSDKButtons::TestCEikCmdBtBaseMinimumSizeL |
|
349 // ----------------------------------------------------------------------------- |
|
350 // |
|
351 TInt CTestSDKButtons::TestCEikCmdBtBaseMinimumSizeL( CStifItemParser& /*aItem*/ ) |
|
352 { |
|
353 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
354 CleanupStack::PushL( cmdbtbase ); |
|
355 TResourceReader reader; |
|
356 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
357 cmdbtbase->ConstructFromResourceL( reader ); |
|
358 TSize size( 0, 0 ); |
|
359 size = cmdbtbase->MinimumSize(); |
|
360 if ( size.iHeight == 0 || size.iWidth == 0 ) |
|
361 { |
|
362 CleanupStack::PopAndDestroy( 2 ); |
|
363 return KErrCorrupt; |
|
364 } |
|
365 |
|
366 CleanupStack::PopAndDestroy( 2 ); |
|
367 |
|
368 return KErrNone; |
|
369 } |
|
370 |
|
371 // ----------------------------------------------------------------------------- |
|
372 // CTestSDKButtons::TestCEikCmdBtBaseCountComponentControlsL |
|
373 // ----------------------------------------------------------------------------- |
|
374 // |
|
375 TInt CTestSDKButtons::TestCEikCmdBtBaseCountComponentControlsL( CStifItemParser& /*aItem*/ ) |
|
376 { |
|
377 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
378 CleanupStack::PushL( cmdbtbase ); |
|
379 TResourceReader reader; |
|
380 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
381 cmdbtbase->ConstructFromResourceL( reader ); |
|
382 cmdbtbase->SetComponentsL( 0 ); |
|
383 TInt num = cmdbtbase->CountComponentControls(); |
|
384 CleanupStack::PopAndDestroy( 2 ); |
|
385 const TInt controlnum = 1; |
|
386 STIF_ASSERT_EQUALS( controlnum, num ); |
|
387 |
|
388 return KErrNone; |
|
389 } |
|
390 |
|
391 // ----------------------------------------------------------------------------- |
|
392 // CTestSDKButtons::TestCEikCmdBtBaseComponentControlL |
|
393 // ----------------------------------------------------------------------------- |
|
394 // |
|
395 TInt CTestSDKButtons::TestCEikCmdBtBaseComponentControlL( CStifItemParser& /*aItem*/ ) |
|
396 { |
|
397 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
398 CleanupStack::PushL( cmdbtbase ); |
|
399 |
|
400 cmdbtbase->SetComponentsL( 0 ); |
|
401 CCoeControl* control = cmdbtbase->ComponentControl( 0 ); |
|
402 STIF_ASSERT_NOT_NULL( control ); |
|
403 |
|
404 CleanupStack::PopAndDestroy( cmdbtbase ); |
|
405 |
|
406 return KErrNone; |
|
407 } |
|
408 |
|
409 // ----------------------------------------------------------------------------- |
|
410 // CTestSDKButtons::TestCEikCmdBtBaseSetContainerWindowLAndActivateL |
|
411 // ----------------------------------------------------------------------------- |
|
412 // |
|
413 TInt CTestSDKButtons::TestCEikCmdBtBaseSetContainerWindowLAndActivateL( CStifItemParser& /*aItem*/ ) |
|
414 { |
|
415 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
416 CleanupStack::PushL( cmdbtbase ); |
|
417 TResourceReader reader; |
|
418 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
419 cmdbtbase->ConstructFromResourceL( reader ); |
|
420 cmdbtbase->SetContainerWindowL( *iContainer ); |
|
421 cmdbtbase->SetComponentsL( 0 ); |
|
422 cmdbtbase->ActivateL(); |
|
423 |
|
424 CleanupStack::PopAndDestroy( 2 ); |
|
425 |
|
426 return KErrNone; |
|
427 } |
|
428 |
|
429 // ----------------------------------------------------------------------------- |
|
430 // CTestSDKButtons::TestCEikCmdBtBaseFocusChangedL |
|
431 // ----------------------------------------------------------------------------- |
|
432 // |
|
433 TInt CTestSDKButtons::TestCEikCmdBtBaseFocusChangedL( CStifItemParser& /*aItem*/ ) |
|
434 { |
|
435 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
436 CleanupStack::PushL( cmdbtbase ); |
|
437 TResourceReader reader; |
|
438 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
439 cmdbtbase->ConstructFromResourceL( reader ); |
|
440 cmdbtbase->SetContainerWindowL( *iContainer ); |
|
441 cmdbtbase->SetComponentsL( 0 ); |
|
442 cmdbtbase->ActivateL(); |
|
443 |
|
444 cmdbtbase->FocusChanged( ENoDrawNow ); |
|
445 cmdbtbase->FocusChanged( EDrawNow ); |
|
446 |
|
447 CleanupStack::PopAndDestroy( 2 ); |
|
448 |
|
449 return KErrNone; |
|
450 } |
|
451 |
|
452 // ----------------------------------------------------------------------------- |
|
453 // CTestSDKButtons::TestCEikCmdBtBaseOfferKeyEventL |
|
454 // ----------------------------------------------------------------------------- |
|
455 // |
|
456 TInt CTestSDKButtons::TestCEikCmdBtBaseOfferKeyEventL( CStifItemParser& /*aItem*/ ) |
|
457 { |
|
458 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
459 CleanupStack::PushL( cmdbtbase ); |
|
460 TResourceReader reader; |
|
461 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
462 cmdbtbase->ConstructFromResourceL( reader ); |
|
463 cmdbtbase->SetContainerWindowL( *iContainer ); |
|
464 |
|
465 cmdbtbase->SetComponentsL( 0 ); |
|
466 cmdbtbase->ActivateL(); |
|
467 TKeyEvent keyevent; |
|
468 keyevent.iCode = EKeyDevice3; |
|
469 cmdbtbase->OfferKeyEventL( keyevent, EEventKey ); |
|
470 TPointerEvent event; |
|
471 cmdbtbase->HandlePointerEventL( event ); |
|
472 CleanupStack::PopAndDestroy( 2 ); |
|
473 |
|
474 return KErrNone; |
|
475 } |
|
476 |
|
477 // ----------------------------------------------------------------------------- |
|
478 // CTestSDKButtons::TestCEikCmdBtBaseGetColorUseListL |
|
479 // ----------------------------------------------------------------------------- |
|
480 // |
|
481 TInt CTestSDKButtons::TestCEikCmdBtBaseGetColorUseListL( CStifItemParser& /*aItem*/ ) |
|
482 { |
|
483 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
484 CleanupStack::PushL( cmdbtbase ); |
|
485 TResourceReader reader; |
|
486 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
487 cmdbtbase->ConstructFromResourceL( reader ); |
|
488 cmdbtbase->SetContainerWindowL( *iContainer ); |
|
489 cmdbtbase->SetComponentsL( 0 ); |
|
490 cmdbtbase->ActivateL(); |
|
491 CArrayFixFlat<TCoeColorUse>* array = new (ELeave) CArrayFixFlat<TCoeColorUse>( KArraySize ); |
|
492 CleanupStack::PushL( array ); |
|
493 cmdbtbase->GetColorUseListL( *array ); |
|
494 CleanupStack::PopAndDestroy( 3 ); |
|
495 |
|
496 return KErrNone; |
|
497 } |
|
498 |
|
499 // ----------------------------------------------------------------------------- |
|
500 // CTestSDKButtons::TestCEikCmdBtBaseHandleResourceChangeL |
|
501 // ----------------------------------------------------------------------------- |
|
502 // |
|
503 TInt CTestSDKButtons::TestCEikCmdBtBaseHandleResourceChangeL( CStifItemParser& /*aItem*/ ) |
|
504 { |
|
505 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
506 CleanupStack::PushL( cmdbtbase ); |
|
507 TResourceReader reader; |
|
508 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
509 cmdbtbase->ConstructFromResourceL( reader ); |
|
510 cmdbtbase->SetContainerWindowL( *iContainer ); |
|
511 cmdbtbase->SetComponentsL( 0 ); |
|
512 cmdbtbase->ActivateL(); |
|
513 cmdbtbase->HandleResourceChange( 0 ); |
|
514 CleanupStack::PopAndDestroy( 2 ); |
|
515 |
|
516 return KErrNone; |
|
517 } |
|
518 |
|
519 // ----------------------------------------------------------------------------- |
|
520 // CTestSDKButtons::TestCEikCmdBtBaseStateChangedL |
|
521 // ----------------------------------------------------------------------------- |
|
522 // |
|
523 TInt CTestSDKButtons::TestCEikCmdBtBaseStateChangedL( CStifItemParser& /*aItem*/ ) |
|
524 { |
|
525 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
526 CleanupStack::PushL( cmdbtbase ); |
|
527 TResourceReader reader; |
|
528 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
529 cmdbtbase->ConstructFromResourceL( reader ); |
|
530 cmdbtbase->SetContainerWindowL( *iContainer ); |
|
531 cmdbtbase->SetComponentsL( 0 ); |
|
532 cmdbtbase->ActivateL(); |
|
533 cmdbtbase->DoStateChanged(); |
|
534 CleanupStack::PopAndDestroy( 2 ); |
|
535 |
|
536 return KErrNone; |
|
537 } |
|
538 |
|
539 // ----------------------------------------------------------------------------- |
|
540 // CTestSDKButtons::TestCEikCmdBtBaseSetTextL |
|
541 // ----------------------------------------------------------------------------- |
|
542 // |
|
543 TInt CTestSDKButtons::TestCEikCmdBtBaseSetTextL( CStifItemParser& /*aItem*/ ) |
|
544 { |
|
545 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
546 CleanupStack::PushL( cmdbtbase ); |
|
547 TResourceReader reader; |
|
548 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
549 cmdbtbase->ConstructFromResourceL( reader ); |
|
550 cmdbtbase->SetContainerWindowL( *iContainer ); |
|
551 _LIT( KBtText, "testcommondbutton" ); |
|
552 TBuf<KBufSize> buf( KBtText ); |
|
553 cmdbtbase->DoSetTextL( buf ); |
|
554 |
|
555 CleanupStack::PopAndDestroy( 2 ); |
|
556 |
|
557 return KErrNone; |
|
558 } |
|
559 |
|
560 // ----------------------------------------------------------------------------- |
|
561 // CTestSDKButtons::TestCEikCmdBtBaseSetPictureL |
|
562 // ----------------------------------------------------------------------------- |
|
563 // |
|
564 TInt CTestSDKButtons::TestCEikCmdBtBaseSetPictureL( CStifItemParser& /*aItem*/ ) |
|
565 { |
|
566 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
567 CleanupStack::PushL( cmdbtbase ); |
|
568 TResourceReader reader; |
|
569 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
570 cmdbtbase->ConstructFromResourceL( reader ); |
|
571 cmdbtbase->SetContainerWindowL( *iContainer ); |
|
572 cmdbtbase->SetComponentsL( 0 ); |
|
573 cmdbtbase->ActivateL(); |
|
574 CFbsBitmap* bitmap = NULL; |
|
575 CFbsBitmap* mask = NULL; |
|
576 AknIconUtils::CreateIconL( bitmap, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
577 CleanupStack::PushL( bitmap ); |
|
578 CleanupStack::PushL( mask ); |
|
579 cmdbtbase->DoSetPictureL( bitmap, mask ); |
|
580 CleanupStack::Pop( mask ); |
|
581 CleanupStack::Pop( bitmap ); |
|
582 |
|
583 CleanupStack::PopAndDestroy( 2 ); |
|
584 |
|
585 return KErrNone; |
|
586 } |
|
587 |
|
588 // ----------------------------------------------------------------------------- |
|
589 // CTestSDKButtons::TestCEikCmdBtBaseSetPictureFromFileL |
|
590 // ----------------------------------------------------------------------------- |
|
591 // |
|
592 TInt CTestSDKButtons::TestCEikCmdBtBaseSetPictureFromFileL( CStifItemParser& /*aItem*/ ) |
|
593 { |
|
594 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
595 CleanupStack::PushL( cmdbtbase ); |
|
596 TResourceReader reader; |
|
597 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
598 cmdbtbase->ConstructFromResourceL( reader ); |
|
599 CleanupStack::PopAndDestroy(); //reader |
|
600 cmdbtbase->SetContainerWindowL( *iContainer ); |
|
601 cmdbtbase->SetComponentsL( 0 ); |
|
602 cmdbtbase->ActivateL(); |
|
603 TRect rect( 0, 0, 1, 1 ); |
|
604 cmdbtbase->DoSetPictureFromFileL( KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
605 iContainer->ActivateGc(); |
|
606 cmdbtbase->DoDraw( rect ); |
|
607 iContainer->DeactivateGc(); |
|
608 CleanupStack::PopAndDestroy( cmdbtbase ); |
|
609 |
|
610 return KErrNone; |
|
611 } |
|
612 |
|
613 // ----------------------------------------------------------------------------- |
|
614 // CTestSDKButtons::TestCEikCmdBtBaseDrawL |
|
615 // ----------------------------------------------------------------------------- |
|
616 // |
|
617 TInt CTestSDKButtons::TestCEikCmdBtBaseDrawL( CStifItemParser& /*aItem*/ ) |
|
618 { |
|
619 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
620 CleanupStack::PushL( cmdbtbase ); |
|
621 TResourceReader reader; |
|
622 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
623 cmdbtbase->ConstructFromResourceL( reader ); |
|
624 cmdbtbase->SetButtonLayout( CEikCommandButtonBase::EFirstRightSecondLeft ); |
|
625 cmdbtbase->SetExcessSpace( CEikCommandButtonBase::EShare ); |
|
626 cmdbtbase->SetDisplayContent( CEikCommandButtonBase::EFirstOnly ); |
|
627 cmdbtbase->SetContainerWindowL( *iContainer ); |
|
628 iContainer->ActivateL(); |
|
629 cmdbtbase->SetComponentsL( 0 ); |
|
630 cmdbtbase->ActivateL(); |
|
631 iContainer->DrawNow(); |
|
632 |
|
633 CleanupStack::PopAndDestroy( 2 ); |
|
634 |
|
635 return KErrNone; |
|
636 } |
|
637 |
|
638 // ----------------------------------------------------------------------------- |
|
639 // CTestSDKButtons::TestCEikCmdBtBaseWriteInternalStateL |
|
640 // ----------------------------------------------------------------------------- |
|
641 // |
|
642 TInt CTestSDKButtons::TestCEikCmdBtBaseWriteInternalStateL( CStifItemParser& /*aItem*/ ) |
|
643 { |
|
644 CTestCmdBtBase* cmdbtbase = new ( ELeave ) CTestCmdBtBase; |
|
645 CleanupStack::PushL( cmdbtbase ); |
|
646 TResourceReader reader; |
|
647 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMDBUTTON ); |
|
648 cmdbtbase->ConstructFromResourceL( reader ); |
|
649 cmdbtbase->SetContainerWindowL( *iContainer ); |
|
650 cmdbtbase->SetComponentsL( 0 ); |
|
651 cmdbtbase->ActivateL(); |
|
652 |
|
653 RDesWriteStream stream; |
|
654 CleanupClosePushL( stream ); |
|
655 HBufC8* hbuf = HBufC8::NewL( KHBufSize ); |
|
656 CleanupStack::PushL( hbuf ); |
|
657 TPtr8 ptr = hbuf->Des(); |
|
658 stream.Open( ptr ); |
|
659 cmdbtbase->DoWriteInternalStateL( stream ); |
|
660 stream.CommitL(); |
|
661 stream.Close(); |
|
662 |
|
663 CleanupStack::PopAndDestroy( 4 ); |
|
664 |
|
665 return KErrNone; |
|
666 } |
|
667 |
|
668 // ----------------------------------------------------------------------------- |
|
669 // CTestSDKButtons::TestCEikCmdBtConstructorL |
|
670 // ----------------------------------------------------------------------------- |
|
671 // |
|
672 TInt CTestSDKButtons::TestCEikCmdBtConstructorL( CStifItemParser& /*aItem*/ ) |
|
673 { |
|
674 CEikCommandButton* cmdbt = new ( ELeave ) CEikCommandButton; |
|
675 CleanupStack::PushL( cmdbt ); |
|
676 STIF_ASSERT_NOT_NULL( cmdbt ); |
|
677 CleanupStack::PopAndDestroy( cmdbt ); |
|
678 |
|
679 return KErrNone; |
|
680 } |
|
681 |
|
682 // ----------------------------------------------------------------------------- |
|
683 // CTestSDKButtons::TestCEikCmdBtConstructFromResourceL |
|
684 // ----------------------------------------------------------------------------- |
|
685 // |
|
686 TInt CTestSDKButtons::TestCEikCmdBtConstructFromResourceL( CStifItemParser& /*aItem*/ ) |
|
687 { |
|
688 CEikCommandButton* cmdbt = new ( ELeave ) CEikCommandButton; |
|
689 CleanupStack::PushL( cmdbt ); |
|
690 TResourceReader reader; |
|
691 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMBUT_BUTTON ); |
|
692 cmdbt->ConstructFromResourceL( reader ); |
|
693 CleanupStack::PopAndDestroy( 2 ); |
|
694 |
|
695 return KErrNone; |
|
696 } |
|
697 |
|
698 // ----------------------------------------------------------------------------- |
|
699 // CTestSDKButtons::TestCEikCmdBtSetPictureL |
|
700 // ----------------------------------------------------------------------------- |
|
701 // |
|
702 TInt CTestSDKButtons::TestCEikCmdBtSetPictureL( CStifItemParser& aItem ) |
|
703 { |
|
704 TInt num = 0; |
|
705 TInt err = aItem.GetNextInt( num ); |
|
706 if ( err != KErrNone ) |
|
707 { |
|
708 return err; |
|
709 } |
|
710 CEikCommandButton* cmdbt = new ( ELeave ) CEikCommandButton; |
|
711 CleanupStack::PushL( cmdbt ); |
|
712 TResourceReader reader; |
|
713 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMBUT_BUTTON ); |
|
714 cmdbt->ConstructFromResourceL( reader ); |
|
715 CEikImage* image = NULL; |
|
716 switch ( num ) |
|
717 { |
|
718 case 1: |
|
719 { |
|
720 CFbsBitmap* main = NULL; |
|
721 CFbsBitmap* mask = NULL; |
|
722 AknIconUtils::CreateIconL( main, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
723 cmdbt->SetPictureL( main, mask ); |
|
724 image = cmdbt->Picture(); |
|
725 STIF_ASSERT_NOT_NULL( image ); |
|
726 CleanupStack::PopAndDestroy(); |
|
727 break; |
|
728 } |
|
729 case 2: |
|
730 { |
|
731 cmdbt->SetPictureFromFileL( KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
732 image = cmdbt->Picture(); |
|
733 STIF_ASSERT_NOT_NULL( image ); |
|
734 CleanupStack::PopAndDestroy(); |
|
735 break; |
|
736 } |
|
737 default: |
|
738 CleanupStack::PopAndDestroy( cmdbt ); |
|
739 return KErrNotSupported; |
|
740 } |
|
741 |
|
742 CleanupStack::PopAndDestroy( cmdbt ); |
|
743 |
|
744 return KErrNone; |
|
745 } |
|
746 |
|
747 // ----------------------------------------------------------------------------- |
|
748 // CTestSDKButtons::TestCEikCmdBtSetThreeEnumL |
|
749 // ----------------------------------------------------------------------------- |
|
750 // |
|
751 TInt CTestSDKButtons::TestCEikCmdBtSetThreeEnumL( CStifItemParser& /*aItem*/ ) |
|
752 { |
|
753 CEikCommandButton* cmdbt = new ( ELeave ) CEikCommandButton; |
|
754 CleanupStack::PushL( cmdbt ); |
|
755 TResourceReader reader; |
|
756 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMBUT_BUTTON ); |
|
757 cmdbt->ConstructFromResourceL( reader ); |
|
758 cmdbt->SetButtonLayout( CEikCommandButton::ETextRightPictureLeft ); |
|
759 cmdbt->SetButtonLayout( CEikCommandButton::ETextBottomPictureTop ); |
|
760 cmdbt->SetButtonLayout( CEikCommandButton::ETextTopPictureBottom ); |
|
761 cmdbt->SetButtonLayout( CEikCommandButton::ETextLeftPictureRight ); |
|
762 cmdbt->SetExcessSpace( CEikCommandButton::EShare ); |
|
763 cmdbt->SetExcessSpace( CEikCommandButton::EToText ); |
|
764 cmdbt->SetExcessSpace( CEikCommandButton::EToPicture ); |
|
765 cmdbt->SetDisplayContent( CEikCommandButton::ETextOnly ); |
|
766 cmdbt->SetDisplayContent( CEikCommandButton::ETextOnly ); |
|
767 cmdbt->SetDisplayContent( CEikCommandButton::ETextAndPicture ); |
|
768 |
|
769 CleanupStack::PopAndDestroy( 2 ); |
|
770 |
|
771 return KErrNone; |
|
772 } |
|
773 |
|
774 // ----------------------------------------------------------------------------- |
|
775 // CTestSDKButtons::TestCEikCmdBtSetTextL |
|
776 // ----------------------------------------------------------------------------- |
|
777 // |
|
778 TInt CTestSDKButtons::TestCEikCmdBtSetTextL( CStifItemParser& /*aItem*/ ) |
|
779 { |
|
780 CEikCommandButton* cmdbt = new ( ELeave ) CEikCommandButton; |
|
781 CleanupStack::PushL( cmdbt ); |
|
782 TResourceReader reader; |
|
783 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMBUT_BUTTON ); |
|
784 cmdbt->ConstructFromResourceL( reader ); |
|
785 _LIT( KText, "settext" ); |
|
786 cmdbt->SetTextL( KText ); |
|
787 |
|
788 CleanupStack::PopAndDestroy( 2 ); |
|
789 |
|
790 return KErrNone; |
|
791 } |
|
792 |
|
793 // ----------------------------------------------------------------------------- |
|
794 // CTestSDKButtons::TestCEikCmdBtLabelL |
|
795 // ----------------------------------------------------------------------------- |
|
796 // |
|
797 TInt CTestSDKButtons::TestCEikCmdBtLabelL( CStifItemParser& /*aItem*/ ) |
|
798 { |
|
799 CEikCommandButton* cmdbt = new ( ELeave ) CEikCommandButton; |
|
800 CleanupStack::PushL( cmdbt ); |
|
801 TResourceReader reader; |
|
802 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMBUT_BUTTON ); |
|
803 cmdbt->ConstructFromResourceL( reader ); |
|
804 CEikLabel* label = NULL; |
|
805 label = cmdbt->Label(); |
|
806 STIF_ASSERT_NOT_NULL( label ); |
|
807 |
|
808 CleanupStack::PopAndDestroy( 2 ); |
|
809 |
|
810 return KErrNone; |
|
811 } |
|
812 |
|
813 // ----------------------------------------------------------------------------- |
|
814 // CTestSDKButtons::TestCEikCmdBtCmdSetL |
|
815 // ----------------------------------------------------------------------------- |
|
816 // |
|
817 TInt CTestSDKButtons::TestCEikCmdBtCmdSetL( CStifItemParser& /*aItem*/ ) |
|
818 { |
|
819 CEikCommandButton* cmdbt = new ( ELeave ) CEikCommandButton; |
|
820 CleanupStack::PushL( cmdbt ); |
|
821 TResourceReader reader; |
|
822 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMBUT_BUTTON ); |
|
823 cmdbt->ConstructFromResourceL( reader ); |
|
824 CFbsBitmap* main = NULL; |
|
825 CFbsBitmap* mask = NULL; |
|
826 _LIT( KText, "settext" ); |
|
827 AknIconUtils::CreateIconL( main, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
828 CleanupStack::PushL( main ); |
|
829 CleanupStack::PushL( mask ); |
|
830 cmdbt->SetCommandL( ELeftBt, &KText, main, mask ); |
|
831 CleanupStack::Pop( mask ); |
|
832 CleanupStack::Pop( main ); |
|
833 |
|
834 CleanupStack::PopAndDestroy( 2 ); |
|
835 |
|
836 return KErrNone; |
|
837 } |
|
838 |
|
839 // ----------------------------------------------------------------------------- |
|
840 // CTestSDKButtons::TestCEikCmdBtUpdateComponentAlignmentL |
|
841 // ----------------------------------------------------------------------------- |
|
842 // |
|
843 TInt CTestSDKButtons::TestCEikCmdBtUpdateComponentAlignmentL( CStifItemParser& /*aItem*/ ) |
|
844 { |
|
845 CEikCommandButton* cmdbt = new ( ELeave ) CEikCommandButton; |
|
846 CleanupStack::PushL( cmdbt ); |
|
847 TResourceReader reader; |
|
848 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMBUT_BUTTON ); |
|
849 cmdbt->ConstructFromResourceL( reader ); |
|
850 cmdbt->UpdateComponentAlignment(); |
|
851 |
|
852 TPointerEvent event; |
|
853 cmdbt->HandlePointerEventL( event ); |
|
854 CleanupStack::PopAndDestroy( 2 ); |
|
855 |
|
856 return KErrNone; |
|
857 } |
|
858 |
|
859 // ----------------------------------------------------------------------------- |
|
860 // CTestSDKButtons::TestCEikTwoPicCmdBtConstructorL |
|
861 // ----------------------------------------------------------------------------- |
|
862 // |
|
863 TInt CTestSDKButtons::TestCEikTwoPicCmdBtConstructorL( CStifItemParser& /*aItem*/ ) |
|
864 { |
|
865 CEikTwoPictureCommandButton* piccmdbt = new ( ELeave ) CEikTwoPictureCommandButton; |
|
866 CleanupStack::PushL( piccmdbt ); |
|
867 STIF_ASSERT_NOT_NULL( piccmdbt ); |
|
868 CleanupStack::PopAndDestroy( piccmdbt ); |
|
869 |
|
870 return KErrNone; |
|
871 } |
|
872 |
|
873 // ----------------------------------------------------------------------------- |
|
874 // CTestSDKButtons::TestCEikTwoPicCmdBtConstructFromResourceL |
|
875 // ----------------------------------------------------------------------------- |
|
876 // |
|
877 TInt CTestSDKButtons::TestCEikTwoPicCmdBtConstructFromResourceL( CStifItemParser& /*aItem*/ ) |
|
878 { |
|
879 CEikTwoPictureCommandButton* piccmdbt = new ( ELeave ) CEikTwoPictureCommandButton; |
|
880 CleanupStack::PushL( piccmdbt ); |
|
881 TResourceReader reader; |
|
882 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_TWOPICBT_BUTTON ); |
|
883 piccmdbt->ConstructFromResourceL( reader ); |
|
884 |
|
885 CleanupStack::PopAndDestroy( 2 ); |
|
886 |
|
887 return KErrNone; |
|
888 } |
|
889 |
|
890 // ----------------------------------------------------------------------------- |
|
891 // CTestSDKButtons::TestCEikTwoPicCmdBtIsSecondPictureOwnedExternallyL |
|
892 // ----------------------------------------------------------------------------- |
|
893 // |
|
894 TInt CTestSDKButtons::TestCEikTwoPicCmdBtIsSecondPictureOwnedExternallyL( CStifItemParser& /*aItem*/ ) |
|
895 { |
|
896 CEikTwoPictureCommandButton* piccmdbt = new ( ELeave ) CEikTwoPictureCommandButton; |
|
897 CleanupStack::PushL( piccmdbt ); |
|
898 TResourceReader reader; |
|
899 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_TWOPICBT_BUTTON ); |
|
900 piccmdbt->ConstructFromResourceL( reader ); |
|
901 CFbsBitmap* main = NULL; |
|
902 CFbsBitmap* mask = NULL; |
|
903 CFbsBitmap* secondmain = NULL; |
|
904 CFbsBitmap* secondmask = NULL; |
|
905 AknIconUtils::CreateIconL( main, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
906 AknIconUtils::CreateIconL( secondmain, secondmask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
907 piccmdbt->SetTwoPicturesL( main, mask, secondmain, secondmask ); |
|
908 piccmdbt->IsSecondPictureOwnedExternally(); |
|
909 |
|
910 CleanupStack::PopAndDestroy( 2 ); |
|
911 |
|
912 return KErrNone; |
|
913 } |
|
914 |
|
915 // ----------------------------------------------------------------------------- |
|
916 // CTestSDKButtons::TestCEikTwoPicCmdBtPictureL |
|
917 // ----------------------------------------------------------------------------- |
|
918 // |
|
919 TInt CTestSDKButtons::TestCEikTwoPicCmdBtPictureL( CStifItemParser& /*aItem*/ ) |
|
920 { |
|
921 CEikTwoPictureCommandButton* piccmdbt = new ( ELeave ) CEikTwoPictureCommandButton; |
|
922 CleanupStack::PushL( piccmdbt ); |
|
923 TResourceReader reader; |
|
924 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_TWOPICBT_BUTTON ); |
|
925 piccmdbt->ConstructFromResourceL( reader ); |
|
926 CFbsBitmap* main = NULL; |
|
927 CFbsBitmap* mask = NULL; |
|
928 CFbsBitmap* secondmain = NULL; |
|
929 CFbsBitmap* secondmask = NULL; |
|
930 AknIconUtils::CreateIconL( main, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
931 AknIconUtils::CreateIconL( secondmain, secondmask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
932 piccmdbt->SetTwoPicturesL( main, mask, secondmain, secondmask ); |
|
933 CEikImage* image = NULL; |
|
934 image = piccmdbt->Picture(); |
|
935 STIF_ASSERT_NOT_NULL( image ); |
|
936 |
|
937 TPointerEvent event; |
|
938 piccmdbt->HandlePointerEventL( event ); |
|
939 |
|
940 CleanupStack::PopAndDestroy( 2 ); |
|
941 |
|
942 return KErrNone; |
|
943 } |
|
944 |
|
945 // ----------------------------------------------------------------------------- |
|
946 // CTestSDKButtons::TestCEikTwoPicCmdBtSetTextL |
|
947 // ----------------------------------------------------------------------------- |
|
948 // |
|
949 TInt CTestSDKButtons::TestCEikTwoPicCmdBtSetTextL( CStifItemParser& /*aItem*/ ) |
|
950 { |
|
951 CEikTwoPictureCommandButton* piccmdbt = new ( ELeave ) CEikTwoPictureCommandButton; |
|
952 CleanupStack::PushL( piccmdbt ); |
|
953 TResourceReader reader; |
|
954 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_TWOPICBT_BUTTON ); |
|
955 piccmdbt->ConstructFromResourceL( reader ); |
|
956 _LIT( KText, "settext" ); |
|
957 piccmdbt->SetTextL( KText ); |
|
958 |
|
959 CleanupStack::PopAndDestroy( 2 ); |
|
960 |
|
961 return KErrNone; |
|
962 } |
|
963 |
|
964 // ----------------------------------------------------------------------------- |
|
965 // CTestSDKButtons::TestCEikTwoPicCmdBtPictureSetL |
|
966 // ----------------------------------------------------------------------------- |
|
967 // |
|
968 TInt CTestSDKButtons::TestCEikTwoPicCmdBtPictureSetL( CStifItemParser& /*aItem*/ ) |
|
969 { |
|
970 CEikTwoPictureCommandButton* piccmdbt = new ( ELeave ) CEikTwoPictureCommandButton; |
|
971 CleanupStack::PushL( piccmdbt ); |
|
972 TResourceReader reader; |
|
973 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_TWOPICBT_BUTTON ); |
|
974 piccmdbt->ConstructFromResourceL( reader ); |
|
975 piccmdbt->SetContainerWindowL( *iContainer ); |
|
976 CFbsBitmap* main = NULL; |
|
977 CFbsBitmap* mask = NULL; |
|
978 CFbsBitmap* secondmain = NULL; |
|
979 CFbsBitmap* secondmask = NULL; |
|
980 AknIconUtils::CreateIconL( main, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
981 AknIconUtils::CreateIconL( secondmain, secondmask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
982 piccmdbt->SetTwoPicturesL( main, mask, secondmain, secondmask ); |
|
983 secondmain = NULL; |
|
984 secondmask = NULL; |
|
985 AknIconUtils::CreateIconL( secondmain, secondmask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
986 piccmdbt->SetSecondPicture( secondmain, secondmain ); |
|
987 piccmdbt->SetPictureFromFileL( KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
988 TRAPD( err, piccmdbt->SetSecondPictureFromFileL( KBitmapFile, EMbmAvkonQgn_graf_tab_21, EMbmAvkonQgn_graf_tab_21_mask ) ); |
|
989 CleanupStack::PopAndDestroy( 2 ); |
|
990 if ( err != KErrNone ) |
|
991 { |
|
992 err = KErrNone; |
|
993 } |
|
994 return err; |
|
995 } |
|
996 |
|
997 // ----------------------------------------------------------------------------- |
|
998 // CTestSDKButtons::TestCEikTwoPicCmdBtConstructImagesFromResourceL |
|
999 // ----------------------------------------------------------------------------- |
|
1000 // |
|
1001 TInt CTestSDKButtons::TestCEikTwoPicCmdBtConstructImagesFromResourceL( CStifItemParser& /*aItem*/ ) |
|
1002 { |
|
1003 CEikTwoPictureCommandButton* piccmdbt = new ( ELeave ) CEikTwoPictureCommandButton; |
|
1004 CleanupStack::PushL( piccmdbt ); |
|
1005 TResourceReader reader; |
|
1006 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_TWOPICBT_BUTTON ); |
|
1007 // TRAPD( err, piccmdbt->ConstructImagesFromResourceL( reader, CEikCommandButtonBase::ESecond ) ); |
|
1008 // if ( err != KErrNone ) |
|
1009 // { |
|
1010 // return KErrNone; |
|
1011 // } |
|
1012 CleanupStack::PopAndDestroy( 2 ); |
|
1013 |
|
1014 return KErrNone; |
|
1015 } |
|
1016 |
|
1017 // ----------------------------------------------------------------------------- |
|
1018 // CTestSDKButtons::TestCEikTwoPicCmdBtSetSecondPictureOwnedExternallyL |
|
1019 // ----------------------------------------------------------------------------- |
|
1020 // |
|
1021 TInt CTestSDKButtons::TestCEikTwoPicCmdBtSetSecondPictureOwnedExternallyL( CStifItemParser& /*aItem*/ ) |
|
1022 { |
|
1023 CEikTwoPictureCommandButton* piccmdbt = new ( ELeave ) CEikTwoPictureCommandButton; |
|
1024 CleanupStack::PushL( piccmdbt ); |
|
1025 TResourceReader reader; |
|
1026 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_TWOPICBT_BUTTON ); |
|
1027 piccmdbt->ConstructFromResourceL( reader ); |
|
1028 piccmdbt->SetContainerWindowL( *iContainer ); |
|
1029 piccmdbt->SetSecondPictureOwnedExternally( ETrue ); |
|
1030 |
|
1031 CleanupStack::PopAndDestroy( 2 ); |
|
1032 |
|
1033 return KErrNone; |
|
1034 } |
|
1035 |
|
1036 // ----------------------------------------------------------------------------- |
|
1037 // CTestSDKButtons::TestCEikTwoPicCmdBtActivateL |
|
1038 // ----------------------------------------------------------------------------- |
|
1039 // |
|
1040 TInt CTestSDKButtons::TestCEikTwoPicCmdBtActivateL( CStifItemParser& /*aItem*/ ) |
|
1041 { |
|
1042 CEikTwoPictureCommandButton* piccmdbt = new ( ELeave ) CEikTwoPictureCommandButton; |
|
1043 CleanupStack::PushL( piccmdbt ); |
|
1044 TResourceReader reader; |
|
1045 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_TWOPICBT_BUTTON ); |
|
1046 piccmdbt->ConstructFromResourceL( reader ); |
|
1047 CFbsBitmap* main = NULL; |
|
1048 CFbsBitmap* mask = NULL; |
|
1049 CFbsBitmap* secondmain = NULL; |
|
1050 CFbsBitmap* secondmask = NULL; |
|
1051 AknIconUtils::CreateIconL( main, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
1052 AknIconUtils::CreateIconL( secondmain, secondmask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
1053 piccmdbt->SetTwoPicturesL( main, mask, secondmain, secondmask ); |
|
1054 iContainer->ActivateGc(); |
|
1055 piccmdbt->ActivateL(); |
|
1056 CleanupStack::PopAndDestroy( 2 ); |
|
1057 |
|
1058 return KErrNone; |
|
1059 } |
|
1060 |
|
1061 // ----------------------------------------------------------------------------- |
|
1062 // CTestSDKButtons::TestCEikTwoPicCmdBtWriteInternalStateL |
|
1063 // ----------------------------------------------------------------------------- |
|
1064 // |
|
1065 TInt CTestSDKButtons::TestCEikTwoPicCmdBtWriteInternalStateL( CStifItemParser& /*aItem*/ ) |
|
1066 { |
|
1067 //new a class for test only one protected function |
|
1068 class CTestTwoPicBt : public CEikTwoPictureCommandButton |
|
1069 { |
|
1070 public: |
|
1071 CTestTwoPicBt(){} |
|
1072 ~CTestTwoPicBt(){} |
|
1073 void DoWriteInternalStateL( RWriteStream& aStream ){ WriteInternalStateL( aStream ); } |
|
1074 TInt SetComponents( TInt aIndex ) |
|
1075 { |
|
1076 const TInt marginsize = 2; |
|
1077 switch ( aIndex ) |
|
1078 { |
|
1079 case 0: |
|
1080 { |
|
1081 CEikAlignedControl* component = new ( ELeave ) CEikAlignedControl; |
|
1082 component->SetAllMarginsTo( marginsize ); |
|
1083 component->SetAlignment( EHLeftVCenter ); |
|
1084 iComponents[0] = component; |
|
1085 break; |
|
1086 } |
|
1087 case 1: |
|
1088 { |
|
1089 CEikAlignedControl* component = new ( ELeave ) CEikAlignedControl; |
|
1090 component->SetAllMarginsTo( marginsize ); |
|
1091 component->SetAlignment( EHLeftVCenter ); |
|
1092 iComponents[1] = component; |
|
1093 break; |
|
1094 } |
|
1095 default: |
|
1096 return -1; |
|
1097 } |
|
1098 return 0; |
|
1099 } |
|
1100 }; |
|
1101 CTestTwoPicBt* piccmdbt = new ( ELeave ) CTestTwoPicBt; |
|
1102 CleanupStack::PushL( piccmdbt ); |
|
1103 piccmdbt->SetComponents( 0 ); |
|
1104 piccmdbt->SetComponents( 1 ); |
|
1105 CFbsBitmap* main = NULL; |
|
1106 CFbsBitmap* mask = NULL; |
|
1107 CFbsBitmap* secondmain = NULL; |
|
1108 CFbsBitmap* secondmask = NULL; |
|
1109 AknIconUtils::CreateIconL( main, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
1110 AknIconUtils::CreateIconL( secondmain, secondmask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
1111 piccmdbt->SetTwoPicturesL( main, mask, secondmain, secondmask ); |
|
1112 HBufC8* buf = HBufC8::NewL( KHBufSize ); |
|
1113 CleanupStack::PushL( buf ); |
|
1114 TPtr8 ptr = buf->Des(); |
|
1115 |
|
1116 RDesWriteStream stream; |
|
1117 CleanupClosePushL( stream ); |
|
1118 stream.Open( ptr ); |
|
1119 // crash when reading bitmap data |
|
1120 TRAPD( err, piccmdbt->DoWriteInternalStateL( stream ) ); |
|
1121 stream.CommitL(); |
|
1122 stream.Close(); |
|
1123 CleanupStack::PopAndDestroy( 3 );//piccmdbt, buf, stream |
|
1124 if ( err != KErrNone ) |
|
1125 { |
|
1126 err = KErrNone; |
|
1127 } |
|
1128 return err; |
|
1129 } |
|
1130 |
|
1131 // ----------------------------------------------------------------------------- |
|
1132 // CTestSDKButtons::TestCEikInverterCmdBtConstructorL |
|
1133 // ----------------------------------------------------------------------------- |
|
1134 // |
|
1135 TInt CTestSDKButtons::TestCEikInverterCmdBtConstructorL( CStifItemParser& /*aItem*/ ) |
|
1136 { |
|
1137 CEikInverterCommandButton* invertcmdbt = new ( ELeave ) CEikInverterCommandButton; |
|
1138 CleanupStack::PushL( invertcmdbt ); |
|
1139 STIF_ASSERT_NOT_NULL( invertcmdbt ); |
|
1140 TResourceReader reader; |
|
1141 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMBUT_BUTTON ); |
|
1142 invertcmdbt->ConstructFromResourceL( reader ); |
|
1143 TPointerEvent event; |
|
1144 invertcmdbt->HandlePointerEventL( event ); |
|
1145 CleanupStack::PopAndDestroy( 2 ); |
|
1146 |
|
1147 return KErrNone; |
|
1148 } |
|
1149 |
|
1150 // ----------------------------------------------------------------------------- |
|
1151 // CTestSDKButtons::TestCEikInverterCmdBtWriteInternalStateL |
|
1152 // ----------------------------------------------------------------------------- |
|
1153 // |
|
1154 TInt CTestSDKButtons::TestCEikInverterCmdBtWriteInternalStateL( CStifItemParser& /*aItem*/ ) |
|
1155 { |
|
1156 //new a class for test only one protected function |
|
1157 class CTestInvertCmdBt : public CEikInverterCommandButton |
|
1158 { |
|
1159 public: |
|
1160 CTestInvertCmdBt(){} |
|
1161 ~CTestInvertCmdBt(){} |
|
1162 void DoWriteInternalStateL( RWriteStream& aStream ){ WriteInternalStateL( aStream ); } |
|
1163 }; |
|
1164 CTestInvertCmdBt* invertcmdbt = new ( ELeave ) CTestInvertCmdBt; |
|
1165 CleanupStack::PushL( invertcmdbt ); |
|
1166 TResourceReader reader; |
|
1167 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMBUT_BUTTON ); |
|
1168 invertcmdbt->ConstructFromResourceL( reader ); |
|
1169 HBufC8* buf = HBufC8::NewL( KHBufSize ); |
|
1170 TPtr8 ptr = buf->Des(); |
|
1171 CleanupStack::PushL( buf ); |
|
1172 RDesWriteStream stream; |
|
1173 CleanupClosePushL( stream ); |
|
1174 stream.Open( ptr ); |
|
1175 invertcmdbt->DoWriteInternalStateL( stream ); |
|
1176 stream.CommitL(); |
|
1177 stream.Close(); |
|
1178 CleanupStack::PopAndDestroy( 4 );//invertcmdbt, reader, buf, stream |
|
1179 |
|
1180 return KErrNone; |
|
1181 } |
|
1182 |
|
1183 // ----------------------------------------------------------------------------- |
|
1184 // CTestSDKButtons::TestCEikTxtBtConstructorL |
|
1185 // ----------------------------------------------------------------------------- |
|
1186 // |
|
1187 TInt CTestSDKButtons::TestCEikTxtBtConstructorL( CStifItemParser& /*aItem*/ ) |
|
1188 { |
|
1189 CEikTextButton* txtbt = new ( ELeave ) CEikTextButton; |
|
1190 CleanupStack::PushL( txtbt ); |
|
1191 STIF_ASSERT_NOT_NULL( txtbt ); |
|
1192 CleanupStack::PopAndDestroy( txtbt ); |
|
1193 |
|
1194 return KErrNone; |
|
1195 } |
|
1196 |
|
1197 // ----------------------------------------------------------------------------- |
|
1198 // CTestSDKButtons::TestCEikTxtBtConstructFromResourceL |
|
1199 // ----------------------------------------------------------------------------- |
|
1200 // |
|
1201 TInt CTestSDKButtons::TestCEikTxtBtConstructFromResourceL( CStifItemParser& /*aItem*/ ) |
|
1202 { |
|
1203 CEikTextButton* txtbt = new ( ELeave ) CEikTextButton; |
|
1204 CleanupStack::PushL( txtbt ); |
|
1205 TResourceReader reader; |
|
1206 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_TXTBT_BUTTON ); |
|
1207 txtbt->ConstructFromResourceL( reader ); |
|
1208 CleanupStack::PopAndDestroy( 2 ); |
|
1209 |
|
1210 return KErrNone; |
|
1211 } |
|
1212 |
|
1213 |
|
1214 // ----------------------------------------------------------------------------- |
|
1215 // CTestSDKButtons::TestCEikTxtBtSetTextL |
|
1216 // ----------------------------------------------------------------------------- |
|
1217 // |
|
1218 TInt CTestSDKButtons::TestCEikTxtBtSetTextL( CStifItemParser& /*aItem*/ ) |
|
1219 { |
|
1220 CEikTextButton* txtbt = new ( ELeave ) CEikTextButton; |
|
1221 CleanupStack::PushL( txtbt ); |
|
1222 TResourceReader reader; |
|
1223 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_TXTBT_BUTTON ); |
|
1224 txtbt->ConstructFromResourceL( reader ); |
|
1225 _LIT( KText, "test" ); |
|
1226 txtbt->SetTextL( KText ); |
|
1227 CleanupStack::PopAndDestroy( 2 ); |
|
1228 |
|
1229 return KErrNone; |
|
1230 } |
|
1231 |
|
1232 // ----------------------------------------------------------------------------- |
|
1233 // CTestSDKButtons::TestCEikTxtBtSetTextL |
|
1234 // ----------------------------------------------------------------------------- |
|
1235 // |
|
1236 TInt CTestSDKButtons::TestCEikTxtBtLabelL( CStifItemParser& /*aItem*/ ) |
|
1237 { |
|
1238 CEikTextButton* txtbt = new ( ELeave ) CEikTextButton; |
|
1239 CleanupStack::PushL( txtbt ); |
|
1240 TResourceReader reader; |
|
1241 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_TXTBT_BUTTON ); |
|
1242 txtbt->ConstructFromResourceL( reader ); |
|
1243 CEikLabel* label = NULL; |
|
1244 label = txtbt->Label(); |
|
1245 STIF_ASSERT_NOT_NULL( label ); |
|
1246 TPointerEvent event; |
|
1247 txtbt->HandlePointerEventL( event ); |
|
1248 CleanupStack::PopAndDestroy( 2 ); |
|
1249 |
|
1250 return KErrNone; |
|
1251 } |
|
1252 |
|
1253 // ----------------------------------------------------------------------------- |
|
1254 // CTestSDKButtons::TestCEikBmpBtConstructorL |
|
1255 // ----------------------------------------------------------------------------- |
|
1256 // |
|
1257 TInt CTestSDKButtons::TestCEikBmpBtConstructorL( CStifItemParser& /*aItem*/ ) |
|
1258 { |
|
1259 CEikBitmapButton* bmpbt = new ( ELeave ) CEikBitmapButton; |
|
1260 CleanupStack::PushL( bmpbt ); |
|
1261 STIF_ASSERT_NOT_NULL( bmpbt ); |
|
1262 CleanupStack::PopAndDestroy( bmpbt ); |
|
1263 |
|
1264 return KErrNone; |
|
1265 } |
|
1266 |
|
1267 // ----------------------------------------------------------------------------- |
|
1268 // CTestSDKButtons::TestCEikBmpBtConstructFromResourceL |
|
1269 // ----------------------------------------------------------------------------- |
|
1270 // |
|
1271 TInt CTestSDKButtons::TestCEikBmpBtConstructFromResourceL( CStifItemParser& /*aItem*/ ) |
|
1272 { |
|
1273 CEikBitmapButton* bmpbt = new ( ELeave ) CEikBitmapButton; |
|
1274 CleanupStack::PushL( bmpbt ); |
|
1275 TResourceReader reader; |
|
1276 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_BITMAPBT_BUTTON ); |
|
1277 bmpbt->ConstructFromResourceL( reader ); |
|
1278 CleanupStack::PopAndDestroy( 2 ); |
|
1279 |
|
1280 return KErrNone; |
|
1281 } |
|
1282 |
|
1283 // ----------------------------------------------------------------------------- |
|
1284 // CTestSDKButtons::TestCEikBmpBtPictureSetL |
|
1285 // ----------------------------------------------------------------------------- |
|
1286 // |
|
1287 TInt CTestSDKButtons::TestCEikBmpBtPictureSetL( CStifItemParser& /*aItem*/ ) |
|
1288 { |
|
1289 CEikBitmapButton* bmpbt = new ( ELeave ) CEikBitmapButton; |
|
1290 CleanupStack::PushL( bmpbt ); |
|
1291 TResourceReader reader; |
|
1292 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_BITMAPBT_BUTTON ); |
|
1293 bmpbt->ConstructFromResourceL( reader ); |
|
1294 CFbsBitmap* main = NULL; |
|
1295 CFbsBitmap* mask = NULL; |
|
1296 AknIconUtils::CreateIconL( main, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
1297 bmpbt->SetPictureL( main, mask ); |
|
1298 bmpbt->SetPictureFromFileL( KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
1299 CEikImage* image = NULL; |
|
1300 image = bmpbt->Picture(); |
|
1301 STIF_ASSERT_NOT_NULL( image ); |
|
1302 |
|
1303 TPointerEvent event; |
|
1304 bmpbt->HandlePointerEventL( event ); |
|
1305 |
|
1306 CleanupStack::PopAndDestroy( 2 ); |
|
1307 |
|
1308 return KErrNone; |
|
1309 } |
|
1310 |
|
1311 // ----------------------------------------------------------------------------- |
|
1312 // CTestSDKButtons::TestCEikCmdBtProcessCmdStackL |
|
1313 // ----------------------------------------------------------------------------- |
|
1314 // |
|
1315 TInt CTestSDKButtons::TestCEikCmdBtProcessCmdStackL( CStifItemParser& /*aItem*/ ) |
|
1316 { |
|
1317 CEikCommandButton* cmdbt = new ( ELeave ) CEikCommandButton; |
|
1318 CleanupStack::PushL( cmdbt ); |
|
1319 TResourceReader reader; |
|
1320 CCoeEnv::Static()->CreateResourceReaderLC( reader, R_CMBUT_BUTTON ); |
|
1321 cmdbt->ConstructFromResourceL( reader ); |
|
1322 CleanupStack::PopAndDestroy(); |
|
1323 CFbsBitmap* main = NULL; |
|
1324 CFbsBitmap* mask = NULL; |
|
1325 AknIconUtils::CreateIconL( main, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
1326 CleanupStack::PushL( main ); |
|
1327 CleanupStack::PushL( mask ); |
|
1328 _LIT( KText, "settext" ); |
|
1329 cmdbt->AddCommandToStackL( ESingle, &KText, main, mask ); |
|
1330 cmdbt->PopCommandFromStack(); |
|
1331 CleanupStack::Pop( mask ); |
|
1332 CleanupStack::Pop( main ); |
|
1333 AknIconUtils::CreateIconL( main, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ); |
|
1334 CleanupStack::PushL( main ); |
|
1335 CleanupStack::PushL( mask ); |
|
1336 cmdbt->AddCommandToStackL( EBckBt, &KText, main, mask ); |
|
1337 cmdbt->RemoveCommandFromStack( EBckBt ); |
|
1338 CleanupStack::Pop( mask ); |
|
1339 CleanupStack::Pop( main ); |
|
1340 |
|
1341 CleanupStack::PopAndDestroy( cmdbt ); |
|
1342 |
|
1343 return KErrNone; |
|
1344 } |
|
1345 // End of file |