camerauis/cameraapp/generic/src/CamSceneListBox.cpp
changeset 0 1ddebce53859
child 10 8c55c525d5d7
equal deleted inserted replaced
-1:000000000000 0:1ddebce53859
       
     1 /*
       
     2 * Copyright (c) 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:  Camera scenes list-box*
       
    15 */
       
    16 
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "CamSceneListBox.h"
       
    21 #include "CamSceneListBoxModel.h"
       
    22 
       
    23 #include "CamCaptureSetupListItemDrawer.h"
       
    24 #include "CamCaptureSetupControlHandler.h"
       
    25 
       
    26 #include "CamUtility.h"
       
    27 
       
    28 // ============================ MEMBER FUNCTIONS ===============================
       
    29 
       
    30 CCamSceneListBox::~CCamSceneListBox()
       
    31   {
       
    32   
       
    33   }
       
    34         
       
    35 /**
       
    36 * C++ default constructor.
       
    37 */
       
    38 CCamSceneListBox::CCamSceneListBox( TCamCameraMode            aMode,
       
    39                                     MCamSettingValueObserver* aObserver,
       
    40                                     CCamAppController&        aController )
       
    41   : CCamCaptureSetupListBox( aObserver, aController ), 
       
    42     iMode( aMode )
       
    43   {
       
    44   }
       
    45 
       
    46 /**
       
    47 * By default Symbian 2nd phase constructor is private.
       
    48 */
       
    49 void CCamSceneListBox::ConstructL( 
       
    50         CCamAppController& aController,
       
    51         const CCoeControl* aParent,
       
    52         RPointerArray<HBufC>& aSummaryTitleTextArray,
       
    53         RPointerArray<HBufC>& aSummaryDescriptionTextArray,
       
    54         TBool aUserBaseScenes )
       
    55   {
       
    56   iBorder = TGulBorder::ENone;
       
    57 
       
    58   //Constructing model
       
    59   CCamSceneListBoxModel* model =
       
    60       CCamSceneListBoxModel::NewLC( aController, 
       
    61                                     iMode, 
       
    62                                     aSummaryTitleTextArray, 
       
    63                                     aSummaryDescriptionTextArray, 
       
    64                                     aUserBaseScenes,
       
    65                                     Rect() );
       
    66 
       
    67   CCamCaptureSetupListItemDrawer* itemDrawer = 
       
    68       CCamCaptureSetupListItemDrawer::NewL( *model );
       
    69 
       
    70 
       
    71   itemDrawer->SetParentControl( aParent );
       
    72     
       
    73   // CEikListBox takes ownership before anything can leave.
       
    74   // Do not need the model or drawer on the stack when call ConstructL,
       
    75   // because CEikListBox assigns objects as member variables before
       
    76   // ConstructL calls any leaving functions.
       
    77   CleanupStack::Pop( model ); 
       
    78   CEikListBox::ConstructL( model, itemDrawer, aParent, 0/*aFlags*/ );
       
    79   // The number of items is fixed after the list box has been constructed
       
    80   const TInt KMaxListItems = 5; // This value should come from the LAF
       
    81   // Find the number of items to be displayed in the list box
       
    82   iRequiredHeightInNumOfItems = Min( Model()->NumberOfItems(), KMaxListItems );
       
    83   SetItemHeightL( iItemDrawer->MinimumCellSize().iHeight );
       
    84   }
       
    85 
       
    86 
       
    87 
       
    88 //  End of File