classicui_pub/buttons_api/tsrc/src/testsdkbuttonsblockseikbtgpc.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     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 eikbtgpc.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 
       
    29 #include "testsdkbuttons.hrh"
       
    30 #include "testsdkbuttons.h"
       
    31 
       
    32 // CONSTANTS
       
    33 _LIT( KBtTxt, "BtGroupContainer" );
       
    34 _LIT( KBitmapFile, "Z:\\resource\\apps\\avkon2.mbm" );
       
    35 const TInt KHeapSize = 20000;
       
    36 
       
    37 // ============================ MEMBER FUNCTIONS ===============================
       
    38 
       
    39 // -----------------------------------------------------------------------------
       
    40 // CTestSDKButtons::TestCEikBtGroupContainerNewL
       
    41 // -----------------------------------------------------------------------------
       
    42 //
       
    43 TInt CTestSDKButtons::TestCEikBtGroupContainerNewL( CStifItemParser& aItem )
       
    44     {
       
    45     TInt num = 0;
       
    46     TInt err = aItem.GetNextInt( num );
       
    47     if ( err != KErrNone )
       
    48         {
       
    49         return err;
       
    50         }
       
    51     switch ( num )
       
    52         {
       
    53         case ECaseOne:
       
    54             {
       
    55             CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
    56                                                                                 CEikButtonGroupContainer::ECba,
       
    57                                                                                 CEikButtonGroupContainer::EHorizontal,
       
    58                                                                                 iContainer,
       
    59                                                                                 R_GPS_CBABUTTON );
       
    60             CleanupStack::PushL( btgroupcontainer );
       
    61             CleanupStack::PopAndDestroy( btgroupcontainer );
       
    62             break;
       
    63             }
       
    64         case ECaseTwo:
       
    65             {
       
    66             CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
    67                                                                                 CEikButtonGroupContainer::ECba,
       
    68                                                                                 CEikButtonGroupContainer::EHorizontal,
       
    69                                                                                 iContainer,
       
    70                                                                                 R_GPS_CBABUTTON,
       
    71                                                                                 *iContainer );
       
    72             CleanupStack::PushL( btgroupcontainer );
       
    73             CleanupStack::PopAndDestroy( btgroupcontainer );
       
    74             break;
       
    75             }
       
    76         case ECaseThree:
       
    77             {
       
    78             CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
    79                                                                     CEikButtonGroupContainer::ECba,
       
    80                                                                     CEikButtonGroupContainer::EHorizontal,
       
    81                                                                     iContainer,
       
    82                                                                     R_GPS_CBABUTTON,
       
    83                                                                     CCoeEnv::Static()->RootWin() );
       
    84             CleanupStack::PushL( btgroupcontainer );
       
    85             CleanupStack::PopAndDestroy( btgroupcontainer );
       
    86             break;
       
    87             }
       
    88         default:
       
    89             return KErrNotSupported;
       
    90         }
       
    91     
       
    92     return KErrNone;
       
    93     }
       
    94 
       
    95 // -----------------------------------------------------------------------------
       
    96 // CTestSDKButtons::TestCEikBtGroupContainerCurrent
       
    97 // -----------------------------------------------------------------------------
       
    98 //
       
    99 TInt CTestSDKButtons::TestCEikBtGroupContainerCurrent( CStifItemParser& /*aItem*/ )
       
   100     {
       
   101     CEikButtonGroupContainer::Current();
       
   102     
       
   103     return KErrNone;
       
   104     }
       
   105 
       
   106 // -----------------------------------------------------------------------------
       
   107 // CTestSDKButtons::TestCEikBtGroupContainerNewL
       
   108 // -----------------------------------------------------------------------------
       
   109 //
       
   110 TInt CTestSDKButtons::TestCEikBtGroupContainerSetCommandL( CStifItemParser& aItem )
       
   111     {
       
   112     TInt num = 0;
       
   113     TInt err = aItem.GetNextInt( num );
       
   114     if ( err != KErrNone )
       
   115         {
       
   116         return err;
       
   117         }
       
   118     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   119                                                                         CEikButtonGroupContainer::ECba,
       
   120                                                                         CEikButtonGroupContainer::EHorizontal,
       
   121                                                                         iContainer,
       
   122                                                                         R_GPS_CBABUTTON );
       
   123     CleanupStack::PushL( btgroupcontainer );
       
   124     switch ( num )
       
   125         {
       
   126         case ECaseOne:
       
   127             {
       
   128             btgroupcontainer->SetCommandL( 0, EBckBt, KBtTxt );
       
   129             break;
       
   130             }
       
   131         case ECaseTwo:
       
   132             {
       
   133             CFbsBitmap* bitmap = NULL;
       
   134             CFbsBitmap* mask = NULL;
       
   135             AknIconUtils::CreateIconL( bitmap, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
       
   136             CleanupStack::PushL( bitmap );
       
   137             CleanupStack::PushL( mask );
       
   138             btgroupcontainer->SetCommandL( 0, EBckBt, *bitmap, *mask );
       
   139             CleanupStack::Pop( 2 );
       
   140             break;
       
   141             }
       
   142         case ECaseThree:
       
   143             {
       
   144             CFbsBitmap* bitmap = NULL;
       
   145             CFbsBitmap* mask = NULL;
       
   146             AknIconUtils::CreateIconL( bitmap, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
       
   147             CleanupStack::PushL( bitmap );
       
   148             CleanupStack::PushL( mask );
       
   149             btgroupcontainer->SetCommandL( 0, EBckBt, KBtTxt , *bitmap, *mask );
       
   150             CleanupStack::Pop( 2 );
       
   151             break;
       
   152             }
       
   153         case ECaseFour:
       
   154             {
       
   155             btgroupcontainer->SetCommandL( 0, EBckBt, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
       
   156             break;
       
   157             }
       
   158         case ECaseFive:
       
   159             {
       
   160             btgroupcontainer->SetCommandL( 0, EBckBt, KBtTxt, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
       
   161             break;
       
   162             }
       
   163         case ECaseSix:
       
   164             {
       
   165             btgroupcontainer->SetCommandL( 0, R_GPS_CBABUTTON );
       
   166             break;
       
   167             }
       
   168         case ECaseSeven:
       
   169             {
       
   170             TRAP( err, btgroupcontainer->SetCommandL( EBckBt, KBtTxt ) );
       
   171             break;
       
   172             }
       
   173         case ECaseEight:
       
   174             {
       
   175             CFbsBitmap* bitmap = NULL;
       
   176             CFbsBitmap* mask = NULL;
       
   177             AknIconUtils::CreateIconL( bitmap, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
       
   178             CleanupStack::PushL( bitmap );
       
   179             CleanupStack::PushL( mask );
       
   180             TRAP( err, btgroupcontainer->SetCommandL( EBckBt, *bitmap, *mask ) );
       
   181             CleanupStack::Pop( 2 );
       
   182             break;
       
   183             }
       
   184         case ECaseNine:
       
   185             {
       
   186             CFbsBitmap* bitmap = NULL;
       
   187             CFbsBitmap* mask = NULL;
       
   188             AknIconUtils::CreateIconL( bitmap, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
       
   189             CleanupStack::PushL( bitmap );
       
   190             CleanupStack::PushL( mask );
       
   191             TRAP( err, btgroupcontainer->SetCommandL( EBckBt, KBtTxt , *bitmap, *mask ) );
       
   192             CleanupStack::Pop( 2 );
       
   193             break;
       
   194             }
       
   195         case ECaseTen:
       
   196             {
       
   197             TRAP( err, btgroupcontainer->SetCommandL( EBckBt, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ) );
       
   198             break;
       
   199             }
       
   200         case ECaseEleven:
       
   201             {
       
   202             TRAP( err, btgroupcontainer->SetCommandL( ELeftBt, KBtTxt, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ) );
       
   203             break;
       
   204             }
       
   205         default:
       
   206             CleanupStack::PopAndDestroy( btgroupcontainer );
       
   207             return KErrNotSupported;
       
   208         }
       
   209     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   210     
       
   211     if ( err != KErrNone )
       
   212         {
       
   213         err = KErrNone;
       
   214         }
       
   215     return err;
       
   216     }
       
   217 
       
   218 // -----------------------------------------------------------------------------
       
   219 // CTestSDKButtons::TestCEikBtGroupContainerSetCommandSetL
       
   220 // -----------------------------------------------------------------------------
       
   221 //
       
   222 TInt CTestSDKButtons::TestCEikBtGroupContainerSetCommandSetL( CStifItemParser& /*aItem*/ )
       
   223     {
       
   224     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   225                                                                         CEikButtonGroupContainer::ECba,
       
   226                                                                         CEikButtonGroupContainer::EHorizontal,
       
   227                                                                         iContainer,
       
   228                                                                         R_GPS_CBABUTTON );
       
   229     CleanupStack::PushL( btgroupcontainer );
       
   230     btgroupcontainer->SetCommandSetL( R_GPS_CBABUTTON_FORSET );
       
   231     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   232     
       
   233     return KErrNone;
       
   234     }
       
   235 
       
   236 // -----------------------------------------------------------------------------
       
   237 // CTestSDKButtons::TestCEikBtGroupContainerSetCommandSetL
       
   238 // -----------------------------------------------------------------------------
       
   239 //
       
   240 TInt CTestSDKButtons::TestCEikBtGroupContainerAddCommandL( CStifItemParser& aItem )
       
   241     {
       
   242     TInt num = 0;
       
   243     TInt err = aItem.GetNextInt( num );
       
   244     if ( err != KErrNone )
       
   245         {
       
   246         return err;
       
   247         }
       
   248     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   249                                                                         CEikButtonGroupContainer::ECba,
       
   250                                                                         CEikButtonGroupContainer::EHorizontal,
       
   251                                                                         iContainer,
       
   252                                                                         R_GPS_CBABUTTON );
       
   253     CleanupStack::PushL( btgroupcontainer );
       
   254     CFbsBitmap* bitmap = NULL;
       
   255     CFbsBitmap* mask = NULL;
       
   256     switch ( num )
       
   257         {
       
   258         case ECaseOne:
       
   259             {
       
   260             TRAP( err, btgroupcontainer->AddCommandL( 0, EBckBt, KBtTxt ) );
       
   261             break;
       
   262             }
       
   263         case ECaseTwo:
       
   264             {
       
   265             AknIconUtils::CreateIconL( bitmap, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
       
   266             CleanupStack::PushL( bitmap );
       
   267             CleanupStack::PushL( mask );
       
   268             TRAP( err, btgroupcontainer->AddCommandL( 0, EBckBt, *bitmap, *mask ) );
       
   269             CleanupStack::Pop( 2 );
       
   270             break;
       
   271             }
       
   272         case ECaseThree:
       
   273             {
       
   274             AknIconUtils::CreateIconL( bitmap, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
       
   275             CleanupStack::PushL( bitmap );
       
   276             CleanupStack::PushL( mask );
       
   277             TRAP( err, btgroupcontainer->AddCommandL( 0, EBckBt, KBtTxt, *bitmap, *mask ) );
       
   278             CleanupStack::Pop( 2 );
       
   279             break;
       
   280             }
       
   281         case ECaseFour:
       
   282             {
       
   283             TRAP( err, btgroupcontainer->AddCommandL( 0, EBckBt, KBitmapFile, *bitmap, *mask ) );
       
   284             break;
       
   285             }
       
   286         case ECaseFive:
       
   287             {
       
   288             TRAP( err, btgroupcontainer->AddCommandL( 0, EBckBt, KBtTxt, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask ) );
       
   289             break;
       
   290             }
       
   291         default:
       
   292             CleanupStack::PopAndDestroy( btgroupcontainer );
       
   293             return KErrNotSupported;
       
   294         }
       
   295     
       
   296     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   297     if ( err != KErrNone )
       
   298         {
       
   299         err = KErrNone;
       
   300         }
       
   301     return err;
       
   302     }
       
   303 
       
   304 // -----------------------------------------------------------------------------
       
   305 // CTestSDKButtons::TestCEikBtGroupContainerSetCommandSetL
       
   306 // -----------------------------------------------------------------------------
       
   307 //
       
   308 TInt CTestSDKButtons::TestCEikBtGroupContainerAddCommandToStackL( CStifItemParser& aItem )
       
   309     {
       
   310     TInt num = 0;
       
   311     TInt err = aItem.GetNextInt( num );
       
   312     if ( err != KErrNone )
       
   313         {
       
   314         return err;
       
   315         }
       
   316     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   317                                                                         CEikButtonGroupContainer::ECba,
       
   318                                                                         CEikButtonGroupContainer::EHorizontal,
       
   319                                                                         iContainer,
       
   320                                                                         R_GPS_CBABUTTON );
       
   321     CleanupStack::PushL( btgroupcontainer );
       
   322     CFbsBitmap* bitmap = NULL;
       
   323     CFbsBitmap* mask = NULL;
       
   324     switch ( num )
       
   325         {
       
   326         case ECaseOne:
       
   327             {
       
   328             btgroupcontainer->AddCommandToStackL( 0, EBckBt, KBtTxt );
       
   329             break;
       
   330             }
       
   331         case ECaseTwo:
       
   332             {
       
   333             AknIconUtils::CreateIconL( bitmap, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
       
   334             CleanupStack::PushL( bitmap );
       
   335             CleanupStack::PushL( mask );
       
   336             btgroupcontainer->AddCommandToStackL( 0, EBckBt, *bitmap, *mask );
       
   337             CleanupStack::Pop( 2 );
       
   338             break;
       
   339             }
       
   340         case ECaseThree:
       
   341             {
       
   342             AknIconUtils::CreateIconL( bitmap, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
       
   343             CleanupStack::PushL( bitmap );
       
   344             CleanupStack::PushL( mask );
       
   345             btgroupcontainer->AddCommandToStackL( 0, EBckBt, KBtTxt, *bitmap, *mask );
       
   346             CleanupStack::Pop( 2 );
       
   347             break;
       
   348             }
       
   349         case ECaseFour:
       
   350             {
       
   351             AknIconUtils::CreateIconL( bitmap, mask, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
       
   352             CleanupStack::PushL( bitmap );
       
   353             CleanupStack::PushL( mask );
       
   354             btgroupcontainer->AddCommandToStackL( 0, EBckBt, KBitmapFile, *bitmap, *mask );
       
   355             CleanupStack::Pop( 2 );
       
   356             break;
       
   357             }
       
   358         case ECaseFive:
       
   359             {
       
   360             btgroupcontainer->AddCommandToStackL( 0, EBckBt, KBtTxt, KBitmapFile, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
       
   361             break;
       
   362             }
       
   363         case ECaseSix:
       
   364             {
       
   365             btgroupcontainer->AddCommandToStackL( 0, R_GPS_CBABUTTON_FORSET );
       
   366             break;
       
   367             }
       
   368         default:
       
   369             CleanupStack::PopAndDestroy( btgroupcontainer );
       
   370             return KErrNotSupported;
       
   371         }
       
   372     CCoeEnv::Static()->AppUi()->RemoveFromStack( btgroupcontainer );
       
   373     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   374     
       
   375     return KErrNone;
       
   376     }
       
   377 
       
   378 // -----------------------------------------------------------------------------
       
   379 // CTestSDKButtons::TestCEikBtGroupContainerAddCommandSetToStackL
       
   380 // -----------------------------------------------------------------------------
       
   381 //
       
   382 TInt CTestSDKButtons::TestCEikBtGroupContainerAddCommandSetToStackL( CStifItemParser& /*aItem*/ )
       
   383     {
       
   384     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   385                                                                         CEikButtonGroupContainer::ECba,
       
   386                                                                         CEikButtonGroupContainer::EHorizontal,
       
   387                                                                         iContainer,
       
   388                                                                         R_GPS_CBABUTTON );
       
   389     CleanupStack::PushL( btgroupcontainer );
       
   390     btgroupcontainer->AddCommandSetToStackL( R_GPS_CBABUTTON_FORSET );
       
   391     CCoeEnv::Static()->AppUi()->RemoveFromStack( btgroupcontainer );
       
   392     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   393     
       
   394     return KErrNone;
       
   395     }
       
   396 
       
   397 // -----------------------------------------------------------------------------
       
   398 // CTestSDKButtons::TestCEikBtGroupContainerRemoveCommandFromStackL
       
   399 // -----------------------------------------------------------------------------
       
   400 //
       
   401 TInt CTestSDKButtons::TestCEikBtGroupContainerRemoveCommandFromStackL( CStifItemParser& /*aItem*/ )
       
   402     {
       
   403     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   404                                                                         CEikButtonGroupContainer::ECba,
       
   405                                                                         CEikButtonGroupContainer::EHorizontal,
       
   406                                                                         iContainer,
       
   407                                                                         R_GPS_CBABUTTON );
       
   408     CleanupStack::PushL( btgroupcontainer );
       
   409     btgroupcontainer->AddCommandSetToStackL( R_GPS_CBABUTTON_FORSET );
       
   410     btgroupcontainer->RemoveCommandFromStack( 0, ELeftBt );
       
   411     
       
   412     CCoeEnv::Static()->AppUi()->RemoveFromStack( btgroupcontainer );
       
   413     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   414     
       
   415     return KErrNone;
       
   416     }
       
   417 
       
   418 // -----------------------------------------------------------------------------
       
   419 // CTestSDKButtons::TestCEikBtGroupContainerSetDefaultCommandL
       
   420 // -----------------------------------------------------------------------------
       
   421 //
       
   422 TInt CTestSDKButtons::TestCEikBtGroupContainerSetDefaultCommandL( CStifItemParser& /*aItem*/ )
       
   423     {
       
   424     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   425                                                                         CEikButtonGroupContainer::ECba,
       
   426                                                                         CEikButtonGroupContainer::EHorizontal,
       
   427                                                                         iContainer,
       
   428                                                                         R_GPS_CBABUTTON );
       
   429     CleanupStack::PushL( btgroupcontainer );
       
   430     btgroupcontainer->AddCommandSetToStackL( R_GPS_CBABUTTON_FORSET );
       
   431     btgroupcontainer->SetDefaultCommand( ELeftBt );
       
   432     
       
   433     CCoeEnv::Static()->AppUi()->RemoveFromStack( btgroupcontainer );
       
   434     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   435     
       
   436     return KErrNone;
       
   437     }
       
   438 
       
   439 // -----------------------------------------------------------------------------
       
   440 // CTestSDKButtons::TestCEikBtGroupContainerCalcMinimumSizeL
       
   441 // -----------------------------------------------------------------------------
       
   442 //
       
   443 TInt CTestSDKButtons::TestCEikBtGroupContainerCalcMinimumSizeL( CStifItemParser& /*aItem*/ )
       
   444     {
       
   445     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   446                                                                         CEikButtonGroupContainer::ECba,
       
   447                                                                         CEikButtonGroupContainer::EHorizontal,
       
   448                                                                         iContainer,
       
   449                                                                         R_GPS_CBABUTTON );
       
   450     CleanupStack::PushL( btgroupcontainer );
       
   451     TSize size( 0, 0);
       
   452     size = btgroupcontainer->CalcMinimumSizeL( R_GPS_CBABUTTON );
       
   453     if ( size.iHeight == 0 || size.iWidth == 0 )
       
   454         {
       
   455         CCoeEnv::Static()->AppUi()->RemoveFromStack( btgroupcontainer );
       
   456         CleanupStack::PopAndDestroy( btgroupcontainer );
       
   457         return KErrGeneral;
       
   458         }
       
   459     CCoeEnv::Static()->AppUi()->RemoveFromStack( btgroupcontainer );
       
   460     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   461     
       
   462     return KErrNone;
       
   463     }
       
   464 
       
   465 // -----------------------------------------------------------------------------
       
   466 // CTestSDKButtons::TestCEikBtGroupContainerCalcMinimumSizeL
       
   467 // -----------------------------------------------------------------------------
       
   468 //
       
   469 TInt CTestSDKButtons::TestCEikBtGroupContainerCleanupFunctionL( CStifItemParser& /*aItem*/ )
       
   470     {
       
   471     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   472                                                                         CEikButtonGroupContainer::ECba,
       
   473                                                                         CEikButtonGroupContainer::EHorizontal,
       
   474                                                                         iContainer,
       
   475                                                                         R_GPS_CBABUTTON );
       
   476     CleanupStack::PushL( btgroupcontainer );
       
   477     btgroupcontainer->CleanupCommandPushL( 0 );
       
   478     btgroupcontainer->CleanupCommandPop();
       
   479     btgroupcontainer->CleanupCommandPushL( 0 );
       
   480     btgroupcontainer->CleanupCommandPushL( 1 );
       
   481     btgroupcontainer->CleanupCommandPop( 2 );
       
   482     
       
   483     btgroupcontainer->CleanupCommandPushL( 0 );
       
   484     btgroupcontainer->CleanupCommandPopAndDestroy();
       
   485     btgroupcontainer->CleanupCommandPushL( 0 );
       
   486     btgroupcontainer->CleanupCommandPopAndDestroy( 1 );
       
   487     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   488     
       
   489     return KErrNone;
       
   490     }
       
   491 
       
   492 // -----------------------------------------------------------------------------
       
   493 // CTestSDKButtons::TestCEikBtGroupContainerBtNumberL
       
   494 // -----------------------------------------------------------------------------
       
   495 //
       
   496 TInt CTestSDKButtons::TestCEikBtGroupContainerBtNumberL( CStifItemParser& /*aItem*/ )
       
   497     {
       
   498     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   499                                                                         CEikButtonGroupContainer::ECba,
       
   500                                                                         CEikButtonGroupContainer::EHorizontal,
       
   501                                                                         iContainer,
       
   502                                                                         R_GPS_CBABUTTON );
       
   503     CleanupStack::PushL( btgroupcontainer );
       
   504     btgroupcontainer->AddCommandSetToStackL( R_GPS_CBABUTTON_FORSET );
       
   505     btgroupcontainer->MaxCommands();
       
   506     TInt count = btgroupcontainer->ButtonCount();
       
   507     if ( count != 3 )
       
   508         {
       
   509         CCoeEnv::Static()->AppUi()->RemoveFromStack( btgroupcontainer );
       
   510         CleanupStack::PopAndDestroy( btgroupcontainer );
       
   511         return KErrGeneral;
       
   512         }
       
   513     CCoeEnv::Static()->AppUi()->RemoveFromStack( btgroupcontainer );
       
   514     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   515     
       
   516     return KErrNone;
       
   517     }
       
   518 
       
   519 // -----------------------------------------------------------------------------
       
   520 // CTestSDKButtons::TestCEikBtGroupContainerCmdDimL
       
   521 // -----------------------------------------------------------------------------
       
   522 //
       
   523 TInt CTestSDKButtons::TestCEikBtGroupContainerCmdDimL( CStifItemParser& /*aItem*/ )
       
   524     {
       
   525     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   526                                                                         CEikButtonGroupContainer::ECba,
       
   527                                                                         CEikButtonGroupContainer::EHorizontal,
       
   528                                                                         iContainer,
       
   529                                                                         R_GPS_CBABUTTON );
       
   530     CleanupStack::PushL( btgroupcontainer );
       
   531     btgroupcontainer->DimCommand( ELeftBt, ETrue );
       
   532     TBool result = btgroupcontainer->IsCommandDimmed( ELeftBt );
       
   533     if ( result )
       
   534         {
       
   535         CleanupStack::PopAndDestroy( btgroupcontainer );
       
   536         return KErrCorrupt;
       
   537         }
       
   538     btgroupcontainer->DimCommandByPosition( CEikButtonGroupContainer::ELeftSoftkeyPosition, EFalse );
       
   539     result = btgroupcontainer->IsCommandDimmedByPosition( CEikButtonGroupContainer::ELeftSoftkeyPosition );
       
   540     if ( result )
       
   541         {
       
   542         CleanupStack::PopAndDestroy( btgroupcontainer );
       
   543         return KErrCorrupt;
       
   544         }
       
   545     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   546     
       
   547     return KErrNone;
       
   548     }
       
   549 
       
   550 
       
   551 // -----------------------------------------------------------------------------
       
   552 // CTestSDKButtons::TestCEikBtGroupContainerCmdAnimateL
       
   553 // -----------------------------------------------------------------------------
       
   554 //
       
   555 TInt CTestSDKButtons::TestCEikBtGroupContainerCmdAnimateL( CStifItemParser& /*aItem*/ )
       
   556     {
       
   557     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   558                                                                         CEikButtonGroupContainer::ECba,
       
   559                                                                         CEikButtonGroupContainer::EHorizontal,
       
   560                                                                         iContainer,
       
   561                                                                         R_GPS_CBABUTTON );
       
   562     CleanupStack::PushL( btgroupcontainer );
       
   563     btgroupcontainer->AnimateCommand( ELeftBt );
       
   564     btgroupcontainer->AnimateCommandByPosition( CEikButtonGroupContainer::ELeftSoftkeyPosition );
       
   565     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   566     
       
   567     return KErrNone;
       
   568     }
       
   569 
       
   570 // -----------------------------------------------------------------------------
       
   571 // CTestSDKButtons::TestCEikBtGroupContainerCmdVisibleL
       
   572 // -----------------------------------------------------------------------------
       
   573 //
       
   574 TInt CTestSDKButtons::TestCEikBtGroupContainerCmdVisibleL( CStifItemParser& /*aItem*/ )
       
   575     {
       
   576     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   577                                                                         CEikButtonGroupContainer::ECba,
       
   578                                                                         CEikButtonGroupContainer::EHorizontal,
       
   579                                                                         iContainer,
       
   580                                                                         R_GPS_CBABUTTON );
       
   581     CleanupStack::PushL( btgroupcontainer );
       
   582     btgroupcontainer->MakeCommandVisible( ELeftBt, ETrue );
       
   583     TBool result = btgroupcontainer->IsCommandVisible( ELeftBt );
       
   584     if ( result )
       
   585         {
       
   586         CleanupStack::PopAndDestroy( btgroupcontainer );
       
   587         return KErrCorrupt;
       
   588         }
       
   589     btgroupcontainer->MakeCommandVisibleByPosition( CEikButtonGroupContainer::ELeftSoftkeyPosition, EFalse );
       
   590     result = btgroupcontainer->IsCommandVisibleByPosition( CEikButtonGroupContainer::ELeftSoftkeyPosition );
       
   591     if ( result )
       
   592         {
       
   593         CleanupStack::PopAndDestroy( btgroupcontainer );
       
   594         return KErrCorrupt;
       
   595         }
       
   596     
       
   597     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   598     
       
   599     return KErrNone;
       
   600     }
       
   601 
       
   602 // -----------------------------------------------------------------------------
       
   603 // CTestSDKButtons::TestCEikBtGroupContainerLocationL
       
   604 // -----------------------------------------------------------------------------
       
   605 //
       
   606 TInt CTestSDKButtons::TestCEikBtGroupContainerLocationL( CStifItemParser& /*aItem*/ )
       
   607     {
       
   608     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   609                                                                         CEikButtonGroupContainer::ECba,
       
   610                                                                         CEikButtonGroupContainer::EHorizontal,
       
   611                                                                         iContainer,
       
   612                                                                         R_GPS_CBABUTTON );
       
   613     CleanupStack::PushL( btgroupcontainer );
       
   614     CEikButtonGroupContainer::TLocation local = btgroupcontainer->Location();
       
   615     if ( local != CEikButtonGroupContainer::EExternal )
       
   616         {
       
   617         CleanupStack::PopAndDestroy( btgroupcontainer );
       
   618         return KErrCorrupt;
       
   619         }
       
   620     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   621     
       
   622     return KErrNone;
       
   623     }
       
   624 
       
   625 // -----------------------------------------------------------------------------
       
   626 // CTestSDKButtons::TestCEikBtGroupContainerCommandButtonOrNullL
       
   627 // -----------------------------------------------------------------------------
       
   628 //
       
   629 TInt CTestSDKButtons::TestCEikBtGroupContainerCommandButtonOrNullL( CStifItemParser& /*aItem*/ )
       
   630     {
       
   631     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   632                                                                         CEikButtonGroupContainer::ECba,
       
   633                                                                         CEikButtonGroupContainer::EHorizontal,
       
   634                                                                         iContainer,
       
   635                                                                         R_GPS_CBABUTTON );
       
   636     CleanupStack::PushL( btgroupcontainer );
       
   637     btgroupcontainer->CommandButtonOrNull( ELeftBt );
       
   638     // debug will panic directly and urel will return null directly 
       
   639     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   640     
       
   641     return KErrNone;
       
   642     }
       
   643 
       
   644 // -----------------------------------------------------------------------------
       
   645 // CTestSDKButtons::TestCEikBtGroupContainerControlOrNullL
       
   646 // -----------------------------------------------------------------------------
       
   647 //
       
   648 TInt CTestSDKButtons::TestCEikBtGroupContainerControlOrNullL( CStifItemParser& /*aItem*/ )
       
   649     {
       
   650     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   651                                                                         CEikButtonGroupContainer::ECba,
       
   652                                                                         CEikButtonGroupContainer::EHorizontal,
       
   653                                                                         iContainer,
       
   654                                                                         R_GPS_CBABUTTON );
       
   655     CleanupStack::PushL( btgroupcontainer );
       
   656     btgroupcontainer->ControlOrNull( ELeftBt );
       
   657     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   658     
       
   659     return KErrNone;
       
   660     }
       
   661 
       
   662 // -----------------------------------------------------------------------------
       
   663 // CTestSDKButtons::TestCEikBtGroupContainerSetBoundingRectL
       
   664 // -----------------------------------------------------------------------------
       
   665 //
       
   666 TInt CTestSDKButtons::TestCEikBtGroupContainerSetBoundingRectL( CStifItemParser& /*aItem*/ )
       
   667     {
       
   668     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   669                                                                         CEikButtonGroupContainer::ECba,
       
   670                                                                         CEikButtonGroupContainer::EHorizontal,
       
   671                                                                         iContainer,
       
   672                                                                         R_GPS_CBABUTTON );
       
   673     CleanupStack::PushL( btgroupcontainer );
       
   674     TRect rect( 20, 20, 40, 40);
       
   675     btgroupcontainer->SetBoundingRect( rect );
       
   676     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   677     
       
   678     return KErrNone;
       
   679     }
       
   680 
       
   681 // -----------------------------------------------------------------------------
       
   682 // CTestSDKButtons::TestCEikBtGroupContainerReduceRectL
       
   683 // -----------------------------------------------------------------------------
       
   684 //
       
   685 TInt CTestSDKButtons::TestCEikBtGroupContainerReduceRectL( CStifItemParser& /*aItem*/ )
       
   686     {
       
   687     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   688                                                                         CEikButtonGroupContainer::ECba,
       
   689                                                                         CEikButtonGroupContainer::EHorizontal,
       
   690                                                                         iContainer,
       
   691                                                                         R_GPS_CBABUTTON );
       
   692     CleanupStack::PushL( btgroupcontainer );
       
   693     TRect rect( 20, 20, 40, 40);
       
   694     btgroupcontainer->ReduceRect( rect );
       
   695     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   696     
       
   697     return KErrNone;
       
   698     }
       
   699 
       
   700 // -----------------------------------------------------------------------------
       
   701 // CTestSDKButtons::TestCEikBtGroupContainerGetBtAndBtPositionAndBtTypeL
       
   702 // -----------------------------------------------------------------------------
       
   703 //
       
   704 TInt CTestSDKButtons::TestCEikBtGroupContainerGetBtAndBtPositionAndBtTypeL( CStifItemParser& /*aItem*/ )
       
   705     {
       
   706     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   707                                                                         CEikButtonGroupContainer::ECba,
       
   708                                                                         CEikButtonGroupContainer::EHorizontal,
       
   709                                                                         iContainer,
       
   710                                                                         R_GPS_CBABUTTON );
       
   711     CleanupStack::PushL( btgroupcontainer );
       
   712     btgroupcontainer->ButtonById( ELeftBt );
       
   713     // debug will panic directly and urel will return null directly 
       
   714     btgroupcontainer->PositionById( ELeftBt );
       
   715     // debug will panic directly and urel will return null directly 
       
   716     if (CEikButtonGroupContainer::ECba != btgroupcontainer->ButtonGroupType() )
       
   717         {
       
   718         return KErrCorrupt;
       
   719         }
       
   720     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   721     
       
   722     return KErrNone;
       
   723     }
       
   724 
       
   725 // -----------------------------------------------------------------------------
       
   726 // CTestSDKButtons::TestCEikBtGroupContainerUpdateHotKeyL
       
   727 // -----------------------------------------------------------------------------
       
   728 //
       
   729 TInt CTestSDKButtons::TestCEikBtGroupContainerUpdateHotKeyL( CStifItemParser& /*aItem*/ )
       
   730     {
       
   731     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   732                                                                         CEikButtonGroupContainer::ECba,
       
   733                                                                         CEikButtonGroupContainer::EHorizontal,
       
   734                                                                         iContainer,
       
   735                                                                         R_GPS_CBABUTTON );
       
   736     CleanupStack::PushL( btgroupcontainer );
       
   737     btgroupcontainer->UpdateHotKey( ELeftBt, CEikButtonGroupContainer::EShowHotKey, 0 );
       
   738     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   739     
       
   740     return KErrNone;
       
   741     }
       
   742 
       
   743 // -----------------------------------------------------------------------------
       
   744 // CTestSDKButtons::TestCEikBtGroupContainerUpdateCommandObserverL
       
   745 // -----------------------------------------------------------------------------
       
   746 //
       
   747 TInt CTestSDKButtons::TestCEikBtGroupContainerUpdateCommandObserverL( CStifItemParser& /*aItem*/ )
       
   748     {
       
   749     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   750                                                                         CEikButtonGroupContainer::ECba,
       
   751                                                                         CEikButtonGroupContainer::EHorizontal,
       
   752                                                                         iContainer,
       
   753                                                                         R_GPS_CBABUTTON );
       
   754     CleanupStack::PushL( btgroupcontainer );
       
   755     btgroupcontainer->UpdateCommandObserverL( 0, *iContainer );
       
   756     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   757     
       
   758     return KErrNone;
       
   759     }
       
   760 
       
   761 // -----------------------------------------------------------------------------
       
   762 // CTestSDKButtons::TestCEikBtGroupContainerRemoveCommandObserverL
       
   763 // -----------------------------------------------------------------------------
       
   764 //
       
   765 TInt CTestSDKButtons::TestCEikBtGroupContainerRemoveCommandObserverL( CStifItemParser& /*aItem*/ )
       
   766     {
       
   767     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   768                                                                         CEikButtonGroupContainer::ECba,
       
   769                                                                         CEikButtonGroupContainer::EHorizontal,
       
   770                                                                         iContainer,
       
   771                                                                         R_GPS_CBABUTTON );
       
   772     CleanupStack::PushL( btgroupcontainer );
       
   773     btgroupcontainer->UpdateCommandObserverL( 0, *iContainer );
       
   774     btgroupcontainer->RemoveCommandObserver( 0 );
       
   775     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   776     
       
   777     return KErrNone;
       
   778     }
       
   779 
       
   780 // -----------------------------------------------------------------------------
       
   781 // CTestSDKButtons::TestCEikBtGroupContainerUpdatedCommandObserverExistsL
       
   782 // -----------------------------------------------------------------------------
       
   783 //
       
   784 TInt CTestSDKButtons::TestCEikBtGroupContainerUpdatedCommandObserverExistsL( CStifItemParser& /*aItem*/ )
       
   785     {
       
   786     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   787                                                                         CEikButtonGroupContainer::ECba,
       
   788                                                                         CEikButtonGroupContainer::EHorizontal,
       
   789                                                                         iContainer,
       
   790                                                                         R_GPS_CBABUTTON );
       
   791     CleanupStack::PushL( btgroupcontainer );
       
   792     btgroupcontainer->UpdatedCommandObserverExists( CEikButtonGroupContainer::ELeftSoftkeyPosition );
       
   793     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   794     
       
   795     return KErrNone;
       
   796     }
       
   797 
       
   798 // -----------------------------------------------------------------------------
       
   799 // CTestSDKButtons::TestCEikBtGroupContainerDelayActivationL
       
   800 // -----------------------------------------------------------------------------
       
   801 //
       
   802 TInt CTestSDKButtons::TestCEikBtGroupContainerDelayActivationL( CStifItemParser& /*aItem*/ )
       
   803     {
       
   804     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   805                                                                         CEikButtonGroupContainer::ECba,
       
   806                                                                         CEikButtonGroupContainer::EHorizontal,
       
   807                                                                         iContainer,
       
   808                                                                         R_GPS_CBABUTTON );
       
   809     CleanupStack::PushL( btgroupcontainer );
       
   810     btgroupcontainer->DelayActivation();
       
   811     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   812     
       
   813     return KErrNone;
       
   814     }
       
   815 
       
   816 // -----------------------------------------------------------------------------
       
   817 // CTestSDKButtons::TestCEikBtGroupContainerButtonGroupL
       
   818 // -----------------------------------------------------------------------------
       
   819 //
       
   820 TInt CTestSDKButtons::TestCEikBtGroupContainerButtonGroupL( CStifItemParser& /*aItem*/ )
       
   821     {
       
   822     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   823                                                                         CEikButtonGroupContainer::ECba,
       
   824                                                                         CEikButtonGroupContainer::EHorizontal,
       
   825                                                                         iContainer,
       
   826                                                                         R_GPS_CBABUTTON );
       
   827     CleanupStack::PushL( btgroupcontainer );
       
   828     STIF_ASSERT_NOT_NULL( btgroupcontainer->ButtonGroup() );
       
   829     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   830     
       
   831     return KErrNone;
       
   832     }
       
   833 
       
   834 // -----------------------------------------------------------------------------
       
   835 // CTestSDKButtons::TestCEikBtGroupContainerReservedFunctionL
       
   836 // -----------------------------------------------------------------------------
       
   837 //
       
   838 TInt CTestSDKButtons::TestCEikBtGroupContainerReservedFunctionL( CStifItemParser& /*aItem*/ )
       
   839     {
       
   840     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   841                                                                         CEikButtonGroupContainer::ECba,
       
   842                                                                         CEikButtonGroupContainer::EHorizontal,
       
   843                                                                         iContainer,
       
   844                                                                         R_GPS_CBABUTTON );
       
   845     CleanupStack::PushL( btgroupcontainer );
       
   846     btgroupcontainer->Reserved_MtsmObject();
       
   847     btgroupcontainer->Reserved_MtsmPosition();
       
   848     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   849     
       
   850     return KErrNone;
       
   851     }
       
   852 
       
   853 // -----------------------------------------------------------------------------
       
   854 // CTestSDKButtons::TestCEikBtGroupContainerOfferCommandListL
       
   855 // -----------------------------------------------------------------------------
       
   856 //
       
   857 TInt CTestSDKButtons::TestCEikBtGroupContainerOfferCommandListL( CStifItemParser& /*aItem*/ )
       
   858     {
       
   859     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   860                                                                         CEikButtonGroupContainer::ECba,
       
   861                                                                         CEikButtonGroupContainer::EHorizontal,
       
   862                                                                         iContainer,
       
   863                                                                         R_GPS_CBABUTTON );
       
   864     CleanupStack::PushL( btgroupcontainer );
       
   865     RArray<TInt> cmdlist;
       
   866     for ( TInt i = 0; i < btgroupcontainer->ButtonCount(); i++ )
       
   867         {
       
   868         cmdlist.AppendL( i );
       
   869         }
       
   870     btgroupcontainer->OfferCommandListL( cmdlist );
       
   871     btgroupcontainer->OfferCommandListL( R_GPS_CBABUTTON_FORSET );
       
   872     STIF_ASSERT_NOT_NULL( btgroupcontainer->ButtonGroup() );
       
   873     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   874     
       
   875     return KErrNone;
       
   876     }
       
   877 
       
   878 // -----------------------------------------------------------------------------
       
   879 // CTestSDKButtons::TestCEikBtGroupContainerIsCommandInGroupL
       
   880 // -----------------------------------------------------------------------------
       
   881 //
       
   882 TInt CTestSDKButtons::TestCEikBtGroupContainerIsCommandInGroupL( CStifItemParser& /*aItem*/ )
       
   883     {
       
   884     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   885                                                                         CEikButtonGroupContainer::ECba,
       
   886                                                                         CEikButtonGroupContainer::EHorizontal,
       
   887                                                                         iContainer,
       
   888                                                                         R_GPS_CBABUTTON );
       
   889     CleanupStack::PushL( btgroupcontainer );
       
   890     btgroupcontainer->IsCommandInGroup( ELeftBt );
       
   891     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   892     
       
   893     return KErrNone;
       
   894     }
       
   895 
       
   896 // -----------------------------------------------------------------------------
       
   897 // CTestSDKButtons::TestCEikBtGroupContainerIsCommandInGroupL
       
   898 // -----------------------------------------------------------------------------
       
   899 //
       
   900 TInt CTestSDKButtons::TestCEikBtGroupContainerReplaceCommandL( CStifItemParser& /*aItem*/ )
       
   901     {
       
   902     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   903                                                                         CEikButtonGroupContainer::ECba,
       
   904                                                                         CEikButtonGroupContainer::EHorizontal,
       
   905                                                                         iContainer,
       
   906                                                                         R_GPS_CBABUTTON );
       
   907     CleanupStack::PushL( btgroupcontainer );
       
   908     btgroupcontainer->ReplaceCommand( ELeftBt, R_GPS_BUTTON );
       
   909     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   910     
       
   911     return KErrNone;
       
   912     }
       
   913 
       
   914 // -----------------------------------------------------------------------------
       
   915 // CTestSDKButtons::TestCEikBtGroupContainerMinimumSizeL
       
   916 // -----------------------------------------------------------------------------
       
   917 //
       
   918 TInt CTestSDKButtons::TestCEikBtGroupContainerMinimumSizeL( CStifItemParser& /*aItem*/ )
       
   919     {
       
   920     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   921                                                                         CEikButtonGroupContainer::ECba,
       
   922                                                                         CEikButtonGroupContainer::EHorizontal,
       
   923                                                                         iContainer,
       
   924                                                                         R_GPS_CBABUTTON );
       
   925     CleanupStack::PushL( btgroupcontainer );
       
   926     btgroupcontainer->MinimumSize();
       
   927     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   928     
       
   929     return KErrNone;
       
   930     }
       
   931 
       
   932 // -----------------------------------------------------------------------------
       
   933 // CTestSDKButtons::TestCEikBtGroupContainerMinimumSizeL
       
   934 // -----------------------------------------------------------------------------
       
   935 //
       
   936 TInt CTestSDKButtons::TestCEikBtGroupContainerOfferKeyEventL( CStifItemParser& /*aItem*/ )
       
   937     {
       
   938     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   939                                                                         CEikButtonGroupContainer::ECba,
       
   940                                                                         CEikButtonGroupContainer::EHorizontal,
       
   941                                                                         iContainer,
       
   942                                                                         R_GPS_CBABUTTON );
       
   943     CleanupStack::PushL( btgroupcontainer );
       
   944     TKeyEvent keyevent;
       
   945     keyevent.iCode = EKeyDevice3;
       
   946     btgroupcontainer->OfferKeyEventL( keyevent, EEventKey );
       
   947     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   948     
       
   949     return KErrNone;
       
   950     }
       
   951 
       
   952 
       
   953 // -----------------------------------------------------------------------------
       
   954 // CTestSDKButtons::TestCEikBtGroupContainerMinimumSizeL
       
   955 // -----------------------------------------------------------------------------
       
   956 //
       
   957 TInt CTestSDKButtons::TestCEikBtGroupContainerMakeVisibleL( CStifItemParser& /*aItem*/ )
       
   958     {
       
   959     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   960                                                                         CEikButtonGroupContainer::ECba,
       
   961                                                                         CEikButtonGroupContainer::EHorizontal,
       
   962                                                                         iContainer,
       
   963                                                                         R_GPS_CBABUTTON );
       
   964     CleanupStack::PushL( btgroupcontainer );
       
   965     btgroupcontainer->MakeVisible( ETrue );
       
   966     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   967     
       
   968     return KErrNone;
       
   969     }
       
   970 
       
   971 
       
   972 // -----------------------------------------------------------------------------
       
   973 // CTestSDKButtons::TestCEikBtGroupContainerMinimumSizeL
       
   974 // -----------------------------------------------------------------------------
       
   975 //
       
   976 TInt CTestSDKButtons::TestCEikBtGroupContainerWriteInternalStateL( CStifItemParser& /*aItem*/ )
       
   977     {
       
   978     CEikButtonGroupContainer* btgroupcontainer = CEikButtonGroupContainer::NewL(
       
   979                                                                         CEikButtonGroupContainer::ECba,
       
   980                                                                         CEikButtonGroupContainer::EHorizontal,
       
   981                                                                         iContainer,
       
   982                                                                         R_GPS_CBABUTTON );
       
   983     CleanupStack::PushL( btgroupcontainer );
       
   984     HBufC8* buf8 = HBufC8::NewL( KHeapSize );
       
   985     CleanupStack::PushL( buf8 );
       
   986     TPtr8 ptr = buf8->Des();
       
   987     RDesWriteStream stream;
       
   988     CleanupClosePushL( stream );
       
   989     stream.Open( ptr );
       
   990     btgroupcontainer->WriteInternalStateL( stream );
       
   991     stream.CommitL();
       
   992     stream.Close();
       
   993     CleanupStack::PopAndDestroy( &stream );
       
   994     CleanupStack::PopAndDestroy( buf8 );
       
   995     CleanupStack::PopAndDestroy( btgroupcontainer );
       
   996     
       
   997     return KErrNone;
       
   998     }
       
   999 
       
  1000 // End of file
       
  1001