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: Draws individual list items.* |
|
15 */ |
|
16 |
|
17 |
|
18 #ifndef CAMCAPTURESETUPMENULISTITEMDRAWER_H |
|
19 #define CAMCAPTURESETUPMENULISTITEMDRAWER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <eiklbi.h> |
|
23 #include <AknUtils.h> |
|
24 |
|
25 // STRUCTS |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CCamCaptureSetupMenuListBoxModel; |
|
29 class TResourceReader; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Draws individual list items. |
|
35 */ |
|
36 class CCamCaptureSetupMenuListItemDrawer : public CListItemDrawer |
|
37 { |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 * @since 2.8 |
|
43 * @param aListBoxModel Model that is used to get content information |
|
44 * about list item being drawn. |
|
45 * @param aReader Used to populate drawer with layout information for |
|
46 * list box elements it draws. |
|
47 * @return pointer to the created list item drawer. |
|
48 */ |
|
49 static CCamCaptureSetupMenuListItemDrawer* NewL( |
|
50 CCamCaptureSetupMenuListBoxModel* aListBoxModel, |
|
51 TResourceReader& aReader ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 ~CCamCaptureSetupMenuListItemDrawer(); |
|
57 |
|
58 public: // New functions |
|
59 /** |
|
60 * Sets the parent control of the listbox |
|
61 * @since 2.8 |
|
62 * @param aControl pointer the the listbox's parent |
|
63 */ |
|
64 void SetParentControl( const CCoeControl* aControl ); |
|
65 |
|
66 public: // Functions from base class CListItemDrawer |
|
67 |
|
68 /** |
|
69 * Draws currentitem and highlights if needed |
|
70 * @since 2.8 |
|
71 * @param aItemIndex An index of item |
|
72 * @param aActualItemRect Rect of item |
|
73 * @param aItemIsCurrent ETrue if current item |
|
74 * @param aViewIsEmphasized ETrue if emphasized |
|
75 * @param aViewIsDimmed ETrue if dimmed |
|
76 * @param aItemIsSelected ETrue if selected |
|
77 */ |
|
78 virtual void DrawActualItem( TInt aItemIndex, const |
|
79 TRect& aActualItemRect, TBool aItemIsCurrent, |
|
80 TBool aViewIsEmphasized, TBool aViewIsDimmed, |
|
81 TBool aItemIsSelected )const; |
|
82 |
|
83 |
|
84 |
|
85 private: // Constructors |
|
86 /** |
|
87 * C++ default constructor. |
|
88 * @since 2.8 |
|
89 * @param aListBoxModel Handle to ListBoxModel |
|
90 */ |
|
91 CCamCaptureSetupMenuListItemDrawer( CCamCaptureSetupMenuListBoxModel* aListBoxModel ); |
|
92 |
|
93 /** |
|
94 * 2nd phase constructor. |
|
95 * @since 2.8 |
|
96 * @param aReader Used to populate drawer with layout information for |
|
97 * list box elements it draws. |
|
98 */ |
|
99 void ConstructFromResourceL( TResourceReader& aReader ); |
|
100 |
|
101 private: // New functions |
|
102 |
|
103 /** |
|
104 * Draws a highlighted rectangle for an item. |
|
105 * @since 2.8 |
|
106 * @param aActualItemRect the rectangular area to be highlighted. |
|
107 */ |
|
108 void DrawHighlightedItemRect( const TRect& aActualItemRect ) const; |
|
109 |
|
110 /** |
|
111 * Draws a rectangle for an item. |
|
112 * @since 2.8 |
|
113 * @param aActualItemRect the rectangular area to be drawn. |
|
114 */ |
|
115 void DrawItemRect( const TRect& aActualItemRect ) const; |
|
116 |
|
117 |
|
118 |
|
119 private: // Data |
|
120 // Used to get the current value of a list item. |
|
121 CCamCaptureSetupMenuListBoxModel* iModel; |
|
122 |
|
123 // Specifies the layout for drawing a list item's text. |
|
124 AknLayoutUtils::SAknLayoutText iLayoutDataForText; |
|
125 |
|
126 // Specifies the layout for drawing a list item's icon text (if defined). |
|
127 AknLayoutUtils::SAknLayoutText iLayoutDataForIconText; |
|
128 |
|
129 // Specifies the layout for drawing a list item's bitmap. |
|
130 AknLayoutUtils::SAknLayoutRect iLayoutDataForBitmap; |
|
131 |
|
132 // Highlight offset loaded from resource |
|
133 TInt iHighlightOffset; |
|
134 |
|
135 // The parent control of the list box |
|
136 const CCoeControl* iParentControl; |
|
137 }; |
|
138 |
|
139 #endif // CAMCAPTURESETUPMENULISTITEMDRAWER_H |
|
140 |
|
141 // End of File |
|