williamr@4
|
1 |
/*
|
williamr@4
|
2 |
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@4
|
3 |
* All rights reserved.
|
williamr@4
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@4
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@4
|
8 |
*
|
williamr@4
|
9 |
* Initial Contributors:
|
williamr@4
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@4
|
11 |
*
|
williamr@4
|
12 |
* Contributors:
|
williamr@4
|
13 |
*
|
williamr@4
|
14 |
* Description:
|
williamr@4
|
15 |
*
|
williamr@4
|
16 |
*/
|
williamr@4
|
17 |
|
williamr@4
|
18 |
// EIKFRLB.H
|
williamr@4
|
19 |
//
|
williamr@4
|
20 |
// Copyright (c) 1997-2001 Symbian Ltd. All rights reserved.
|
williamr@4
|
21 |
//
|
williamr@4
|
22 |
#if !defined(__EIKFRLB_H__)
|
williamr@4
|
23 |
#define __EIKFRLB_H__
|
williamr@4
|
24 |
|
williamr@4
|
25 |
#include <eiklbi.h>
|
williamr@4
|
26 |
#include <eiklbv.h>
|
williamr@4
|
27 |
#include <eiktxlbm.h>
|
williamr@4
|
28 |
#include <eiktxlbx.h>
|
williamr@4
|
29 |
|
williamr@4
|
30 |
class CFormattedCellListBoxData;
|
williamr@4
|
31 |
|
williamr@4
|
32 |
/**
|
williamr@4
|
33 |
* @c CFormattedCellListBoxItemDrawer draws a single list item and manages
|
williamr@4
|
34 |
* list item properties.
|
williamr@4
|
35 |
*
|
williamr@4
|
36 |
* @lib avkon
|
williamr@4
|
37 |
*/
|
williamr@4
|
38 |
class CFormattedCellListBoxItemDrawer : public CTextListItemDrawer
|
williamr@4
|
39 |
{
|
williamr@4
|
40 |
public:
|
williamr@4
|
41 |
|
williamr@4
|
42 |
/**
|
williamr@4
|
43 |
* C++ default constructor.
|
williamr@4
|
44 |
*
|
williamr@4
|
45 |
* @param aTextListBoxModel The list box model class.
|
williamr@4
|
46 |
* @param aFont Font to be used in listbox.
|
williamr@4
|
47 |
* @param aFormattedCellData Pointer to the list layout drawer class.
|
williamr@4
|
48 |
*/
|
williamr@4
|
49 |
IMPORT_C CFormattedCellListBoxItemDrawer(
|
williamr@4
|
50 |
MTextListBoxModel* aTextListBoxModel,
|
williamr@4
|
51 |
const CFont* aFont,
|
williamr@4
|
52 |
CFormattedCellListBoxData* aFormattedCellData);
|
williamr@4
|
53 |
|
williamr@4
|
54 |
/**
|
williamr@4
|
55 |
* Destructor.
|
williamr@4
|
56 |
*/
|
williamr@4
|
57 |
IMPORT_C ~CFormattedCellListBoxItemDrawer();
|
williamr@4
|
58 |
|
williamr@4
|
59 |
/**
|
williamr@4
|
60 |
* Gets the list layout drawer.
|
williamr@4
|
61 |
*
|
williamr@4
|
62 |
* @return Pointer to the list layout drawer object.
|
williamr@4
|
63 |
*/
|
williamr@4
|
64 |
IMPORT_C CFormattedCellListBoxData* FormattedCellData() const;
|
williamr@4
|
65 |
|
williamr@4
|
66 |
/**
|
williamr@4
|
67 |
* Gets the list layout drawer.
|
williamr@4
|
68 |
*
|
williamr@4
|
69 |
* @return Pointer to the list layout drawer object.
|
williamr@4
|
70 |
*/
|
williamr@4
|
71 |
IMPORT_C CFormattedCellListBoxData* ColumnData() const;
|
williamr@4
|
72 |
// for compability with columnlistbox itemdrawer
|
williamr@4
|
73 |
|
williamr@4
|
74 |
/**
|
williamr@4
|
75 |
* Draws an empty item to the list box.
|
williamr@4
|
76 |
*
|
williamr@4
|
77 |
* @param aItemIndex Not used.
|
williamr@4
|
78 |
* @param aItemRectPos Position for the list box item rectangle.
|
williamr@4
|
79 |
* @param aViewIsDimmed Not used.
|
williamr@4
|
80 |
*/
|
williamr@4
|
81 |
IMPORT_C virtual void DrawEmptyItem(TInt aItemIndex, TPoint aItemRectPos,
|
williamr@4
|
82 |
TBool aViewIsDimmed) const;
|
williamr@4
|
83 |
|
williamr@4
|
84 |
/**
|
williamr@4
|
85 |
* This function sets top item index.
|
williamr@4
|
86 |
*
|
williamr@4
|
87 |
* @param aTop Item index value.
|
williamr@4
|
88 |
*/
|
williamr@4
|
89 |
IMPORT_C void SetTopItemIndex(TInt aTop);
|
williamr@4
|
90 |
|
williamr@4
|
91 |
/**
|
williamr@4
|
92 |
* List item index and color and style properties.
|
williamr@4
|
93 |
*/
|
williamr@4
|
94 |
struct SListProperties
|
williamr@4
|
95 |
{
|
williamr@4
|
96 |
/** List box item index. */
|
williamr@4
|
97 |
TInt iItem; // must be first
|
williamr@4
|
98 |
|
williamr@4
|
99 |
/** Colour and style properties for the list item. */
|
williamr@4
|
100 |
TListItemProperties iProperties;
|
williamr@4
|
101 |
};
|
williamr@4
|
102 |
|
williamr@4
|
103 |
/**
|
williamr@4
|
104 |
* Clears all properties.
|
williamr@4
|
105 |
*/
|
williamr@4
|
106 |
IMPORT_C void ClearAllPropertiesL();
|
williamr@4
|
107 |
|
williamr@4
|
108 |
/**
|
williamr@4
|
109 |
* The SetProperties is convenience method for normal cases.
|
williamr@4
|
110 |
* NOTE that it does NOT work correctly if you can insert/delete
|
williamr@4
|
111 |
* items from the list -- You need to update all properties if
|
williamr@4
|
112 |
* any changes to the item text array happen! Often it is convenient
|
williamr@4
|
113 |
* to override the @c Properties() method. Further, use this only
|
williamr@4
|
114 |
* for small lists.
|
williamr@4
|
115 |
*
|
williamr@4
|
116 |
* It has been implemented as sorted list of (index,Property) pairs.
|
williamr@4
|
117 |
*
|
williamr@4
|
118 |
* If you're using find, aItemIndex for this method is the same as you give
|
williamr@4
|
119 |
* in @c MdcaPoint() points the default @c Properties() does conversion
|
williamr@4
|
120 |
* between indexes.
|
williamr@4
|
121 |
*
|
williamr@4
|
122 |
* @param aItemIndex List box item index.
|
williamr@4
|
123 |
* @param properties Colour and style properties for the list box item.
|
williamr@4
|
124 |
*/
|
williamr@4
|
125 |
IMPORT_C void SetPropertiesL(TInt aItemIndex, TListItemProperties properties);
|
williamr@4
|
126 |
|
williamr@4
|
127 |
/**
|
williamr@4
|
128 |
* Function for getting properties of a certain list box item.
|
williamr@4
|
129 |
*
|
williamr@4
|
130 |
* @param aItemIndex The listbox item index.
|
williamr@4
|
131 |
* @return Colour and style properties of wanted
|
williamr@4
|
132 |
* list box item.
|
williamr@4
|
133 |
*/
|
williamr@4
|
134 |
IMPORT_C virtual TListItemProperties Properties(TInt aItemIndex) const;
|
williamr@4
|
135 |
|
williamr@4
|
136 |
/**
|
williamr@4
|
137 |
* Gets list box item cell size.
|
williamr@4
|
138 |
*
|
williamr@4
|
139 |
* @return The list box item cell size.
|
williamr@4
|
140 |
*/
|
williamr@4
|
141 |
TSize LafItemSize() { return iItemCellSize; }
|
williamr@4
|
142 |
|
williamr@4
|
143 |
public: // from CTextListItemDrawer
|
williamr@4
|
144 |
|
williamr@4
|
145 |
/**
|
williamr@4
|
146 |
* From @c CTextListItemDrawer.
|
williamr@4
|
147 |
*
|
williamr@4
|
148 |
* Draw an item in a list box.
|
williamr@4
|
149 |
*
|
williamr@4
|
150 |
* @param aItemIndex The index into the model's item array of the item
|
williamr@4
|
151 |
* to draw.
|
williamr@4
|
152 |
* @param aItemTextRect The item’s text rectangle.
|
williamr@4
|
153 |
* @param aItemIsCurrent @c ETrue if the item is current. @c EFalse
|
williamr@4
|
154 |
* otherwise.
|
williamr@4
|
155 |
* @param aViewIsEmphasized @c ETrue if the view is emphasized. @c EFalse
|
williamr@4
|
156 |
* otherwise.
|
williamr@4
|
157 |
* @param aItemIsSelected @c ETrue if the item is selected. @c EFalse
|
williamr@4
|
158 |
* otherwise.
|
williamr@4
|
159 |
*/
|
williamr@4
|
160 |
IMPORT_C void DrawItemText(TInt aItemIndex,const TRect& aItemTextRect,
|
williamr@4
|
161 |
TBool aItemIsCurrent, TBool aViewIsEmphasized,
|
williamr@4
|
162 |
TBool aItemIsSelected) const;
|
williamr@4
|
163 |
|
williamr@4
|
164 |
/**
|
williamr@4
|
165 |
* From @c CTextListItemDrawer.
|
williamr@4
|
166 |
*
|
williamr@4
|
167 |
* Draws an item tick mark.
|
williamr@4
|
168 |
*
|
williamr@4
|
169 |
* A tick mark is used in multiple selection lists to indicate the item is
|
williamr@4
|
170 |
* selected.
|
williamr@4
|
171 |
*
|
williamr@4
|
172 |
* This function is invoked by the framework to draw an item mark if
|
williamr@4
|
173 |
* @c iDrawMark is set. The mark should be drawn into this list item
|
williamr@4
|
174 |
* drawer's graphics context; by default, @c DrawItemMark() draws a tick
|
williamr@4
|
175 |
* using the standard symbol font.
|
williamr@4
|
176 |
*
|
williamr@4
|
177 |
* This function does not need to be re-implemented for derived classes
|
williamr@4
|
178 |
* which do not draw item marks.
|
williamr@4
|
179 |
*
|
williamr@4
|
180 |
* @param aItemIsSelected Whether the item to draw for is selected.
|
williamr@4
|
181 |
* @param aViewIsDimmed Whether the item is dimmed.
|
williamr@4
|
182 |
* @param aMarkPos Position of the mark.
|
williamr@4
|
183 |
*/
|
williamr@4
|
184 |
IMPORT_C void DrawItemMark(TBool aItemIsSelected, TBool aViewIsDimmed,
|
williamr@4
|
185 |
const TPoint& aMarkPos) const;
|
williamr@4
|
186 |
|
williamr@4
|
187 |
public: // from CListItemDrawer
|
williamr@4
|
188 |
|
williamr@4
|
189 |
/**
|
williamr@4
|
190 |
* From @c CListItemDrawer.
|
williamr@4
|
191 |
*
|
williamr@4
|
192 |
* Gets the minimum size of a cell based on the font and the number of
|
williamr@4
|
193 |
* characters in the cell.
|
williamr@4
|
194 |
*
|
williamr@4
|
195 |
* @return The minimum size for a cell in pixels.
|
williamr@4
|
196 |
*/
|
williamr@4
|
197 |
IMPORT_C TSize MinimumCellSize() const;
|
williamr@4
|
198 |
|
williamr@4
|
199 |
/**
|
williamr@4
|
200 |
* From @c CListItemDrawer.
|
williamr@4
|
201 |
*
|
williamr@4
|
202 |
* Gets the width in pixels of the specified item.
|
williamr@4
|
203 |
*
|
williamr@4
|
204 |
* @param aItemIndex The index of the item for which the width is obtained.
|
williamr@4
|
205 |
* @return The specified item's width in pixels.
|
williamr@4
|
206 |
*/
|
williamr@4
|
207 |
IMPORT_C TInt ItemWidthInPixels(TInt aItemIndex) const;
|
williamr@4
|
208 |
|
williamr@4
|
209 |
/**
|
williamr@4
|
210 |
* From @c CListItemDrawer.
|
williamr@4
|
211 |
*
|
williamr@4
|
212 |
* Sets the item cell size.
|
williamr@4
|
213 |
*
|
williamr@4
|
214 |
* The cell size is the on-screen size of the entire item, including its
|
williamr@4
|
215 |
* text and its item mark.
|
williamr@4
|
216 |
*
|
williamr@4
|
217 |
* @param aSizeInPixels New size for the item cell.
|
williamr@4
|
218 |
*/
|
williamr@4
|
219 |
IMPORT_C void SetItemCellSize(const TSize& aSizeInPixels);
|
williamr@4
|
220 |
|
williamr@4
|
221 |
protected:
|
williamr@4
|
222 |
|
williamr@4
|
223 |
/**
|
williamr@4
|
224 |
* Draws current item rectangle.
|
williamr@4
|
225 |
*
|
williamr@4
|
226 |
* @param aRect Current item rectangle.
|
williamr@4
|
227 |
*/
|
williamr@4
|
228 |
void DrawCurrentItemRect(const TRect& aRect) const;
|
williamr@4
|
229 |
|
williamr@4
|
230 |
/**
|
williamr@4
|
231 |
* @c WordWrapListItem is used with @c CAknDouble* style listboxes.
|
williamr@4
|
232 |
* If listbox does not have 2nd line defined, @c WordWrapListItem
|
williamr@4
|
233 |
* wraps 1st line to 2nd line, if text does not fit to 1st line.
|
williamr@4
|
234 |
* If listbox does have 2nd line defined, this method truncates
|
williamr@4
|
235 |
* both lines.
|
williamr@4
|
236 |
*
|
williamr@4
|
237 |
* @internal
|
williamr@4
|
238 |
* @param aTarget Where to place wrapped item string
|
williamr@4
|
239 |
* @param aItemString Text to be wrapped
|
williamr@4
|
240 |
* @param aFirstIndex index of 1st subcell to wrap
|
williamr@4
|
241 |
* @param aSecondIndex index of 2nd subcell
|
williamr@4
|
242 |
*/
|
williamr@4
|
243 |
void WordWrapListItem( TPtr& aTarget,
|
williamr@4
|
244 |
const TDesC &aItemString,
|
williamr@4
|
245 |
TInt aFirstIndex,
|
williamr@4
|
246 |
TInt aSecondIndex,
|
williamr@4
|
247 |
TInt aItemIndex ) const;
|
williamr@4
|
248 |
/**
|
williamr@4
|
249 |
* @internal
|
williamr@4
|
250 |
*/
|
williamr@4
|
251 |
void DrawBackgroundAndSeparatorLines( const TRect& aItemTextRect,
|
williamr@4
|
252 |
TBool aDrawSeparator ) const;
|
williamr@4
|
253 |
|
williamr@4
|
254 |
|
williamr@4
|
255 |
private:
|
williamr@4
|
256 |
|
williamr@4
|
257 |
IMPORT_C void CFormattedCellListBoxItemDrawer_Reserved();
|
williamr@4
|
258 |
|
williamr@4
|
259 |
protected:
|
williamr@4
|
260 |
|
williamr@4
|
261 |
/**
|
williamr@4
|
262 |
* Top item index.
|
williamr@4
|
263 |
*/
|
williamr@4
|
264 |
TInt iTopItemIndex;
|
williamr@4
|
265 |
|
williamr@4
|
266 |
/**
|
williamr@4
|
267 |
* Array for list box item's properties.
|
williamr@4
|
268 |
* Own.
|
williamr@4
|
269 |
*/
|
williamr@4
|
270 |
CArrayFix<SListProperties>* iPropertyArray;
|
williamr@4
|
271 |
|
williamr@4
|
272 |
private:
|
williamr@4
|
273 |
|
williamr@4
|
274 |
TInt iSpare;
|
williamr@4
|
275 |
};
|
williamr@4
|
276 |
|
williamr@4
|
277 |
|
williamr@4
|
278 |
/**
|
williamr@4
|
279 |
* Avkon base class similar to uikon's column listbox.
|
williamr@4
|
280 |
*
|
williamr@4
|
281 |
* @code
|
williamr@4
|
282 |
* ListBox <>--> View ---> ItemDrawer ---> Model
|
williamr@4
|
283 |
* ListBox <>--> ItemDrawer <>---> Data
|
williamr@4
|
284 |
* ListBox <>--> Model <>---> MDesCArray <--- Array <>---> Engine
|
williamr@4
|
285 |
* @endcode
|
williamr@4
|
286 |
*
|
williamr@4
|
287 |
* Content for list items are tab-separated strings.
|
williamr@4
|
288 |
*
|
williamr@4
|
289 |
* See concrete classes derived from @c CEikFormattedCellListBox for details.
|
williamr@4
|
290 |
*
|
williamr@4
|
291 |
* Starting from 3.0 listbox uses highlight animations. Starting and stopping
|
williamr@4
|
292 |
* animation is connected to focus events. To support highlight animations
|
williamr@4
|
293 |
* properly you have to make sure that the list has focus when it has 'visual
|
williamr@4
|
294 |
* focus'. Common issues:
|
williamr@4
|
295 |
* - In many cases list is in a container which sits on top of the control
|
williamr@4
|
296 |
* stack. The container receives all focus events and should hand them to the
|
williamr@4
|
297 |
* list too. E.g.
|
williamr@4
|
298 |
* @code void CContainer::FocusChanged( TDrawNow aDrawNow )
|
williamr@4
|
299 |
* {
|
williamr@4
|
300 |
* ... some code ...
|
williamr@4
|
301 |
* if( iListBox )
|
williamr@4
|
302 |
* iListBox->SetFocus( IsFocused(), aDrawNow );
|
williamr@4
|
303 |
* }
|
williamr@4
|
304 |
* @endcode
|
williamr@4
|
305 |
* - When switching components programmatically, e.g. from one list to another
|
williamr@4
|
306 |
* in the same view, make sure that you remove focus from the other
|
williamr@4
|
307 |
* component.
|
williamr@4
|
308 |
* - In more complex cases you may have to add a dummy interceptor control to
|
williamr@4
|
309 |
* the top of control stack to hand focus events to list.
|
williamr@4
|
310 |
* - Make sure you handle resource changes correctly. If resource handle chain
|
williamr@4
|
311 |
* is solid it should reach @c CCoeControl::HandleResourceChange, which
|
williamr@4
|
312 |
* informs child components about resource change.
|
williamr@4
|
313 |
*
|
williamr@4
|
314 |
* See methods
|
williamr@4
|
315 |
* @c CEikListBox::ConstructL()
|
williamr@4
|
316 |
* @c CEikTextListBox::SetItemTextArray()
|
williamr@4
|
317 |
* @c CEikFormattedCellListBoxData::SetIconArray()
|
williamr@4
|
318 |
*
|
williamr@4
|
319 |
* Related flags for dialogs (@c avkon.hrh)
|
williamr@4
|
320 |
* @c EAknDialogSelectionList
|
williamr@4
|
321 |
* @c EAknDialogMenuList
|
williamr@4
|
322 |
* @c EAknDialogMultiselectionList
|
williamr@4
|
323 |
*
|
williamr@4
|
324 |
* Check also:
|
williamr@4
|
325 |
* @c CAknSelectionListDialog (@c aknselectionlist.h)
|
williamr@4
|
326 |
* @c CAknMarkableListDialog (@c aknselectionlist.h)
|
williamr@4
|
327 |
* @c CAknPopupList (@c aknpopup.h)
|
williamr@4
|
328 |
* @c CAknListQueryDialog (@c aknquerydialog.h)
|
williamr@4
|
329 |
* @c CAknColumnListBox (@c aknlists.h)
|
williamr@4
|
330 |
*
|
williamr@4
|
331 |
* @lib avkon
|
williamr@4
|
332 |
*/
|
williamr@4
|
333 |
class CEikFormattedCellListBox : public CEikTextListBox
|
williamr@4
|
334 |
{
|
williamr@4
|
335 |
|
williamr@4
|
336 |
public:
|
williamr@4
|
337 |
|
williamr@4
|
338 |
/**
|
williamr@4
|
339 |
* C++ default constructor.
|
williamr@4
|
340 |
*/
|
williamr@4
|
341 |
IMPORT_C CEikFormattedCellListBox();
|
williamr@4
|
342 |
|
williamr@4
|
343 |
/**
|
williamr@4
|
344 |
* Constructs list box from resource file. See @c LISTBOX resource
|
williamr@4
|
345 |
* definition.
|
williamr@4
|
346 |
*
|
williamr@4
|
347 |
* Flags:
|
williamr@4
|
348 |
* @c EAknListBoxSelectionList,
|
williamr@4
|
349 |
* @c EAknListBoxMenuList,
|
williamr@4
|
350 |
* @c EAknListBoxMarkableList,
|
williamr@4
|
351 |
* @c EAknListBoxMultiselectionList,
|
williamr@4
|
352 |
* @c EAknListBoxViewerFlags
|
williamr@4
|
353 |
*
|
williamr@4
|
354 |
* @param aReader Reference to resource reader @c TResourceReader object.
|
williamr@4
|
355 |
*/
|
williamr@4
|
356 |
IMPORT_C void ConstructFromResourceL(TResourceReader& aReader);
|
williamr@4
|
357 |
|
williamr@4
|
358 |
/**
|
williamr@4
|
359 |
* By default Symbian 2nd phase constructor is private. Must be called
|
williamr@4
|
360 |
* if resource data is not used.
|
williamr@4
|
361 |
*
|
williamr@4
|
362 |
* @param aParent Pointer to @c CCoeControl class, parent control.
|
williamr@4
|
363 |
* @param aFlags Flags for @c CEikListBox constructor. Possible flags :
|
williamr@4
|
364 |
* @c EAknListBoxSelectionList,
|
williamr@4
|
365 |
* @c EAknListBoxMenuList,
|
williamr@4
|
366 |
* @c EAknListBoxMarkableList,
|
williamr@4
|
367 |
* @c EAknListBoxMultiselectionList,
|
williamr@4
|
368 |
* @c EAknListBoxViewerFlags
|
williamr@4
|
369 |
*/
|
williamr@4
|
370 |
IMPORT_C void ConstructL(const CCoeControl* aParent, TInt aFlags);
|
williamr@4
|
371 |
|
williamr@4
|
372 |
public:
|
williamr@4
|
373 |
|
williamr@4
|
374 |
/**
|
williamr@4
|
375 |
* Gets model class of the list box.
|
williamr@4
|
376 |
*
|
williamr@4
|
377 |
* @return Pointer to list box model class instance.
|
williamr@4
|
378 |
*/
|
williamr@4
|
379 |
IMPORT_C CTextListBoxModel* Model() const;
|
williamr@4
|
380 |
|
williamr@4
|
381 |
/**
|
williamr@4
|
382 |
* Gets list box item drawer.
|
williamr@4
|
383 |
*
|
williamr@4
|
384 |
* @return Pointer to item drawer object.
|
williamr@4
|
385 |
*/
|
williamr@4
|
386 |
IMPORT_C CFormattedCellListBoxItemDrawer* ItemDrawer() const;
|
williamr@4
|
387 |
|
williamr@4
|
388 |
/**
|
williamr@4
|
389 |
* Sets icon sizes for visible list box items.
|
williamr@4
|
390 |
*/
|
williamr@4
|
391 |
void SetIconSizes();
|
williamr@4
|
392 |
|
williamr@4
|
393 |
public:
|
williamr@4
|
394 |
|
williamr@4
|
395 |
/**
|
williamr@4
|
396 |
* Enable or disable logical to visual reordering in listbox data text
|
williamr@4
|
397 |
* drawing. By default, it is enabled. This has any effect only when
|
williamr@4
|
398 |
* bidirectional text is rendered.
|
williamr@4
|
399 |
*
|
williamr@4
|
400 |
* If you convert text to visual order prior to passing it to the listbox
|
williamr@4
|
401 |
* (for example by wrapping text to lines with methods in
|
williamr@4
|
402 |
* @c AknBidiTextUtils), then you should disable conversion in listbox
|
williamr@4
|
403 |
* by calling this method.
|
williamr@4
|
404 |
*
|
williamr@4
|
405 |
* @since S60 2.0
|
williamr@4
|
406 |
* @param aUseConversion If @c ETrue enable conversion.
|
williamr@4
|
407 |
*/
|
williamr@4
|
408 |
IMPORT_C void UseLogicalToVisualConversion( TBool aUseConversion );
|
williamr@4
|
409 |
|
williamr@4
|
410 |
public:
|
williamr@4
|
411 |
|
williamr@4
|
412 |
/**
|
williamr@4
|
413 |
* This method needs to be called to enable extended drawing features such
|
williamr@4
|
414 |
* as skinning, pictograph drawing and marquee text in the listbox draw
|
williamr@4
|
415 |
* routine.
|
williamr@4
|
416 |
*
|
williamr@4
|
417 |
* Methods @c CEikFormattedCellListBox::ConstructL and
|
williamr@4
|
418 |
* @c CEikFormattedCellListBox::ConstructFromResourceL call this method.
|
williamr@4
|
419 |
* So, you only need to call this if your listbox implementation does not
|
williamr@4
|
420 |
* call either of those.
|
williamr@4
|
421 |
*
|
williamr@4
|
422 |
* This method can be safely called more than once.
|
williamr@4
|
423 |
* Item drawer must be created before calling this method, or a panic is
|
williamr@4
|
424 |
* raised.
|
williamr@4
|
425 |
*
|
williamr@4
|
426 |
* @since S60 2.6
|
williamr@4
|
427 |
* @panic EAknPanicListBoxItemDrawerNotCreated Panics if the item drawer
|
williamr@4
|
428 |
* for the current class has not been defined.
|
williamr@4
|
429 |
*/
|
williamr@4
|
430 |
IMPORT_C void EnableExtendedDrawingL();
|
williamr@4
|
431 |
|
williamr@4
|
432 |
/**
|
williamr@4
|
433 |
* Enables/disables list stretching. When a list is stretched its second line
|
williamr@4
|
434 |
* is moved after the first line. This is intented for devices with a large
|
williamr@4
|
435 |
* screen. This feature might be set as default by a product specific flag.
|
williamr@4
|
436 |
*
|
williamr@4
|
437 |
* Item drawer must be created before calling this method.
|
williamr@4
|
438 |
*
|
williamr@4
|
439 |
* @since S60 3.1
|
williamr@4
|
440 |
* @param aEnabled ETrue to enable list stretching.
|
williamr@4
|
441 |
*/
|
williamr@4
|
442 |
IMPORT_C void EnableStretching( const TBool aEnabled );
|
williamr@4
|
443 |
|
williamr@4
|
444 |
/**
|
williamr@4
|
445 |
* Hides the second row of a double style listbox. This feature is disabled
|
williamr@4
|
446 |
* by default.
|
williamr@4
|
447 |
*
|
williamr@4
|
448 |
* @since S60 3.1
|
williamr@4
|
449 |
* @param aHide ETrue to hide the second row.
|
williamr@4
|
450 |
*/
|
williamr@4
|
451 |
IMPORT_C void HideSecondRow( const TBool aHide );
|
williamr@4
|
452 |
protected:
|
williamr@4
|
453 |
|
williamr@4
|
454 |
/**
|
williamr@4
|
455 |
* Creates item draver for the listbox.
|
williamr@4
|
456 |
*/
|
williamr@4
|
457 |
IMPORT_C virtual void CreateItemDrawerL();
|
williamr@4
|
458 |
|
williamr@4
|
459 |
/**
|
williamr@4
|
460 |
* From @c CEikListBox.
|
williamr@4
|
461 |
*
|
williamr@4
|
462 |
* Rounds down the height of the rectangle (if necessary) so that only
|
williamr@4
|
463 |
* a whole number of items can be displayed inside the list box.
|
williamr@4
|
464 |
*
|
williamr@4
|
465 |
* @param aRect The rectangle to be modified.
|
williamr@4
|
466 |
* @return The number of pixels reduced.
|
williamr@4
|
467 |
*/
|
williamr@4
|
468 |
IMPORT_C virtual TInt AdjustRectHeightToWholeNumberOfItems(
|
williamr@4
|
469 |
TRect &aRect) const;
|
williamr@4
|
470 |
|
williamr@4
|
471 |
public: // from CEikListBox
|
williamr@4
|
472 |
|
williamr@4
|
473 |
/**
|
williamr@4
|
474 |
* From @c CEikListBox.
|
williamr@4
|
475 |
*
|
williamr@4
|
476 |
* Creates the list box view.
|
williamr@4
|
477 |
*
|
williamr@4
|
478 |
* @return Pointer to new list box view class instance.
|
williamr@4
|
479 |
*/
|
williamr@4
|
480 |
IMPORT_C CListBoxView* MakeViewClassInstanceL();
|
williamr@4
|
481 |
|
williamr@4
|
482 |
/**
|
williamr@4
|
483 |
* From @c CEikListBox.
|
williamr@4
|
484 |
*
|
williamr@4
|
485 |
* Handles focus changes.
|
williamr@4
|
486 |
*
|
williamr@4
|
487 |
* The function emphasizes or de-emphasizes the view as needed,
|
williamr@4
|
488 |
* and shows or hides the matcher cursor.
|
williamr@4
|
489 |
*
|
williamr@4
|
490 |
* @param aDrawNow If @c EDrawNow, a redraw is performed immediately.
|
williamr@4
|
491 |
*/
|
williamr@4
|
492 |
IMPORT_C void FocusChanged(TDrawNow aDrawNow);
|
williamr@4
|
493 |
|
williamr@4
|
494 |
public: // from CCoeControl
|
williamr@4
|
495 |
|
williamr@4
|
496 |
/**
|
williamr@4
|
497 |
* From @c CCoeControl.
|
williamr@4
|
498 |
*
|
williamr@4
|
499 |
* Gets the list of logical colors used to draw the control.
|
williamr@4
|
500 |
*
|
williamr@4
|
501 |
* @param aColorUseList The color list.
|
williamr@4
|
502 |
*/
|
williamr@4
|
503 |
IMPORT_C void GetColorUseListL(
|
williamr@4
|
504 |
CArrayFix<TCoeColorUse>& aColorUseList) const;
|
williamr@4
|
505 |
|
williamr@4
|
506 |
/**
|
williamr@4
|
507 |
* From @c CCoeControl.
|
williamr@4
|
508 |
*
|
williamr@4
|
509 |
* Handles a change to the control's resources.
|
williamr@4
|
510 |
*
|
williamr@4
|
511 |
* @param aType A message UID value.
|
williamr@4
|
512 |
*/
|
williamr@4
|
513 |
IMPORT_C void HandleResourceChange(TInt aType);
|
williamr@4
|
514 |
|
williamr@4
|
515 |
/**
|
williamr@4
|
516 |
* From @c CCoeControl.
|
williamr@4
|
517 |
*
|
williamr@4
|
518 |
* Handles pointer events.
|
williamr@4
|
519 |
*
|
williamr@4
|
520 |
* @param aPointerEvent The pointer event.
|
williamr@4
|
521 |
*/
|
williamr@4
|
522 |
IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
|
williamr@4
|
523 |
|
williamr@4
|
524 |
protected: // from MObjectProvider
|
williamr@4
|
525 |
|
williamr@4
|
526 |
/**
|
williamr@4
|
527 |
* From @c MObjectProvider.
|
williamr@4
|
528 |
*
|
williamr@4
|
529 |
* Retrieves an object of the same type as that encapsulated in aId. This
|
williamr@4
|
530 |
* function is used to allow controls to ask their owners for access to
|
williamr@4
|
531 |
* other objects that they own.
|
williamr@4
|
532 |
*
|
williamr@4
|
533 |
* @param aId An encapsulated object type ID.
|
williamr@4
|
534 |
* @return Encapsulates the pointer to the object provided.
|
williamr@4
|
535 |
* Note that the encapsulated pointer may be NULL.
|
williamr@4
|
536 |
*/
|
williamr@4
|
537 |
IMPORT_C virtual TTypeUid::Ptr MopSupplyObject(TTypeUid aId);
|
williamr@4
|
538 |
|
williamr@4
|
539 |
private:
|
williamr@4
|
540 |
|
williamr@4
|
541 |
/**
|
williamr@4
|
542 |
* From @c CAknControl
|
williamr@4
|
543 |
*/
|
williamr@4
|
544 |
IMPORT_C void* ExtensionInterface( TUid aInterface );
|
williamr@4
|
545 |
|
williamr@4
|
546 |
private: // listbox use only
|
williamr@4
|
547 |
|
williamr@4
|
548 |
IMPORT_C virtual void CEikListBox_Reserved();
|
williamr@4
|
549 |
|
williamr@4
|
550 |
private: // data
|
williamr@4
|
551 |
|
williamr@4
|
552 |
TInt iSpare;
|
williamr@4
|
553 |
};
|
williamr@4
|
554 |
|
williamr@4
|
555 |
|
williamr@4
|
556 |
/**
|
williamr@4
|
557 |
* @c CFormattedCellListBoxView draws all the list items and manages
|
williamr@4
|
558 |
* the area of the screen allocated for list itself. In particular,
|
williamr@4
|
559 |
* this class does not handle margins of the whole list.
|
williamr@4
|
560 |
*
|
williamr@4
|
561 |
* @lib avkon
|
williamr@4
|
562 |
*/
|
williamr@4
|
563 |
class CFormattedCellListBoxView : public CListBoxView
|
williamr@4
|
564 |
{
|
williamr@4
|
565 |
|
williamr@4
|
566 |
public: // from CListBoxView
|
williamr@4
|
567 |
|
williamr@4
|
568 |
/**
|
williamr@4
|
569 |
* From @c CListBoxView.
|
williamr@4
|
570 |
*
|
williamr@4
|
571 |
* Draws every visible item into the specified rectangle.
|
williamr@4
|
572 |
*
|
williamr@4
|
573 |
* @param aClipRect The rectangle to draw into. This is not used.
|
williamr@4
|
574 |
*/
|
williamr@4
|
575 |
IMPORT_C void Draw(const TRect* aClipRect = NULL) const;
|
williamr@4
|
576 |
|
williamr@4
|
577 |
/**
|
williamr@4
|
578 |
* From @c CListBoxView.
|
williamr@4
|
579 |
*
|
williamr@4
|
580 |
* Draws empty list.
|
williamr@4
|
581 |
*
|
williamr@4
|
582 |
* @param aClientRect The rectangle to draw into.
|
williamr@4
|
583 |
*/
|
williamr@4
|
584 |
IMPORT_C virtual void DrawEmptyList(const TRect &aClientRect) const;
|
williamr@4
|
585 |
|
williamr@4
|
586 |
/**
|
williamr@4
|
587 |
* From @c CListBoxView.
|
williamr@4
|
588 |
*
|
williamr@4
|
589 |
* Recalculates the index of the bottom item in the list from the top item
|
williamr@4
|
590 |
* index and the size of the display. This function is called by the owning
|
williamr@4
|
591 |
* list box control when either the size of the list box or the number of
|
williamr@4
|
592 |
* items in its model changes.
|
williamr@4
|
593 |
*/
|
williamr@4
|
594 |
IMPORT_C virtual void CalcBottomItemIndex();
|
williamr@4
|
595 |
|
williamr@4
|
596 |
private: // overridden from CListBoxView
|
williamr@4
|
597 |
|
williamr@4
|
598 |
IMPORT_C virtual TAny* Reserved_1();
|
williamr@4
|
599 |
};
|
williamr@4
|
600 |
|
williamr@4
|
601 |
|
williamr@4
|
602 |
#endif // __EIKFRLB_H__
|
williamr@4
|
603 |
|
williamr@4
|
604 |
// End of File
|