54
|
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 |
TBool aFullySkinned )
|
|
42 |
: CCamCaptureSetupListBox( aObserver, aController, aFullySkinned ),
|
|
43 |
iMode( aMode )
|
|
44 |
{
|
|
45 |
}
|
|
46 |
|
|
47 |
/**
|
|
48 |
* By default Symbian 2nd phase constructor is private.
|
|
49 |
*/
|
|
50 |
void CCamSceneListBox::ConstructL(
|
|
51 |
CCamAppController& aController,
|
|
52 |
const CCoeControl* aParent,
|
|
53 |
RPointerArray<HBufC>& aSummaryTitleTextArray,
|
|
54 |
RPointerArray<HBufC>& aSummaryDescriptionTextArray,
|
|
55 |
TBool aUserBaseScenes )
|
|
56 |
{
|
|
57 |
iBorder = TGulBorder::ENone;
|
|
58 |
|
|
59 |
//Constructing model
|
|
60 |
CCamSceneListBoxModel* model =
|
|
61 |
CCamSceneListBoxModel::NewLC( aController,
|
|
62 |
iMode,
|
|
63 |
aSummaryTitleTextArray,
|
|
64 |
aSummaryDescriptionTextArray,
|
|
65 |
aUserBaseScenes,
|
|
66 |
Rect() );
|
|
67 |
|
|
68 |
CCamCaptureSetupListItemDrawer* itemDrawer =
|
|
69 |
CCamCaptureSetupListItemDrawer::NewL( *model, iSkinnedBackGround );
|
|
70 |
|
|
71 |
|
|
72 |
itemDrawer->SetParentControl( aParent );
|
|
73 |
|
|
74 |
// CEikListBox takes ownership before anything can leave.
|
|
75 |
// Do not need the model or drawer on the stack when call ConstructL,
|
|
76 |
// because CEikListBox assigns objects as member variables before
|
|
77 |
// ConstructL calls any leaving functions.
|
|
78 |
CleanupStack::Pop( model );
|
|
79 |
CEikListBox::ConstructL( model, itemDrawer, aParent, 0/*aFlags*/ );
|
|
80 |
// The number of items is fixed after the list box has been constructed
|
|
81 |
const TInt KMaxListItems = 5; // This value should come from the LAF
|
|
82 |
// Find the number of items to be displayed in the list box
|
|
83 |
iRequiredHeightInNumOfItems = Min( Model()->NumberOfItems(), KMaxListItems );
|
|
84 |
SetItemHeightL( iItemDrawer->MinimumCellSize().iHeight );
|
|
85 |
}
|
|
86 |
|
|
87 |
|
|
88 |
|
|
89 |
// End of File
|