camerauis/cameraapp/generic/src/CamSceneListBox.cpp
changeset 19 d9aefe59d544
parent 3 8b2d6d0384b0
child 21 fa6d9f75d6a6
child 28 3075d9b614e6
equal deleted inserted replaced
3:8b2d6d0384b0 19:d9aefe59d544
     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