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 TBool aSkinnedBackGround ) |
|
54 { |
|
55 iBorder = TGulBorder::ENone; |
|
56 |
|
57 //Constructing model |
|
58 CCamInfoListBoxModel* model = |
|
59 CCamInfoListBoxModel::NewLC( aController, aSummaryTitleTextArray, |
|
60 aSummaryDescriptionTextArray, aResourceId, Rect() ); |
|
61 |
|
62 CCamCaptureSetupListItemDrawer* itemDrawer = |
|
63 CCamCaptureSetupListItemDrawer::NewL( *model, aSkinnedBackGround ); |
|
64 |
|
65 |
|
66 itemDrawer->SetParentControl( aParent ); |
|
67 |
|
68 // CEikListBox takes ownership before anything can leave. |
|
69 // Do not need the model or drawer on the stack when call ConstructL, |
|
70 // because CEikListBox assigns objects as member variables before |
|
71 // ConstructL calls any leaving functions. |
|
72 CleanupStack::Pop( model ); |
|
73 CEikListBox::ConstructL( model, itemDrawer, aParent, 0/*aFlags*/ ); |
|
74 // The number of items is fixed after the list box has been constructed |
|
75 const TInt KMaxListItems = 5; // This value should come from the LAF |
|
76 // Find the number of items to be displayed in the list box |
|
77 iRequiredHeightInNumOfItems = Min( Model()->NumberOfItems(), KMaxListItems ); |
|
78 SetItemHeightL( iItemDrawer->MinimumCellSize().iHeight ); |
|
79 } |
|
80 |
|
81 // End of File |
|