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