|
1 /* |
|
2 * Copyright (c) 2007-2008 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: CMmListBoxContainer |
|
15 * Version : %version: MM_21.1.10 % << Don't touch! Updated by Synergy at check-out. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef C_MMLISTBOXCONTAINER_H |
|
21 #define C_MMLISTBOXCONTAINER_H |
|
22 |
|
23 #include <eiklbo.h> |
|
24 #include <AknsLayeredBackgroundControlContext.h> |
|
25 #include <AknsListBoxBackgroundControlContext.h> |
|
26 |
|
27 #include "mmwidgetcontainer.h" |
|
28 #include "mmwidgetsconstants.h" |
|
29 #include "hnglobals.h" |
|
30 |
|
31 class CMmListBox; |
|
32 class CMmMarqueeAdapter; |
|
33 class CEikColumnListBox; |
|
34 class CNaviScrollTimer; |
|
35 class CHnSuiteModel; |
|
36 class CMmTemplateLibrary; |
|
37 |
|
38 /** |
|
39 * Container for Multimedia Menu listbox widget. |
|
40 * |
|
41 * @code |
|
42 * @endcode |
|
43 * @lib mmwidgets |
|
44 * @since S60 v5.0 |
|
45 * @ingroup group_mmwidgets |
|
46 */ |
|
47 NONSHARABLE_CLASS( CMmListBoxContainer ) : public CMmWidgetContainer |
|
48 { |
|
49 public: |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 * |
|
53 * @since S60 v5.0 |
|
54 * @param aRect Rectangle of widget control. |
|
55 * @param aObjectProvider Object provider. |
|
56 * @param aTemplateLibrary Template library for drawer. |
|
57 */ |
|
58 static CMmListBoxContainer* NewL( const TRect& aRect, |
|
59 MObjectProvider* aObjectProvider, |
|
60 CMmTemplateLibrary* aTemplateLibrary ); |
|
61 |
|
62 /** |
|
63 * Two-phased constructor. |
|
64 * |
|
65 * @since S60 v5.0 |
|
66 * @param aRect Rectangle of widget control. |
|
67 * @param aObjectProvider Object provider. |
|
68 * @param aTemplateLibrary Template library for drawer. |
|
69 */ |
|
70 static CMmListBoxContainer* NewLC( const TRect& aRect, |
|
71 MObjectProvider* aObjectProvider, |
|
72 CMmTemplateLibrary* aTemplateLibrary ); |
|
73 |
|
74 /** |
|
75 * Destructor. |
|
76 * |
|
77 * @since S60 v5.0 |
|
78 */ |
|
79 virtual ~CMmListBoxContainer(); |
|
80 |
|
81 public: // from base class CMmWidgetContainer |
|
82 |
|
83 /** |
|
84 * Handle item addition. |
|
85 * |
|
86 * @since S60 v3.0 |
|
87 */ |
|
88 void HandleItemAdditionL(); |
|
89 |
|
90 /** |
|
91 * Handle item removal. |
|
92 * |
|
93 * @since S60 v3.0 |
|
94 */ |
|
95 void HandleItemRemovalL(); |
|
96 |
|
97 /** |
|
98 * Set the default highlight in listbox. |
|
99 * |
|
100 * @since S60 v5.0 |
|
101 * @param aRedraw Is highlight to redraw. |
|
102 */ |
|
103 IMPORT_C void SetDefaultHighlightL( TBool aRedraw = ETrue ); |
|
104 |
|
105 /** |
|
106 * Called to set widget in edit mode state. |
|
107 * |
|
108 * @since S60 v5.0 |
|
109 * @param aIsEditMode Is edit mode to be set. |
|
110 */ |
|
111 void SetEditModeL( TBool aIsEditMode ); |
|
112 |
|
113 /** |
|
114 * Gets the listbox model. |
|
115 * |
|
116 * @since S60 v5.0 |
|
117 * @return listbox model |
|
118 */ |
|
119 CMmListBoxModel* GetMmModel(); |
|
120 |
|
121 /** |
|
122 * Sets the empty text for empty list. |
|
123 * |
|
124 * @since S60 v5.0 |
|
125 * @param aText Text to be set when list is empty. |
|
126 */ |
|
127 IMPORT_C void SetEmptyTextL(const TDesC& aText); |
|
128 |
|
129 /** |
|
130 * Set background context for item drawer and view. |
|
131 * |
|
132 * @since S60 v5.0 |
|
133 * @param aBgContext Background context. |
|
134 */ |
|
135 void SetItemDrawerAndViewBgContext( |
|
136 CAknsBasicBackgroundControlContext * aBgContext ); |
|
137 |
|
138 /** |
|
139 * Sets up the layout for the widget. |
|
140 * |
|
141 * @since S60 v5.0 |
|
142 */ |
|
143 void SetupWidgetLayoutL(); |
|
144 |
|
145 /** |
|
146 * Sets suite model. |
|
147 * |
|
148 * @since S60 v5.0 |
|
149 * @param aModel Suite model. |
|
150 */ |
|
151 void SetSuiteModelL( CHnSuiteModel* aModel ); |
|
152 |
|
153 /** |
|
154 * Set highlight visibility. |
|
155 * |
|
156 * @since S60 v5.0 |
|
157 * @param aVisible Visibility status. |
|
158 */ |
|
159 void SetHighlightVisibilityL( TBool aVisible ); |
|
160 |
|
161 /** |
|
162 * Gets widget type. |
|
163 * |
|
164 * @since S60 v5.0 |
|
165 * @return Widget type. |
|
166 */ |
|
167 THnSuiteWidgetType WidgetType(); |
|
168 |
|
169 public: |
|
170 /** |
|
171 * Draws the widget view. |
|
172 * |
|
173 * @since S60 v5.0 |
|
174 */ |
|
175 virtual void DrawView(); |
|
176 |
|
177 /** |
|
178 * Set the vertical item offset; |
|
179 * @param aOffset The offset to set to the widget. |
|
180 * |
|
181 * @since S60 v5.0 |
|
182 */ |
|
183 virtual void SetVerticalItemOffset( TInt aOffset ); |
|
184 |
|
185 /** |
|
186 * Gets the current widget vertical item offset. |
|
187 * |
|
188 * @since S60 v5.0 |
|
189 * @return The current widget vertical item offset. |
|
190 */ |
|
191 virtual TInt VerticalItemOffset() const; |
|
192 |
|
193 protected: // from CMmWidgetContainer |
|
194 |
|
195 /** |
|
196 * Checks whether given point collides with specific item's re-order area. |
|
197 * |
|
198 * Please see @c CMmWidgetContainer::PointInItemReorderAreaL documentation |
|
199 * for details. |
|
200 * |
|
201 * @since S60 v5.0 |
|
202 */ |
|
203 TBool PointInItemReorderAreaL( TInt aItemIndex, TPoint aPoint ); |
|
204 |
|
205 private: |
|
206 /** |
|
207 * Default constructor. |
|
208 * |
|
209 * @since S60 v5.0 |
|
210 */ |
|
211 CMmListBoxContainer(); |
|
212 |
|
213 /** |
|
214 * 2nd phase constructor. |
|
215 * |
|
216 * @since S60 v5.0 |
|
217 * @param aRect Rectangle of widget control. |
|
218 * @param aObjectProvider Object provider. |
|
219 * @param aTemplateLibrary Template library for drawer. |
|
220 */ |
|
221 void ConstructL( const TRect& aRect, MObjectProvider* aObjectProvider, |
|
222 CMmTemplateLibrary* aTemplateLibrary ); |
|
223 |
|
224 /** |
|
225 * Constructs listbox from resource, creates scrollbar |
|
226 * and sets empty list background text. |
|
227 * |
|
228 * @since S60 v5.0 |
|
229 * @param aTemplateLibrary Template library for drawer. |
|
230 * @return List box widget. |
|
231 */ |
|
232 CMmListBox* CreateListboxL( CMmTemplateLibrary* aTemplateLibrary ); |
|
233 |
|
234 /** |
|
235 * Gets column count in current view. |
|
236 * @returns Column count in current view. |
|
237 */ |
|
238 TInt ColumnsInCurrentView(); |
|
239 |
|
240 /** |
|
241 * Gets row count in current view. |
|
242 * @returns Row count in current view. |
|
243 */ |
|
244 TInt RowsInCurrentView(); |
|
245 |
|
246 /** |
|
247 * Updates current view's scrollbar thumbs. |
|
248 */ |
|
249 void UpdateViewScrollBarThumbs(); |
|
250 |
|
251 private: // members |
|
252 /** |
|
253 * Pointer to listbox widget. |
|
254 * Owned. |
|
255 */ |
|
256 CMmListBox* iListBox; |
|
257 |
|
258 }; |
|
259 |
|
260 #endif //__MMLISTBOXCONTAINER_H__ |