camerauis/cameraapp/generic/src/CamUserSceneSetupContainer.cpp
changeset 2 e8773a61782d
parent 0 1ddebce53859
child 12 8c55c525d5d7
equal deleted inserted replaced
1:f5ec9446e5bf 2:e8773a61782d
     1 /*
     1 /*
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
   122 // settings model value.
   122 // settings model value.
   123 // ---------------------------------------------------------
   123 // ---------------------------------------------------------
   124 //
   124 //
   125 void CCamUserSceneSetupContainer::UpdateCurrentListItem()
   125 void CCamUserSceneSetupContainer::UpdateCurrentListItem()
   126     {
   126     {
       
   127     CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();   
       
   128     if ( cba )
       
   129         {
       
   130         CEikCba* eikCba = static_cast<CEikCba*>( cba->ButtonGroup() );
       
   131         if( eikCba )
       
   132             {
       
   133             // Hide LSK for single clickable settings
       
   134             eikCba->EnableItemSpecificSoftkey( ETrue );
       
   135             }
       
   136         }  
   127     TInt selectedItemIndex = iUserSceneSetupList->CurrentItemIndex();
   137     TInt selectedItemIndex = iUserSceneSetupList->CurrentItemIndex();
   128     UpdateListItem( selectedItemIndex );
   138     UpdateListItem( selectedItemIndex );
   129     }
   139     }
   130     
   140     
   131 // ---------------------------------------------------------
   141 // ---------------------------------------------------------
   157 // ---------------------------------------------------------
   167 // ---------------------------------------------------------
   158 //
   168 //
   159 void CCamUserSceneSetupContainer::HandleSelectionL( void )
   169 void CCamUserSceneSetupContainer::HandleSelectionL( void )
   160     {
   170     {
   161     TInt CommandId = CommandIdForActivatingCurrentItemControl();
   171     TInt CommandId = CommandIdForActivatingCurrentItemControl();
       
   172     CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
       
   173     if ( cba && CommandId != ECamCmdCaptureSetupFlashUser )
       
   174         {
       
   175         CEikCba* eikCba = static_cast<CEikCba*>( cba->ButtonGroup() );
       
   176         if( eikCba )
       
   177             {
       
   178             // Make LSK visible for the sliders.
       
   179             // Sliders, like exposure compensation, are not listboxes, 
       
   180             // thus single click cannot be disabled for those.
       
   181             // All setting items, except flash, are double clickable and
       
   182             // they have a visible LSK
       
   183             eikCba->EnableItemSpecificSoftkey( EFalse );
       
   184             }    
       
   185         }
   162     iView.HandleCommandL( CommandId );
   186     iView.HandleCommandL( CommandId );
   163     }
   187     }
   164     
   188     
   165 
   189 
   166 
   190 
   187     {
   211     {
   188     const TInt KSettingItemArrayGranularity = 5;
   212     const TInt KSettingItemArrayGranularity = 5;
   189 
   213 
   190     CreateWindowL();
   214     CreateWindowL();
   191 
   215 
   192 	// Create the listbox in the right style
   216     // Create the listbox in the right style
   193     iUserSceneSetupList = new ( ELeave ) CAknSettingStyleListBox;
   217     iUserSceneSetupList = new ( ELeave ) CAknSettingStyleListBox;
   194    	iUserSceneSetupList->ConstructL( this, CEikListBox::ELeftDownInViewRect );
   218     iUserSceneSetupList->ConstructL( this, CEikListBox::ELeftDownInViewRect );
   195     iUserSceneSetupList->DisableSingleClick( ETrue );
   219 
   196 
   220     TPoint pos = iEikonEnv->EikAppUi()->ClientRect().iTl;
   197 	TPoint pos = iEikonEnv->EikAppUi()->ClientRect().iTl;
   221     TSize size = iUserSceneSetupList->MinimumSize();
   198 	TSize size = iUserSceneSetupList->MinimumSize();
   222     SetExtent( pos, size ); 
   199 	SetExtent( pos, size ); 
   223 
   200 
   224 
   201 
   225     // Setup the scroll bar
   202 	// Setup the scroll bar
   226     iUserSceneSetupList->CreateScrollBarFrameL( ETrue );
   203 	iUserSceneSetupList->CreateScrollBarFrameL( ETrue );
   227     iUserSceneSetupList->ScrollBarFrame()->
   204 	iUserSceneSetupList->ScrollBarFrame()->
   228     SetScrollBarVisibilityL( CEikScrollBarFrame::EOn, 
   205         SetScrollBarVisibilityL( CEikScrollBarFrame::EOn, 
       
   206             CEikScrollBarFrame::EAuto );
   229             CEikScrollBarFrame::EAuto );
   207             
   230             
   208     iTitleResourceId = aResourceId;
   231     iTitleResourceId = aResourceId;
   209 
   232 
   210             
   233