24
|
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: A drawer class for the capture setup list box items*
|
|
15 |
*/
|
|
16 |
|
|
17 |
|
|
18 |
#ifndef CAMCAPTURESETUPLISTITEMDRAWER_H
|
|
19 |
#define CAMCAPTURESETUPLISTITEMDRAWER_H
|
|
20 |
|
|
21 |
// INCLUDES
|
|
22 |
#include <eiklbi.h>
|
|
23 |
#include <AknUtils.h>
|
|
24 |
#include <AknLayout2ScalableDef.h>
|
|
25 |
|
|
26 |
// FORWARD DECLARATIONS
|
|
27 |
class MCamListboxModel;
|
|
28 |
class CAknIconArray;
|
|
29 |
class CAknsBasicBackgroundControlContext;
|
|
30 |
|
|
31 |
// CLASS DECLARATION
|
|
32 |
|
|
33 |
/**
|
|
34 |
* Item drawer for CCamCaptureSetupListBox
|
|
35 |
*
|
|
36 |
* @since 2.8
|
|
37 |
*/
|
|
38 |
class CCamCaptureSetupListItemDrawer : public CListItemDrawer
|
|
39 |
{
|
|
40 |
public: // Constructors and destructor
|
|
41 |
|
|
42 |
/**
|
|
43 |
* Symbian OS two-phased constructor
|
|
44 |
* @since 2.8
|
|
45 |
* @param aListBoxModel reference to a list box model used to access item data
|
|
46 |
* @return pointer to the newly created object
|
|
47 |
*/
|
|
48 |
static CCamCaptureSetupListItemDrawer* NewL( MCamListboxModel& aListBoxModel, TBool aFullySkinned = EFalse );
|
|
49 |
|
|
50 |
/**
|
|
51 |
* Destructor.
|
|
52 |
* @since 2.8
|
|
53 |
*/
|
|
54 |
virtual ~CCamCaptureSetupListItemDrawer();
|
|
55 |
|
|
56 |
public:
|
|
57 |
/**
|
|
58 |
* Sets the parent control of the listbox
|
|
59 |
* @since 2.8
|
|
60 |
* @param aControl pointer the the listbox's parent
|
|
61 |
*/
|
|
62 |
void SetParentControl( const CCoeControl* aControl );
|
|
63 |
|
|
64 |
private:
|
|
65 |
|
|
66 |
/**
|
|
67 |
* C++ default constructor.
|
|
68 |
* @since 2.8
|
|
69 |
* @param aListBoxModel reference to a list box model used to access item data
|
|
70 |
*/
|
|
71 |
CCamCaptureSetupListItemDrawer( MCamListboxModel& aListBoxModel, TBool aFullySkinned = EFalse );
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Second phase construction
|
|
75 |
*/
|
|
76 |
void ConstructL();
|
|
77 |
|
|
78 |
private: // Methods from base classes
|
|
79 |
|
|
80 |
|
|
81 |
/**
|
|
82 |
* From CListItemDrawer
|
|
83 |
* Calculates the minimum size for a cell
|
|
84 |
* @since 2.8
|
|
85 |
* @return the minimum size of a cell
|
|
86 |
*/
|
|
87 |
TSize MinimumCellSize() const;
|
|
88 |
|
|
89 |
/**
|
|
90 |
* From CListItemDrawer
|
|
91 |
* Draws an item to the screen
|
|
92 |
* @since 2.8
|
|
93 |
* @param aItemIndex the item to draw
|
|
94 |
* @param aActualItemRect the screen area occupied by the item
|
|
95 |
* @param aItemIsCurrent whether or not the item is highlighted
|
|
96 |
* @param aViewIsEmphasized unused
|
|
97 |
* @param aViewIsDimmed unused
|
|
98 |
* @param aItemIsSelected whether or not the item is selected
|
|
99 |
*/
|
|
100 |
void DrawActualItem( TInt aItemIndex,
|
|
101 |
const TRect& aActualItemRect,
|
|
102 |
TBool aItemIsCurrent,
|
|
103 |
TBool aViewIsEmphasized,
|
|
104 |
TBool aViewIsDimmed,
|
|
105 |
TBool aItemIsSelected ) const;
|
|
106 |
|
|
107 |
private: // New methods
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Draws the highlight rectangle
|
|
111 |
* @since 2.8
|
|
112 |
* @param aActualItemRect the screen area occupied by the item
|
|
113 |
*/
|
|
114 |
void DrawHighlight( const TRect& aActualItemRect ) const;
|
|
115 |
|
|
116 |
/**
|
|
117 |
* Draws the radio button according to the items current state
|
|
118 |
* @since 2.8
|
|
119 |
* @param remainingItemRect the remaining are for the item
|
|
120 |
* @param aItemIsSelected whether or not the item is selected
|
|
121 |
* @param aColor The colour to draw the radio button in
|
|
122 |
*/
|
|
123 |
void DrawRadioButton( const TRect& remainingItemRect,
|
|
124 |
TBool aItemIsSelected, const TRgb& aColor ) const;
|
|
125 |
|
|
126 |
/**
|
|
127 |
* Draws a rectangle for an item.
|
|
128 |
* @since 2.8
|
|
129 |
* @param the rectangular area to be drawn.
|
|
130 |
*/
|
|
131 |
void DrawItemRect( const TRect& aActualItemRect ) const;
|
|
132 |
|
|
133 |
/**
|
|
134 |
* Draws a rectangle for an item.
|
|
135 |
* @since 2.8
|
|
136 |
* @param the rectangular area to be drawn.
|
|
137 |
*/
|
|
138 |
void DrawTransparentItemRect( const TRect& aActualItemRect ) const;
|
|
139 |
|
|
140 |
/**
|
|
141 |
* Read list layout
|
|
142 |
*/
|
|
143 |
void ReadLayout();
|
|
144 |
|
|
145 |
void CreateIconAndAddToArrayL( CArrayPtr<CGulIcon>*& aIconArray,
|
|
146 |
const TAknsItemID& aId,
|
|
147 |
const TInt aColorIndex,
|
|
148 |
const TDesC& aBmpFile,
|
|
149 |
const TInt32 aBmp,
|
|
150 |
const TInt32 aBmpM );
|
|
151 |
|
|
152 |
private: // Data
|
|
153 |
|
|
154 |
// Array of icons for different radio button states.
|
|
155 |
CArrayPtr<CGulIcon>* iRadioButtonIconArray;
|
|
156 |
|
|
157 |
// Model class providing access to item data
|
|
158 |
MCamListboxModel& iModel;
|
|
159 |
|
|
160 |
// Item height read from resource
|
|
161 |
TInt iCaptureSetupItemHeight;
|
|
162 |
|
|
163 |
// the parent control of the listbox
|
|
164 |
const CCoeControl* iParentControl;
|
|
165 |
|
|
166 |
// Layouts
|
|
167 |
TAknTextComponentLayout iTxtLayout;
|
|
168 |
TAknWindowComponentLayout iBmpLayout;
|
|
169 |
TAknTextComponentLayout iTxtWithRbLayout;
|
|
170 |
TAknWindowComponentLayout iBmpWithRbLayout;
|
|
171 |
TAknWindowComponentLayout iHighlightLayout;
|
|
172 |
// Drawing mode
|
|
173 |
TBool iFullySkinned;
|
|
174 |
};
|
|
175 |
|
|
176 |
#endif // CAMCAPTURESETUPLISTITEMDRAWER_H
|
|
177 |
|
|
178 |
// End of File
|