williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description:
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
#if !defined(__EIKLBV_H__)
|
williamr@2
|
21 |
#define __EIKLBV_H__
|
williamr@2
|
22 |
|
williamr@2
|
23 |
#if !defined(__E32BASE_H__)
|
williamr@2
|
24 |
#include <e32base.h>
|
williamr@2
|
25 |
#endif
|
williamr@2
|
26 |
|
williamr@2
|
27 |
#if !defined(__GDI_H__)
|
williamr@2
|
28 |
#include <gdi.h>
|
williamr@2
|
29 |
#endif
|
williamr@2
|
30 |
|
williamr@2
|
31 |
class CListItemDrawer;
|
williamr@2
|
32 |
class MListBoxModel;
|
williamr@2
|
33 |
class CWindowGc;
|
williamr@2
|
34 |
class RWindowGroup;
|
williamr@2
|
35 |
class CWsScreenDevice;
|
williamr@2
|
36 |
class CWindowGc;
|
williamr@2
|
37 |
class RWindow;
|
williamr@2
|
38 |
class CListBoxViewExtension;
|
williamr@2
|
39 |
class CEikListBox;
|
williamr@2
|
40 |
|
williamr@2
|
41 |
//
|
williamr@2
|
42 |
// class MListVisibiltyObserver
|
williamr@2
|
43 |
//
|
williamr@2
|
44 |
|
williamr@2
|
45 |
class MListVisibilityObserver
|
williamr@2
|
46 |
{
|
williamr@2
|
47 |
public:
|
williamr@2
|
48 |
virtual TBool IsVisible() const = 0;
|
williamr@2
|
49 |
};
|
williamr@2
|
50 |
|
williamr@2
|
51 |
/**
|
williamr@2
|
52 |
* List box view.
|
williamr@2
|
53 |
*
|
williamr@2
|
54 |
* A list box view displays the list items which are currently visible in
|
williamr@2
|
55 |
* a list box. List box views draw each of the items for display using
|
williamr@2
|
56 |
* methods defined in their associated list box drawer.
|
williamr@2
|
57 |
*
|
williamr@2
|
58 |
* Together with its list item drawer, a @c CListBoxView encapsulates the
|
williamr@2
|
59 |
* on-screen appearance of data in a list box.
|
williamr@2
|
60 |
*
|
williamr@2
|
61 |
* List box views also encapsulate item selection, the current item, and the
|
williamr@2
|
62 |
* fundamentals of how the selection and the current item are updated according
|
williamr@2
|
63 |
* to user input. Input events themselves are handled by @c CEikListBox,
|
williamr@2
|
64 |
* which calls member functions of @c CListBoxView appropriately.
|
williamr@2
|
65 |
*
|
williamr@2
|
66 |
* This class is sufficient for plain list box views, and may be derived from
|
williamr@2
|
67 |
* in order to provide more complex list views. @c TechView supplies and uses
|
williamr@2
|
68 |
* the classes @c CHierarchicalListBoxView and @c CSnakingListBoxView, which
|
williamr@2
|
69 |
* provide two kinds of indented list views.
|
williamr@2
|
70 |
*/
|
williamr@2
|
71 |
class CListBoxView : public CBase
|
williamr@2
|
72 |
{
|
williamr@2
|
73 |
public:
|
williamr@2
|
74 |
|
williamr@2
|
75 |
/**
|
williamr@2
|
76 |
* Cursor movement flags. These describe the cursor movements recognised by
|
williamr@2
|
77 |
* @c MoveCursorL().
|
williamr@2
|
78 |
*/
|
williamr@2
|
79 |
enum TCursorMovement
|
williamr@2
|
80 |
{
|
williamr@2
|
81 |
/** Cursors movement to next item. */
|
williamr@2
|
82 |
ECursorNextItem,
|
williamr@2
|
83 |
|
williamr@2
|
84 |
/** Cursors movement to previous item. */
|
williamr@2
|
85 |
ECursorPreviousItem,
|
williamr@2
|
86 |
|
williamr@2
|
87 |
/** Cursors movement to next column. */
|
williamr@2
|
88 |
ECursorNextColumn,
|
williamr@2
|
89 |
|
williamr@2
|
90 |
/** Cursors movement to previous column. */
|
williamr@2
|
91 |
ECursorPreviousColumn,
|
williamr@2
|
92 |
|
williamr@2
|
93 |
/** Cursors movement to previous page. */
|
williamr@2
|
94 |
ECursorPreviousPage,
|
williamr@2
|
95 |
|
williamr@2
|
96 |
/** Cursors movement to next page. */
|
williamr@2
|
97 |
ECursorNextPage,
|
williamr@2
|
98 |
|
williamr@2
|
99 |
/** Cursors movement to the first item. */
|
williamr@2
|
100 |
ECursorFirstItem,
|
williamr@2
|
101 |
|
williamr@2
|
102 |
/** Cursors movement to the last item. */
|
williamr@2
|
103 |
ECursorLastItem,
|
williamr@2
|
104 |
|
williamr@2
|
105 |
/** Cursors movement to the next screen. */
|
williamr@2
|
106 |
ECursorNextScreen,
|
williamr@2
|
107 |
|
williamr@2
|
108 |
/** Cursors movement to the previous screen. */
|
williamr@2
|
109 |
ECursorPrevScreen
|
williamr@2
|
110 |
};
|
williamr@2
|
111 |
|
williamr@2
|
112 |
/**
|
williamr@2
|
113 |
* List box view flags.
|
williamr@2
|
114 |
*
|
williamr@2
|
115 |
* These flags may be combined with a logical OR to get a combination of
|
williamr@2
|
116 |
* effects.
|
williamr@2
|
117 |
*/
|
williamr@2
|
118 |
enum TFlags
|
williamr@2
|
119 |
{
|
williamr@2
|
120 |
/** A selection anchor exists. */
|
williamr@2
|
121 |
EAnchorExists = 0x0001,
|
williamr@2
|
122 |
|
williamr@2
|
123 |
/** The view is emphasised. */
|
williamr@2
|
124 |
EEmphasized = 0x0002,
|
williamr@2
|
125 |
|
williamr@2
|
126 |
/** The view is dimmed. */
|
williamr@2
|
127 |
EDimmed = 0x0004,
|
williamr@2
|
128 |
|
williamr@2
|
129 |
/** List box view has a cursor for incremental matching. */
|
williamr@2
|
130 |
EHasMatcherCursor = 0x0008,
|
williamr@2
|
131 |
|
williamr@2
|
132 |
/** Redraw is disabled. */
|
williamr@2
|
133 |
EDisableRedraw = 0x0010,
|
williamr@2
|
134 |
|
williamr@2
|
135 |
/** If set, selected items are painted. */
|
williamr@2
|
136 |
EPaintedSelection = 0x0020,
|
williamr@2
|
137 |
|
williamr@2
|
138 |
/** Item marking enabled. */
|
williamr@2
|
139 |
EMarkSelection = 0x0040,
|
williamr@2
|
140 |
|
williamr@2
|
141 |
/** Item unmarking enabled. */
|
williamr@2
|
142 |
EUnmarkSelection = 0x0080,
|
williamr@2
|
143 |
|
williamr@2
|
144 |
/** Item count changes enabled. */
|
williamr@2
|
145 |
EItemCountModified = 0x0100,
|
williamr@2
|
146 |
|
williamr@2
|
147 |
/** Vertical offset has changed. */
|
williamr@2
|
148 |
EOffsetChanged = 0x0200,
|
williamr@2
|
149 |
};
|
williamr@2
|
150 |
|
williamr@2
|
151 |
/**
|
williamr@2
|
152 |
* Modes for modifying the selection.
|
williamr@2
|
153 |
*
|
williamr@2
|
154 |
* Changing the current item of a list box view may also affect which items
|
williamr@2
|
155 |
* are selected. The selection mode of such an action describes how (or if)
|
williamr@2
|
156 |
* the selection is altered by the action.
|
williamr@2
|
157 |
*
|
williamr@2
|
158 |
* Each function of @c CListBoxView which affects the current item is
|
williamr@2
|
159 |
* passed an appropriate selection mode by the calling input handler method
|
williamr@2
|
160 |
* of @c CEikListBox. The mode is varied according to the keyboard
|
williamr@2
|
161 |
* modifiers held down by the user, or whether a pointer action was a tap
|
williamr@2
|
162 |
* or a sweep.
|
williamr@2
|
163 |
*
|
williamr@2
|
164 |
* Note that the behaviour of list box views may vary with the target
|
williamr@2
|
165 |
* phone due to the wide range of possible input devices.
|
williamr@2
|
166 |
* The following description assumes a phone with a pointer and a keyboard.
|
williamr@2
|
167 |
*/
|
williamr@2
|
168 |
enum TSelectionMode
|
williamr@2
|
169 |
{
|
williamr@2
|
170 |
/**
|
williamr@2
|
171 |
* The selection is not changed by actions while this is in effect,
|
williamr@2
|
172 |
* holding CTRL while pressing cursor up or down for example.
|
williamr@2
|
173 |
*/
|
williamr@2
|
174 |
ENoSelection,
|
williamr@2
|
175 |
|
williamr@2
|
176 |
/**
|
williamr@2
|
177 |
* Only a single item in the list is allowed to be selected by an
|
williamr@2
|
178 |
* action; when selecting individual items with the pointer, or
|
williamr@2
|
179 |
* moving using the cursor keys without any modifiers for example.
|
williamr@2
|
180 |
*/
|
williamr@2
|
181 |
ESingleSelection,
|
williamr@2
|
182 |
|
williamr@2
|
183 |
/**
|
williamr@2
|
184 |
* A single continuous run of items can be added to the selection array
|
williamr@2
|
185 |
* by an action, when keyboard-selecting with the shift key held down,
|
williamr@2
|
186 |
* or when sweeping a selection with the pointer for example.
|
williamr@2
|
187 |
*/
|
williamr@2
|
188 |
EContiguousSelection,
|
williamr@2
|
189 |
|
williamr@2
|
190 |
/**
|
williamr@2
|
191 |
* Any single item in the list may be added to the selection by an
|
williamr@2
|
192 |
* action, when selecting or drag-selecting with the pointer when the
|
williamr@2
|
193 |
* @c CTRL key is held down for example.
|
williamr@2
|
194 |
*/
|
williamr@2
|
195 |
EDisjointSelection,
|
williamr@2
|
196 |
|
williamr@2
|
197 |
/**
|
williamr@2
|
198 |
* Any single item in the list may be removed from the selection by an
|
williamr@2
|
199 |
* action, when unselecting for example.
|
williamr@2
|
200 |
*/
|
williamr@2
|
201 |
EDisjointMarkSelection,
|
williamr@2
|
202 |
|
williamr@2
|
203 |
/**
|
williamr@2
|
204 |
* Multiple items can be added to the selection array by an action,
|
williamr@2
|
205 |
* when selecting with the edit key for example.
|
williamr@2
|
206 |
*/
|
williamr@2
|
207 |
EPenMultiselection,
|
williamr@2
|
208 |
|
williamr@2
|
209 |
/**
|
williamr@2
|
210 |
* Mark mode is changed to @c EUnmarkSelection if item is marked or
|
williamr@2
|
211 |
* @c EMarkSelection if item is not marked by an action, when selecting
|
williamr@2
|
212 |
* or unselecting item for example.
|
williamr@2
|
213 |
*/
|
williamr@2
|
214 |
EChangeMarkMode
|
williamr@2
|
215 |
};
|
williamr@2
|
216 |
|
williamr@2
|
217 |
/** The items which are selected within a list box list. */
|
williamr@2
|
218 |
typedef CArrayFix<TInt> CSelectionIndexArray;
|
williamr@2
|
219 |
|
williamr@2
|
220 |
public:
|
williamr@2
|
221 |
|
williamr@2
|
222 |
/**
|
williamr@2
|
223 |
* Destructor.
|
williamr@2
|
224 |
*/
|
williamr@2
|
225 |
IMPORT_C ~CListBoxView();
|
williamr@2
|
226 |
|
williamr@2
|
227 |
/**
|
williamr@2
|
228 |
* C++ default constructor.
|
williamr@2
|
229 |
*
|
williamr@2
|
230 |
* Allocates an area of memory for a @c CListBoxView, and begins its
|
williamr@2
|
231 |
* initialisation.
|
williamr@2
|
232 |
*/
|
williamr@2
|
233 |
IMPORT_C CListBoxView();
|
williamr@2
|
234 |
|
williamr@2
|
235 |
/**
|
williamr@2
|
236 |
* By default Symbian 2nd phase constructor is private.
|
williamr@2
|
237 |
*
|
williamr@2
|
238 |
* This function completes the initialisation of a default-constructed list
|
williamr@2
|
239 |
* box view. The item drawer’s graphics context is created on @c aScreen,
|
williamr@2
|
240 |
* and the list item drawer’s graphics context is set to this. See
|
williamr@2
|
241 |
* @c CListItemDrawer::SetGc().
|
williamr@2
|
242 |
*
|
williamr@2
|
243 |
* @param aListBoxModel The list box model to use.
|
williamr@2
|
244 |
* @param aItemDrawer A default-constructed item drawer.
|
williamr@2
|
245 |
* @param aScreen Screen on which to display.
|
williamr@2
|
246 |
* @param aGroupWin This list box view’s window group.
|
williamr@2
|
247 |
* @param aWsWindow Window for this view.
|
williamr@2
|
248 |
* @param aDisplayArea The viewing rectangle this list box view is to use.
|
williamr@2
|
249 |
* @param aItemHeight Height of a single list item.
|
williamr@2
|
250 |
*/
|
williamr@2
|
251 |
IMPORT_C virtual void ConstructL(MListBoxModel* aListBoxModel,
|
williamr@2
|
252 |
CListItemDrawer* aItemDrawer,
|
williamr@2
|
253 |
CWsScreenDevice* aScreen,
|
williamr@2
|
254 |
RWindowGroup* aGroupWin,
|
williamr@2
|
255 |
RWindow* aWsWindow,
|
williamr@2
|
256 |
const TRect& aDisplayArea,
|
williamr@2
|
257 |
TInt aItemHeight);
|
williamr@2
|
258 |
|
williamr@2
|
259 |
// functions for accessing the view rect (the area of the host window in
|
williamr@2
|
260 |
// which the items are drawn)
|
williamr@2
|
261 |
/**
|
williamr@2
|
262 |
* Gets the list box’s view rectangle.
|
williamr@2
|
263 |
*
|
williamr@2
|
264 |
* @return This list box’s view rectangle.
|
williamr@2
|
265 |
*/
|
williamr@2
|
266 |
IMPORT_C TRect ViewRect() const;
|
williamr@2
|
267 |
|
williamr@2
|
268 |
/**
|
williamr@2
|
269 |
* Sets the area within the list window in which the view can draw itself.
|
williamr@2
|
270 |
*
|
williamr@2
|
271 |
* @param aRect New view rectangle.
|
williamr@2
|
272 |
*/
|
williamr@2
|
273 |
IMPORT_C void SetViewRect(const TRect& aRect);
|
williamr@2
|
274 |
|
williamr@2
|
275 |
// misc. access functions for the main attributes
|
williamr@2
|
276 |
/**
|
williamr@2
|
277 |
* Gets the current item’s index.
|
williamr@2
|
278 |
*
|
williamr@2
|
279 |
* @return Index number of the current item.
|
williamr@2
|
280 |
*/
|
williamr@2
|
281 |
IMPORT_C virtual TInt CurrentItemIndex() const;
|
williamr@2
|
282 |
|
williamr@2
|
283 |
/**
|
williamr@2
|
284 |
* Set the index of the current item. This function changes the current
|
williamr@2
|
285 |
* item, but does not redraw the list view or update the selection.
|
williamr@2
|
286 |
*
|
williamr@2
|
287 |
* @param aItemIndex Which item to make current.
|
williamr@2
|
288 |
* @panic EEikPanicListBoxInvalidCurrentItemIndexSpecified Panics if the
|
williamr@2
|
289 |
* given index is not valid.
|
williamr@2
|
290 |
*/
|
williamr@2
|
291 |
IMPORT_C void SetCurrentItemIndex(TInt aItemIndex);
|
williamr@2
|
292 |
|
williamr@2
|
293 |
/**
|
williamr@2
|
294 |
* Gets the index of the item at the top of the view.
|
williamr@2
|
295 |
*
|
williamr@2
|
296 |
* @return The item currently displayed at the top of this list box view.
|
williamr@2
|
297 |
*/
|
williamr@2
|
298 |
IMPORT_C TInt TopItemIndex() const;
|
williamr@2
|
299 |
|
williamr@2
|
300 |
/**
|
williamr@2
|
301 |
* Sets the item at the top of the view by its index in the list of all
|
williamr@2
|
302 |
* items. This function also invokes @c CalcBottomItemIndex().
|
williamr@2
|
303 |
*
|
williamr@2
|
304 |
* @param aItemIndex Index of the item to start the view at.
|
williamr@2
|
305 |
* @panic EEikPanicListBoxInvalidTopItemIndexSpecified Panics if the given
|
williamr@2
|
306 |
* index is not valid.
|
williamr@2
|
307 |
*/
|
williamr@2
|
308 |
IMPORT_C virtual void SetTopItemIndex(TInt aItemIndex);
|
williamr@2
|
309 |
|
williamr@2
|
310 |
/**
|
williamr@2
|
311 |
* Gets the index of the item at the bottom of this view.
|
williamr@2
|
312 |
*
|
williamr@2
|
313 |
* @return Index of the item at the bottom of this view.
|
williamr@2
|
314 |
*/
|
williamr@2
|
315 |
IMPORT_C TInt BottomItemIndex() const;
|
williamr@2
|
316 |
|
williamr@2
|
317 |
/**
|
williamr@2
|
318 |
* Recalculates the index of the bottom item in the list by using the top
|
williamr@2
|
319 |
* item index and the size of the display.
|
williamr@2
|
320 |
*
|
williamr@2
|
321 |
* This function is called by the owning list box control when either the
|
williamr@2
|
322 |
* size of the list box or the number of items in its model changes.
|
williamr@2
|
323 |
*/
|
williamr@2
|
324 |
IMPORT_C virtual void CalcBottomItemIndex();
|
williamr@2
|
325 |
|
williamr@2
|
326 |
/**
|
williamr@2
|
327 |
* Sets the item height.
|
williamr@2
|
328 |
*
|
williamr@2
|
329 |
* @param aItemHeight New item height.
|
williamr@2
|
330 |
*/
|
williamr@2
|
331 |
IMPORT_C virtual void SetItemHeight(TInt aItemHeight);
|
williamr@2
|
332 |
|
williamr@2
|
333 |
// functions that support incremental matching
|
williamr@2
|
334 |
/**
|
williamr@2
|
335 |
* Sets the match cursor’s colour.
|
williamr@2
|
336 |
*
|
williamr@2
|
337 |
* @deprecated
|
williamr@2
|
338 |
* @param aColor Colour in which to display the incremental match cursor.
|
williamr@2
|
339 |
*/
|
williamr@2
|
340 |
IMPORT_C void SetMatcherCursorColor(TRgb aColor);
|
williamr@2
|
341 |
|
williamr@2
|
342 |
/**
|
williamr@2
|
343 |
* Sets the match cursor's position.
|
williamr@2
|
344 |
*
|
williamr@2
|
345 |
* @deprecated
|
williamr@2
|
346 |
* @param aPosWithinCurrentItem Character position for the match cursor
|
williamr@2
|
347 |
* within the current item’s string.
|
williamr@2
|
348 |
*/
|
williamr@2
|
349 |
IMPORT_C void SetMatcherCursorPos(TInt aPosWithinCurrentItem);
|
williamr@2
|
350 |
|
williamr@2
|
351 |
/**
|
williamr@2
|
352 |
* Gets the match cursor’s position.
|
williamr@2
|
353 |
*
|
williamr@2
|
354 |
* @deprecated
|
williamr@2
|
355 |
* @return Character position of the match cursor within the current
|
williamr@2
|
356 |
* item’s string.
|
williamr@2
|
357 |
*/
|
williamr@2
|
358 |
IMPORT_C TInt MatcherCursorPos() const;
|
williamr@2
|
359 |
|
williamr@2
|
360 |
/**
|
williamr@2
|
361 |
* Draws the match cursor in its current screen position if the matcher
|
williamr@2
|
362 |
* cursor flag has been set.
|
williamr@2
|
363 |
*
|
williamr@2
|
364 |
* This is deprecated and broken and should not be used.
|
williamr@2
|
365 |
*
|
williamr@2
|
366 |
* @deprecated
|
williamr@2
|
367 |
*/
|
williamr@2
|
368 |
IMPORT_C virtual void DrawMatcherCursor();
|
williamr@2
|
369 |
|
williamr@2
|
370 |
/**
|
williamr@2
|
371 |
* Hides the matcher cursor.
|
williamr@2
|
372 |
*
|
williamr@2
|
373 |
* @deprecated
|
williamr@2
|
374 |
*/
|
williamr@2
|
375 |
IMPORT_C void HideMatcherCursor();
|
williamr@2
|
376 |
|
williamr@2
|
377 |
/**
|
williamr@2
|
378 |
* Sets whether the matcher cursor flag to specify whether the match
|
williamr@2
|
379 |
* cursor is drawn.
|
williamr@2
|
380 |
*
|
williamr@2
|
381 |
* @deprecated
|
williamr@2
|
382 |
* @param aMatcherCursor If @c ETrue, the view will draw match cursor.
|
williamr@2
|
383 |
*/
|
williamr@2
|
384 |
IMPORT_C void SetMatcherCursor(TBool aMatcherCursor);
|
williamr@2
|
385 |
|
williamr@2
|
386 |
/**
|
williamr@2
|
387 |
* Sets whether or not items are drawn as emphasised.
|
williamr@2
|
388 |
*
|
williamr@2
|
389 |
* The function sets or resets the emphasised flag.
|
williamr@2
|
390 |
*
|
williamr@2
|
391 |
* @param aEmphasized If @c ETrue, this view will draw items emphasised.
|
williamr@2
|
392 |
* If @c EFalse will not draw items emphasised.
|
williamr@2
|
393 |
*/
|
williamr@2
|
394 |
IMPORT_C void SetEmphasized(TBool aEmphasized);
|
williamr@2
|
395 |
|
williamr@2
|
396 |
/**
|
williamr@2
|
397 |
* Sets whether items will be drawn dimmed.
|
williamr@2
|
398 |
*
|
williamr@2
|
399 |
* The function sets or resets the dim flag.
|
williamr@2
|
400 |
*
|
williamr@2
|
401 |
* @param aDimmed If @c ETrue, this view will draw items dimmed.
|
williamr@2
|
402 |
* If @c EFalse this view will not draw items dimmed.
|
williamr@2
|
403 |
*/
|
williamr@2
|
404 |
IMPORT_C void SetDimmed(TBool aDimmed);
|
williamr@2
|
405 |
|
williamr@2
|
406 |
/**
|
williamr@2
|
407 |
* Disables or enables redraws.
|
williamr@2
|
408 |
*
|
williamr@2
|
409 |
* If this flag is set to @c ETrue, all member functions which draw items
|
williamr@2
|
410 |
* will return immediately without drawing anything. Functions which update
|
williamr@2
|
411 |
* the internal state of the list box will still work, but nothing will be
|
williamr@2
|
412 |
* drawn or updated on the screen.
|
williamr@2
|
413 |
*
|
williamr@2
|
414 |
* @param aDisableRedraw Disables redraw if @c ETrue.
|
williamr@2
|
415 |
*/
|
williamr@2
|
416 |
IMPORT_C void SetDisableRedraw(TBool aDisableRedraw);
|
williamr@2
|
417 |
|
williamr@2
|
418 |
/**
|
williamr@2
|
419 |
* Tests whether redraw is disabled.
|
williamr@2
|
420 |
*
|
williamr@2
|
421 |
* @return ETrue if redraw is disabled.
|
williamr@2
|
422 |
*/
|
williamr@2
|
423 |
IMPORT_C TBool RedrawDisabled() const;
|
williamr@2
|
424 |
|
williamr@2
|
425 |
/**
|
williamr@2
|
426 |
* Sets the painted selection flag.
|
williamr@2
|
427 |
*
|
williamr@2
|
428 |
* @deprecated
|
williamr@2
|
429 |
* @param aPaintedSelection If @c ETrue the painted selection flag is set
|
williamr@2
|
430 |
* on. If @c EFalse the selection flag is set off. If NULL the
|
williamr@2
|
431 |
* painted selection flag is cleared.
|
williamr@2
|
432 |
*/
|
williamr@2
|
433 |
IMPORT_C void SetPaintedSelection( TBool aPaintedSelection );
|
williamr@2
|
434 |
|
williamr@2
|
435 |
// functions that support selection
|
williamr@2
|
436 |
/**
|
williamr@2
|
437 |
* Gets a pointer to the selection list of this view.
|
williamr@2
|
438 |
*
|
williamr@2
|
439 |
* @return Pointer to an array describing the items
|
williamr@2
|
440 |
* in the list which are currently selected. The object pointed
|
williamr@2
|
441 |
* at is owned by the @c CListBoxView.
|
williamr@2
|
442 |
*/
|
williamr@2
|
443 |
IMPORT_C const CSelectionIndexArray* SelectionIndexes() const;
|
williamr@2
|
444 |
|
williamr@2
|
445 |
/**
|
williamr@2
|
446 |
* Gets a copy of the array of currently selected items.
|
williamr@2
|
447 |
*
|
williamr@2
|
448 |
* @param[in,out] aSelectionArray An instantiated @c CSelectionIndexArray.
|
williamr@2
|
449 |
* On return, contains a copy of selection indexes.
|
williamr@2
|
450 |
* @panic EEikPanicListBoxInvalidSelIndexArraySpecified Panics if the given
|
williamr@2
|
451 |
* selection index array is not valid.
|
williamr@2
|
452 |
* @panic EEikPanicListBoxNoSelIndexArray Panics if selection indexes have
|
williamr@2
|
453 |
* not been defined for this class.
|
williamr@2
|
454 |
*/
|
williamr@2
|
455 |
IMPORT_C void GetSelectionIndexesL(
|
williamr@2
|
456 |
CSelectionIndexArray* aSelectionArray) const;
|
williamr@2
|
457 |
|
williamr@2
|
458 |
/**
|
williamr@2
|
459 |
* Sets the currently selected items of this view from a selection index
|
williamr@2
|
460 |
* array.
|
williamr@2
|
461 |
*
|
williamr@2
|
462 |
* @param aSelectionIndexes Items to select.
|
williamr@2
|
463 |
* @panic EEikPanicListBoxInvalidSelIndexArraySpecified Panics if the given
|
williamr@2
|
464 |
* selection index array is not valid.
|
williamr@2
|
465 |
*/
|
williamr@2
|
466 |
IMPORT_C void SetSelectionIndexesL(const CSelectionIndexArray*
|
williamr@2
|
467 |
aSelectionIndexes);
|
williamr@2
|
468 |
|
williamr@2
|
469 |
/**
|
williamr@2
|
470 |
* Resets the selection state so that there is nothing selected.
|
williamr@2
|
471 |
*
|
williamr@2
|
472 |
* @panic EEikPanicListBoxNoSelIndexArray Panics if selection indexes have
|
williamr@2
|
473 |
* not been defined for this class.
|
williamr@2
|
474 |
*/
|
williamr@2
|
475 |
IMPORT_C void ClearSelection();
|
williamr@2
|
476 |
|
williamr@2
|
477 |
// select/highlight items without moving the cursor
|
williamr@2
|
478 |
/**
|
williamr@2
|
479 |
* Updates item selection.
|
williamr@2
|
480 |
*
|
williamr@2
|
481 |
* @param aSelectionMode The selection mode.
|
williamr@2
|
482 |
*/
|
williamr@2
|
483 |
IMPORT_C virtual void UpdateSelectionL(TSelectionMode aSelectionMode);
|
williamr@2
|
484 |
|
williamr@2
|
485 |
/**
|
williamr@2
|
486 |
* Toggles the selection of an item.
|
williamr@2
|
487 |
*
|
williamr@2
|
488 |
* @param aItemIndex Item to toggle.
|
williamr@2
|
489 |
* @panic EEikPanicListBoxNoSelIndexArray Panics if selection indexes have
|
williamr@2
|
490 |
* not been defined for this class.
|
williamr@2
|
491 |
*/
|
williamr@2
|
492 |
IMPORT_C void ToggleItemL(TInt aItemIndex);
|
williamr@2
|
493 |
|
williamr@2
|
494 |
/**
|
williamr@2
|
495 |
* Selects an item by index.
|
williamr@2
|
496 |
*
|
williamr@2
|
497 |
* This function leaves if memory could not be allocated for an extra item
|
williamr@2
|
498 |
* in the array of selected items.
|
williamr@2
|
499 |
*
|
williamr@2
|
500 |
* @param aItemIndex Item to select.
|
williamr@2
|
501 |
* @panic EEikPanicListBoxNoSelIndexArray Panics if selection indexes have
|
williamr@2
|
502 |
* not been defined for this class.
|
williamr@2
|
503 |
*/
|
williamr@2
|
504 |
IMPORT_C void SelectItemL(TInt aItemIndex);
|
williamr@2
|
505 |
|
williamr@2
|
506 |
/**
|
williamr@2
|
507 |
* Deselects an item by index.
|
williamr@2
|
508 |
*
|
williamr@2
|
509 |
* @param aItemIndex Item to deselect.
|
williamr@2
|
510 |
* @panic EEikPanicListBoxNoSelIndexArray Panics if selection indexes have
|
williamr@2
|
511 |
* not been defined for this class.
|
williamr@2
|
512 |
*/
|
williamr@2
|
513 |
IMPORT_C void DeselectItem(TInt aItemIndex);
|
williamr@2
|
514 |
|
williamr@2
|
515 |
/**
|
williamr@2
|
516 |
* Sets the anchor to the specified item.
|
williamr@2
|
517 |
*
|
williamr@2
|
518 |
* @param aItemIndex The index of the item at which the anchor is set.
|
williamr@2
|
519 |
*/
|
williamr@2
|
520 |
IMPORT_C void SetAnchor(TInt aItemIndex);
|
williamr@2
|
521 |
|
williamr@2
|
522 |
/**
|
williamr@2
|
523 |
* Resets the anchor index, the active end and the @c EAnchorExists flag.
|
williamr@2
|
524 |
*/
|
williamr@2
|
525 |
IMPORT_C void ClearSelectionAnchorAndActiveIndex();
|
williamr@2
|
526 |
|
williamr@2
|
527 |
// functions that support scrolling
|
williamr@2
|
528 |
/**
|
williamr@2
|
529 |
* Scrolls vertically to make a particular item visible.
|
williamr@2
|
530 |
*
|
williamr@2
|
531 |
* @param aItemIndex The item to make visible.
|
williamr@2
|
532 |
* @return @c ETrue if any scrolling was done, @c EFalse if no
|
williamr@2
|
533 |
* scrolling was necessary.
|
williamr@2
|
534 |
*/
|
williamr@2
|
535 |
IMPORT_C virtual TBool ScrollToMakeItemVisible(TInt aItemIndex);
|
williamr@2
|
536 |
|
williamr@2
|
537 |
/**
|
williamr@2
|
538 |
* Sets the index of the item to be the top item.
|
williamr@2
|
539 |
*
|
williamr@2
|
540 |
* @param aNewTopItemIndex The item to scroll to.
|
williamr@2
|
541 |
*/
|
williamr@2
|
542 |
IMPORT_C virtual void VScrollTo(TInt aNewTopItemIndex);
|
williamr@2
|
543 |
|
williamr@2
|
544 |
/**
|
williamr@2
|
545 |
* Sets the index of the item to be the top item.
|
williamr@2
|
546 |
*
|
williamr@2
|
547 |
* This two argument version returns the area which needs redrawing via
|
williamr@2
|
548 |
* @c aMinRedrawRect&. This function does not perform the redraw.
|
williamr@2
|
549 |
*
|
williamr@2
|
550 |
* @param aNewTopItemIndex The distance by which to scroll.
|
williamr@2
|
551 |
* @param aMinRedrawRect On return, the minimum rectangle to redraw.
|
williamr@2
|
552 |
*/
|
williamr@2
|
553 |
IMPORT_C virtual void VScrollTo(TInt aNewTopItemIndex,
|
williamr@2
|
554 |
TRect& aMinRedrawRect);
|
williamr@2
|
555 |
|
williamr@2
|
556 |
/**
|
williamr@2
|
557 |
* Scrolls horizontally by the specified number of pixels.
|
williamr@2
|
558 |
*
|
williamr@2
|
559 |
* @param aHScrollAmount The distance to scroll by in pixels. A negative
|
williamr@2
|
560 |
* value scrolls to the left, a positive value scrolls to the right.
|
williamr@2
|
561 |
*/
|
williamr@2
|
562 |
IMPORT_C virtual void HScroll(TInt aHScrollAmount);
|
williamr@2
|
563 |
|
williamr@2
|
564 |
/**
|
williamr@2
|
565 |
* Gets the offset of the visible portion of the data from the left margin
|
williamr@2
|
566 |
* in pixels.
|
williamr@2
|
567 |
*
|
williamr@2
|
568 |
* @return The horizontal scroll offset in pixels.
|
williamr@2
|
569 |
*/
|
williamr@2
|
570 |
IMPORT_C TInt HScrollOffset() const;
|
williamr@2
|
571 |
|
williamr@2
|
572 |
/**
|
williamr@2
|
573 |
* Sets the horizontal scroll offset in pixels.
|
williamr@2
|
574 |
*
|
williamr@2
|
575 |
* @param aHorizontalOffset New value for the horizontal scroll offset, in
|
williamr@2
|
576 |
* pixels.
|
williamr@2
|
577 |
*/
|
williamr@2
|
578 |
IMPORT_C void SetHScrollOffset(TInt aHorizontalOffset);
|
williamr@2
|
579 |
|
williamr@2
|
580 |
/**
|
williamr@2
|
581 |
* Gets the width of the widest item in the list in pixels.
|
williamr@2
|
582 |
*
|
williamr@2
|
583 |
* @return Data width in pixels.
|
williamr@2
|
584 |
*/
|
williamr@2
|
585 |
IMPORT_C TInt DataWidth() const;
|
williamr@2
|
586 |
|
williamr@2
|
587 |
/**
|
williamr@2
|
588 |
* Recalculates the data width of this list box view from the item width
|
williamr@2
|
589 |
* of its list item drawer. This method is called directly by
|
williamr@2
|
590 |
* @c CEikListBox when the list box’s size changes or when data is added.
|
williamr@2
|
591 |
*/
|
williamr@2
|
592 |
IMPORT_C virtual void CalcDataWidth();
|
williamr@2
|
593 |
|
williamr@2
|
594 |
/**
|
williamr@2
|
595 |
* Gets the visible width of the specified rectangle in pixels. This
|
williamr@2
|
596 |
* function is called by @c CListBoxView itself on its own viewing
|
williamr@2
|
597 |
* rectangle.
|
williamr@2
|
598 |
*
|
williamr@2
|
599 |
* @param aRect The rectangle to get the visible width for.
|
williamr@2
|
600 |
* @return Visible width of @c aRect.
|
williamr@2
|
601 |
*/
|
williamr@2
|
602 |
IMPORT_C virtual TInt VisibleWidth(const TRect& aRect) const;
|
williamr@2
|
603 |
|
williamr@2
|
604 |
/**
|
williamr@2
|
605 |
* Calculates which item should be selected in order to make a
|
williamr@2
|
606 |
* particular item visible. Calling
|
williamr@2
|
607 |
* @c VScrollTo(CalcNewTopItemIndexSoItemIsVisible(idx)), for example,
|
williamr@2
|
608 |
* would make the item whose index is @c idx visible.
|
williamr@2
|
609 |
*
|
williamr@2
|
610 |
* @param aItemIndex The index of the new top item.
|
williamr@2
|
611 |
* @return The item to be selected.
|
williamr@2
|
612 |
*/
|
williamr@2
|
613 |
IMPORT_C virtual TInt CalcNewTopItemIndexSoItemIsVisible(
|
williamr@2
|
614 |
TInt aItemIndex) const;
|
williamr@2
|
615 |
|
williamr@2
|
616 |
// functions that support drawing
|
williamr@2
|
617 |
/**
|
williamr@2
|
618 |
* Draws every visible item into the specified rectangle.
|
williamr@2
|
619 |
*
|
williamr@2
|
620 |
* As implemented in @c CListBoxView, this function's argument is ignored
|
williamr@2
|
621 |
* and the internal viewing rectangle is used. See @c SetViewRect().
|
williamr@2
|
622 |
*
|
williamr@2
|
623 |
* @param aClipRect The rectangle to draw into, this is ignored. Default
|
williamr@2
|
624 |
* value is NULL.
|
williamr@2
|
625 |
* @panic EEikPanicListBoxNoModel Panics if the list box model for this
|
williamr@2
|
626 |
* class has not been defined.
|
williamr@2
|
627 |
*/
|
williamr@2
|
628 |
IMPORT_C virtual void Draw(const TRect* aClipRect = NULL) const;
|
williamr@2
|
629 |
|
williamr@2
|
630 |
/**
|
williamr@2
|
631 |
* Draws the specified item via @c CListBoxDrawer::DrawItem() if it is
|
williamr@2
|
632 |
* visible.
|
williamr@2
|
633 |
*
|
williamr@2
|
634 |
* @param aItemIndex Index number of the item to draw.
|
williamr@2
|
635 |
*/
|
williamr@2
|
636 |
IMPORT_C virtual void DrawItem(TInt aItemIndex) const;
|
williamr@2
|
637 |
|
williamr@2
|
638 |
/**
|
williamr@2
|
639 |
* Sets list box backroung text. This text is visible if the list box
|
williamr@2
|
640 |
* has no items.
|
williamr@2
|
641 |
*
|
williamr@2
|
642 |
* @param aText The text for the empty list box background.
|
williamr@2
|
643 |
*/
|
williamr@2
|
644 |
IMPORT_C void SetListEmptyTextL(const TDesC& aText);
|
williamr@2
|
645 |
|
williamr@2
|
646 |
/**
|
williamr@2
|
647 |
* Gets an empty list box text.
|
williamr@2
|
648 |
*
|
williamr@2
|
649 |
* @return Pointer the empty list box text.
|
williamr@2
|
650 |
*/
|
williamr@2
|
651 |
inline const TDesC* EmptyListText() const;
|
williamr@2
|
652 |
|
williamr@2
|
653 |
/**
|
williamr@2
|
654 |
* Tests whether an item is selected.
|
williamr@2
|
655 |
*
|
williamr@2
|
656 |
* @param aItemIndex Index of item to test.
|
williamr@2
|
657 |
* @return @c ETrue if the item is selected.
|
williamr@2
|
658 |
*/
|
williamr@2
|
659 |
IMPORT_C TBool ItemIsSelected(TInt aItemIndex) const;
|
williamr@2
|
660 |
|
williamr@2
|
661 |
/**
|
williamr@2
|
662 |
* Tests whether an item is visible.
|
williamr@2
|
663 |
*
|
williamr@2
|
664 |
* @param aItemIndex Index of item to be tested.
|
williamr@2
|
665 |
* @return @c ETrue if the item is visible.
|
williamr@2
|
666 |
*/
|
williamr@2
|
667 |
IMPORT_C TBool ItemIsVisible(TInt aItemIndex) const;
|
williamr@2
|
668 |
|
williamr@2
|
669 |
/**
|
williamr@2
|
670 |
* Gets the on-screen position of an item.
|
williamr@2
|
671 |
*
|
williamr@2
|
672 |
* @param aItemIndex Index of an item.
|
williamr@2
|
673 |
* @return Position of the item.
|
williamr@2
|
674 |
*/
|
williamr@2
|
675 |
IMPORT_C virtual TPoint ItemPos(TInt aItemIndex) const;
|
williamr@2
|
676 |
|
williamr@2
|
677 |
/**
|
williamr@2
|
678 |
* Gets the on-screen size of an item.
|
williamr@2
|
679 |
*
|
williamr@2
|
680 |
* As implemented in @c CListBoxView, all items report the same size.
|
williamr@2
|
681 |
* The size returned may be larger than the width of the list box view, but
|
williamr@2
|
682 |
* will not be smaller.
|
williamr@2
|
683 |
*
|
williamr@2
|
684 |
* @param aItemIndex Index of an item. Default value is 0.
|
williamr@2
|
685 |
* @return Size of the item.
|
williamr@2
|
686 |
*/
|
williamr@2
|
687 |
IMPORT_C virtual TSize ItemSize(TInt aItemIndex=0) const;
|
williamr@2
|
688 |
|
williamr@2
|
689 |
/**
|
williamr@2
|
690 |
* Sets the colour in which to display text.
|
williamr@2
|
691 |
*
|
williamr@2
|
692 |
* @param aColor Colour in which to display text.
|
williamr@2
|
693 |
*/
|
williamr@2
|
694 |
IMPORT_C void SetTextColor(TRgb aColor);
|
williamr@2
|
695 |
|
williamr@2
|
696 |
/**
|
williamr@2
|
697 |
* Sets the background colour.
|
williamr@2
|
698 |
*
|
williamr@2
|
699 |
* @param aColor The background colour.
|
williamr@2
|
700 |
*/
|
williamr@2
|
701 |
IMPORT_C void SetBackColor(TRgb aColor);
|
williamr@2
|
702 |
|
williamr@2
|
703 |
/**
|
williamr@2
|
704 |
* Gets the colour in which text is to be displayed.
|
williamr@2
|
705 |
*
|
williamr@2
|
706 |
* @return Current text colour.
|
williamr@2
|
707 |
*/
|
williamr@2
|
708 |
IMPORT_C TRgb TextColor() const;
|
williamr@2
|
709 |
|
williamr@2
|
710 |
/**
|
williamr@2
|
711 |
* Gets the background colour for this view.
|
williamr@2
|
712 |
*
|
williamr@2
|
713 |
* @return The background colour.
|
williamr@2
|
714 |
*/
|
williamr@2
|
715 |
IMPORT_C TRgb BackColor() const;
|
williamr@2
|
716 |
|
williamr@2
|
717 |
/**
|
williamr@2
|
718 |
* Moves the current item cursor in the specified direction. This function
|
williamr@2
|
719 |
* is called by @c CEikListBox in response to user input.
|
williamr@2
|
720 |
*
|
williamr@2
|
721 |
* @param aCursorMovement The cursor movement to apply.
|
williamr@2
|
722 |
* @param aSelectionMode The selection mode of the calling list box.
|
williamr@2
|
723 |
*/
|
williamr@2
|
724 |
IMPORT_C virtual void MoveCursorL(TCursorMovement aCursorMovement,
|
williamr@2
|
725 |
TSelectionMode aSelectionMode);
|
williamr@2
|
726 |
|
williamr@2
|
727 |
/**
|
williamr@2
|
728 |
* Moves to the specified item, sets it as the current item and scrolls the
|
williamr@2
|
729 |
* display to make the item visible.
|
williamr@2
|
730 |
*
|
williamr@2
|
731 |
* @param aTargetItemIndex The index of the item to which to move.
|
williamr@2
|
732 |
* @param aSelectionMode The selection mode.
|
williamr@2
|
733 |
*/
|
williamr@2
|
734 |
IMPORT_C virtual void VerticalMoveToItemL(TInt aTargetItemIndex,
|
williamr@2
|
735 |
TSelectionMode aSelectionMode);
|
williamr@2
|
736 |
|
williamr@2
|
737 |
/**
|
williamr@2
|
738 |
* Converts a pixel position into an item index.
|
williamr@2
|
739 |
*
|
williamr@2
|
740 |
* The function returns @c ETrue and sets @c aItemIndex to the index of the
|
williamr@2
|
741 |
* item whose bounding box contains @c aPosition. Returns @c EFalse if no
|
williamr@2
|
742 |
* such item exists.
|
williamr@2
|
743 |
*
|
williamr@2
|
744 |
* @param aPosition A position relative to the origin of the list box
|
williamr@2
|
745 |
* control.
|
williamr@2
|
746 |
* @param aItemIndex Is set to the item at that position.
|
williamr@2
|
747 |
* @return @c ETrue if there was an item at @c aPosition.
|
williamr@2
|
748 |
*/
|
williamr@2
|
749 |
IMPORT_C virtual TBool XYPosToItemIndex(TPoint aPosition,
|
williamr@2
|
750 |
TInt& aItemIndex) const;
|
williamr@2
|
751 |
|
williamr@2
|
752 |
/**
|
williamr@2
|
753 |
* Gets the number of items that will fit into a given rectangle.
|
williamr@2
|
754 |
*
|
williamr@2
|
755 |
* @param aRect The rectangle.
|
williamr@2
|
756 |
* @return The number of items that will fit into the given rectangle.
|
williamr@2
|
757 |
*/
|
williamr@2
|
758 |
IMPORT_C virtual TInt NumberOfItemsThatFitInRect(const TRect& aRect) const;
|
williamr@2
|
759 |
|
williamr@2
|
760 |
/**
|
williamr@2
|
761 |
* Sets the visibility observer.
|
williamr@2
|
762 |
*
|
williamr@2
|
763 |
* @param aObserver New visibility observer for this control.
|
williamr@2
|
764 |
*/
|
williamr@2
|
765 |
void SetVisibilityObserver(MListVisibilityObserver* aObserver);
|
williamr@2
|
766 |
|
williamr@2
|
767 |
/**
|
williamr@2
|
768 |
* Tests if this view is visible.
|
williamr@2
|
769 |
*
|
williamr@2
|
770 |
* @return @c ETrue if this view is visible. @c EFalse if this view
|
williamr@2
|
771 |
* is not visible or does not exist.
|
williamr@2
|
772 |
*/
|
williamr@2
|
773 |
IMPORT_C TBool IsVisible() const;
|
williamr@2
|
774 |
|
williamr@2
|
775 |
/**
|
williamr@2
|
776 |
* Gets the object used by this list box view to draw its items.
|
williamr@2
|
777 |
*
|
williamr@2
|
778 |
* @return Pointer to the list box item drawer.
|
williamr@2
|
779 |
*/
|
williamr@2
|
780 |
inline CListItemDrawer* ItemDrawer() const;
|
williamr@2
|
781 |
|
williamr@2
|
782 |
/**
|
williamr@2
|
783 |
* Not implemented.
|
williamr@2
|
784 |
*
|
williamr@2
|
785 |
* @param aClientRect Not used.
|
williamr@2
|
786 |
*/
|
williamr@2
|
787 |
IMPORT_C virtual void DrawEmptyList(const TRect &aClientRect) const;
|
williamr@2
|
788 |
|
williamr@2
|
789 |
// disables vertical line drawing, useful only for certain
|
williamr@2
|
790 |
//custom list boxes
|
williamr@2
|
791 |
/**
|
williamr@2
|
792 |
* Disables vertical line drawing.
|
williamr@2
|
793 |
*
|
williamr@2
|
794 |
* @param aDisable @c ETrue if disabled.
|
williamr@2
|
795 |
*/
|
williamr@2
|
796 |
void DisableVerticalLineDrawing( TBool aDisable );
|
williamr@2
|
797 |
|
williamr@2
|
798 |
/**
|
williamr@2
|
799 |
* Deselects range between given indexes.
|
williamr@2
|
800 |
*
|
williamr@2
|
801 |
* @deprecated
|
williamr@2
|
802 |
* @param aItemIndex1 First index of selectable range.
|
williamr@2
|
803 |
* @param aItemIndex2 Second index of selectable range.
|
williamr@2
|
804 |
*/
|
williamr@2
|
805 |
IMPORT_C void DeselectRangeL(TInt aItemIndex1, TInt aItemIndex2);
|
williamr@2
|
806 |
|
williamr@2
|
807 |
/**
|
williamr@2
|
808 |
* Sets the offset for view.
|
williamr@2
|
809 |
*
|
williamr@2
|
810 |
* @internal
|
williamr@2
|
811 |
* @param aOffset Offset in pixels.
|
williamr@2
|
812 |
*/
|
williamr@2
|
813 |
IMPORT_C void SetItemOffsetInPixels(TInt aOffset);
|
williamr@2
|
814 |
|
williamr@2
|
815 |
/**
|
williamr@2
|
816 |
* Gets view offset.
|
williamr@2
|
817 |
*
|
williamr@2
|
818 |
* @internal
|
williamr@2
|
819 |
* @return View's offset.
|
williamr@2
|
820 |
*/
|
williamr@2
|
821 |
IMPORT_C TInt ItemOffsetInPixels() const;
|
williamr@2
|
822 |
|
williamr@2
|
823 |
/**
|
williamr@2
|
824 |
* Sets scrolling state.
|
williamr@2
|
825 |
*
|
williamr@2
|
826 |
* @internal
|
williamr@2
|
827 |
*/
|
williamr@2
|
828 |
void SetScrolling( TBool aIsScrolling );
|
williamr@2
|
829 |
|
williamr@2
|
830 |
/**
|
williamr@2
|
831 |
* Returns item's height. All items have the same height.
|
williamr@2
|
832 |
*
|
williamr@2
|
833 |
* @internal
|
williamr@2
|
834 |
* @return Item height.
|
williamr@2
|
835 |
*/
|
williamr@2
|
836 |
TInt ItemHeight() const { return iItemHeight; }
|
williamr@2
|
837 |
|
williamr@2
|
838 |
/**
|
williamr@2
|
839 |
* Tests whether an item is partially visible.
|
williamr@2
|
840 |
* Note that this returns @c EFalse also when item is fully visible,
|
williamr@2
|
841 |
* i.e. the whole item area is inside the list view rectangle.
|
williamr@2
|
842 |
*
|
williamr@2
|
843 |
* @param aItemIndex Index of item to be tested.
|
williamr@2
|
844 |
*
|
williamr@2
|
845 |
* @return @c ETrue if the item is partially visible,
|
williamr@2
|
846 |
* @c EFalse if it's not visible or fully visible.
|
williamr@2
|
847 |
*/
|
williamr@2
|
848 |
IMPORT_C TBool ItemIsPartiallyVisible( TInt aItemIndex ) const;
|
williamr@2
|
849 |
|
williamr@2
|
850 |
protected:
|
williamr@2
|
851 |
|
williamr@2
|
852 |
// functions for accessing the flags
|
williamr@2
|
853 |
/**
|
williamr@2
|
854 |
* Gets this view’s flags.
|
williamr@2
|
855 |
*
|
williamr@2
|
856 |
* These flags are defined by the nested enum @c TFlags (below).
|
williamr@2
|
857 |
*
|
williamr@2
|
858 |
* @return List box's flags.
|
williamr@2
|
859 |
*/
|
williamr@2
|
860 |
inline TInt Flags() const;
|
williamr@2
|
861 |
|
williamr@2
|
862 |
/**
|
williamr@2
|
863 |
* Sets this view’s flags according to a bitmask.
|
williamr@2
|
864 |
*
|
williamr@2
|
865 |
* These flags are defined by the nested enum @c TFlags (below).
|
williamr@2
|
866 |
*
|
williamr@2
|
867 |
* @param aMask Sets new flags for the list box.
|
williamr@2
|
868 |
*/
|
williamr@2
|
869 |
inline void SetFlags(TInt aMask);
|
williamr@2
|
870 |
|
williamr@2
|
871 |
/**
|
williamr@2
|
872 |
* Clears this view’s flags according to a bitmask.
|
williamr@2
|
873 |
*
|
williamr@2
|
874 |
* These flags are defined by the nested enum @c TFlags (below).
|
williamr@2
|
875 |
*
|
williamr@2
|
876 |
* @param aMask Flags to be removed.
|
williamr@2
|
877 |
*/
|
williamr@2
|
878 |
inline void ClearFlags(TInt aMask);
|
williamr@2
|
879 |
|
williamr@2
|
880 |
/**
|
williamr@2
|
881 |
* List box base class.
|
williamr@2
|
882 |
* To access @c SetFlags()/ClearFlags().
|
williamr@2
|
883 |
*/
|
williamr@2
|
884 |
friend class CEikListBox;
|
williamr@2
|
885 |
|
williamr@2
|
886 |
// misc. functions
|
williamr@2
|
887 |
/**
|
williamr@2
|
888 |
* Selects items between given indexes.
|
williamr@2
|
889 |
*
|
williamr@2
|
890 |
* @deprecated
|
williamr@2
|
891 |
* @param aItemIndex1 First index of selectable range.
|
williamr@2
|
892 |
* @param aItemIndex2 Second index of selectable range.
|
williamr@2
|
893 |
*/
|
williamr@2
|
894 |
IMPORT_C void SelectRangeL(TInt aItemIndex1, TInt aItemIndex2);
|
williamr@2
|
895 |
|
williamr@2
|
896 |
private:
|
williamr@2
|
897 |
/**
|
williamr@2
|
898 |
* Set item index directly.
|
williamr@2
|
899 |
* For CEikListBox.
|
williamr@2
|
900 |
* @param aItemIndex New item index.
|
williamr@2
|
901 |
*/
|
williamr@2
|
902 |
void SetItemIndex( TInt aItemIndex );
|
williamr@2
|
903 |
|
williamr@2
|
904 |
protected:
|
williamr@2
|
905 |
|
williamr@2
|
906 |
/**
|
williamr@2
|
907 |
* The flags for this list box. These flags are defined by the nested enum
|
williamr@2
|
908 |
* @c TFlags (below).
|
williamr@2
|
909 |
*/
|
williamr@2
|
910 |
TInt iFlags;
|
williamr@2
|
911 |
|
williamr@2
|
912 |
/**
|
williamr@2
|
913 |
* This view’s item drawer.
|
williamr@2
|
914 |
* Not owned.
|
williamr@2
|
915 |
*/
|
williamr@2
|
916 |
CListItemDrawer* iItemDrawer;
|
williamr@2
|
917 |
|
williamr@2
|
918 |
/**
|
williamr@2
|
919 |
* This view’s model.
|
williamr@2
|
920 |
* Not owned.
|
williamr@2
|
921 |
*/
|
williamr@2
|
922 |
MListBoxModel* iModel;
|
williamr@2
|
923 |
|
williamr@2
|
924 |
/**
|
williamr@2
|
925 |
* Width (in pixels) of the longest item in the model.
|
williamr@2
|
926 |
*/
|
williamr@2
|
927 |
TInt iDataWidth;
|
williamr@2
|
928 |
|
williamr@2
|
929 |
/**
|
williamr@2
|
930 |
* Index of the item at the top of the view. This is not necessarily the
|
williamr@2
|
931 |
* item at the start of the list.
|
williamr@2
|
932 |
*/
|
williamr@2
|
933 |
TInt iTopItemIndex;
|
williamr@2
|
934 |
|
williamr@2
|
935 |
/**
|
williamr@2
|
936 |
* Index of the item at the bottom of the view. This is not necessarily the
|
williamr@2
|
937 |
* item at the end of the list.
|
williamr@2
|
938 |
*/
|
williamr@2
|
939 |
TInt iBottomItemIndex;
|
williamr@2
|
940 |
|
williamr@2
|
941 |
/**
|
williamr@2
|
942 |
* Pixel offset of the visible portion of the data from the left margin.
|
williamr@2
|
943 |
*/
|
williamr@2
|
944 |
TInt iHScrollOffset;
|
williamr@2
|
945 |
|
williamr@2
|
946 |
/**
|
williamr@2
|
947 |
* Index of the current item.
|
williamr@2
|
948 |
*/
|
williamr@2
|
949 |
TInt iCurrentItemIndex;
|
williamr@2
|
950 |
|
williamr@2
|
951 |
/**
|
williamr@2
|
952 |
* Height of each item in the list in pixels.
|
williamr@2
|
953 |
*/
|
williamr@2
|
954 |
TInt iItemHeight;
|
williamr@2
|
955 |
|
williamr@2
|
956 |
/**
|
williamr@2
|
957 |
* This list box view’s window.
|
williamr@2
|
958 |
*/
|
williamr@2
|
959 |
RWindow* iWin;
|
williamr@2
|
960 |
|
williamr@2
|
961 |
/**
|
williamr@2
|
962 |
* The window group of this view.
|
williamr@2
|
963 |
*/
|
williamr@2
|
964 |
RWindowGroup* iGroupWin;
|
williamr@2
|
965 |
|
williamr@2
|
966 |
/**
|
williamr@2
|
967 |
* Graphics context for the control.
|
williamr@2
|
968 |
*/
|
williamr@2
|
969 |
CWindowGc* iGc;
|
williamr@2
|
970 |
|
williamr@2
|
971 |
/**
|
williamr@2
|
972 |
* Graphics context for the control.
|
williamr@2
|
973 |
*/
|
williamr@2
|
974 |
TRect iViewRect;
|
williamr@2
|
975 |
|
williamr@2
|
976 |
/**
|
williamr@2
|
977 |
* The empty list text.
|
williamr@2
|
978 |
*/
|
williamr@2
|
979 |
HBufC *iListEmptyText;
|
williamr@2
|
980 |
|
williamr@2
|
981 |
/**
|
williamr@2
|
982 |
* Indicates whether vertical line drawing is disabled.
|
williamr@2
|
983 |
*/
|
williamr@2
|
984 |
TBool iDisableVerticalLineDrawing /*TInt iSpare*/;
|
williamr@2
|
985 |
|
williamr@2
|
986 |
private:
|
williamr@2
|
987 |
TInt iMatcherCursorPos;
|
williamr@2
|
988 |
TRgb iMatcherCursorColor;
|
williamr@2
|
989 |
TRgb iBackColor;
|
williamr@2
|
990 |
TRgb iTextColor;
|
williamr@2
|
991 |
TInt iAnchorIndex;
|
williamr@2
|
992 |
TInt iActiveEndIndex;
|
williamr@2
|
993 |
CSelectionIndexArray* iSelectionIndexes;
|
williamr@2
|
994 |
MListVisibilityObserver* iVisibilityObserver;
|
williamr@2
|
995 |
protected:
|
williamr@2
|
996 |
/**
|
williamr@2
|
997 |
* Current vertical offset of the view in pixels.
|
williamr@2
|
998 |
*/
|
williamr@2
|
999 |
TInt iVerticalOffset;
|
williamr@2
|
1000 |
|
williamr@2
|
1001 |
CListBoxViewExtension* iExtension;
|
williamr@2
|
1002 |
TInt iSpare[4];
|
williamr@2
|
1003 |
};
|
williamr@2
|
1004 |
|
williamr@2
|
1005 |
NONSHARABLE_CLASS( CListBoxViewExtension ) : public CBase
|
williamr@2
|
1006 |
{
|
williamr@2
|
1007 |
public:
|
williamr@2
|
1008 |
static CListBoxViewExtension* NewL();
|
williamr@2
|
1009 |
|
williamr@2
|
1010 |
~CListBoxViewExtension();
|
williamr@2
|
1011 |
|
williamr@2
|
1012 |
private:
|
williamr@2
|
1013 |
void ConstructL();
|
williamr@2
|
1014 |
|
williamr@2
|
1015 |
public:
|
williamr@2
|
1016 |
CEikListBox* iListBox;
|
williamr@2
|
1017 |
TBool iScrolling;
|
williamr@2
|
1018 |
TBool iScrollingDisabled;
|
williamr@2
|
1019 |
};
|
williamr@2
|
1020 |
|
williamr@2
|
1021 |
|
williamr@2
|
1022 |
/**
|
williamr@2
|
1023 |
* Return text currently in the empty list text
|
williamr@2
|
1024 |
*/
|
williamr@2
|
1025 |
inline const TDesC* CListBoxView::EmptyListText() const
|
williamr@2
|
1026 |
{ return(iListEmptyText); }
|
williamr@2
|
1027 |
|
williamr@2
|
1028 |
|
williamr@2
|
1029 |
class CSnakingListBoxView : public CListBoxView
|
williamr@2
|
1030 |
{
|
williamr@2
|
1031 |
public:
|
williamr@2
|
1032 |
IMPORT_C ~CSnakingListBoxView();
|
williamr@2
|
1033 |
IMPORT_C CSnakingListBoxView();
|
williamr@2
|
1034 |
inline TInt ColumnWidth() const;
|
williamr@2
|
1035 |
IMPORT_C void SetColumnWidth(TInt aColumnWidth);
|
williamr@2
|
1036 |
IMPORT_C virtual void MoveCursorL(TCursorMovement aCursorMovement, TSelectionMode aSelectionMode);
|
williamr@2
|
1037 |
IMPORT_C virtual void SetTopItemIndex(TInt aItemIndex);
|
williamr@2
|
1038 |
IMPORT_C virtual void SetItemHeight(TInt aItemHeight);
|
williamr@2
|
1039 |
IMPORT_C virtual TBool XYPosToItemIndex(TPoint aPosition, TInt& aItemIndex) const;
|
williamr@2
|
1040 |
IMPORT_C virtual TInt NumberOfItemsThatFitInRect(const TRect& aRect) const;
|
williamr@2
|
1041 |
IMPORT_C virtual void HScroll(TInt aHScrollAmount);
|
williamr@2
|
1042 |
IMPORT_C virtual void CalcDataWidth();
|
williamr@2
|
1043 |
IMPORT_C virtual void CalcBottomItemIndex();
|
williamr@2
|
1044 |
IMPORT_C virtual void Draw(const TRect* aClipRect = NULL) const;
|
williamr@2
|
1045 |
IMPORT_C virtual TInt VisibleWidth(const TRect& aRect) const;
|
williamr@2
|
1046 |
IMPORT_C virtual TBool ScrollToMakeItemVisible(TInt aItemIndex);
|
williamr@2
|
1047 |
IMPORT_C virtual TInt CalculateHScrollOffsetSoItemIsVisible(TInt aItemIndex);
|
williamr@2
|
1048 |
IMPORT_C virtual TInt CalcNewTopItemIndexSoItemIsVisible(TInt aItemIndex) const;
|
williamr@2
|
1049 |
IMPORT_C virtual TPoint ItemPos(TInt aItemIndex) const;
|
williamr@2
|
1050 |
IMPORT_C virtual TSize ItemSize(TInt aItemIndex=0) const;
|
williamr@2
|
1051 |
IMPORT_C void CalcRowAndColIndexesFromItemIndex(TInt aItemIndex, TInt& aRowIndex, TInt& aColIndex) const;
|
williamr@2
|
1052 |
IMPORT_C void CalcItemIndexFromRowAndColIndexes(TInt& aItemIndex, TInt aRowIndex, TInt aColIndex) const;
|
williamr@2
|
1053 |
IMPORT_C virtual TInt NumberOfItemsPerColumn() const;
|
williamr@2
|
1054 |
protected:
|
williamr@2
|
1055 |
IMPORT_C virtual void DrawItemRange(TInt aStartItemIndex, TInt aEndItemIndex) const;
|
williamr@2
|
1056 |
IMPORT_C void DrawColumnRange(TInt aStartColIndex, TInt aEndColIndex) const;
|
williamr@2
|
1057 |
IMPORT_C void MoveToPreviousColumnL(TSelectionMode aSelectionMode);
|
williamr@2
|
1058 |
IMPORT_C void MoveToNextColumnL(TSelectionMode aSelectionMode);
|
williamr@2
|
1059 |
IMPORT_C void ClearUnusedItemSpace(TInt aStartItemIndex, TInt aEndItemIndex) const;
|
williamr@2
|
1060 |
IMPORT_C void UpdateHScrollOffsetBasedOnTopItemIndex();
|
williamr@2
|
1061 |
private: // overridden from CListBoxView
|
williamr@2
|
1062 |
IMPORT_C virtual TAny* Reserved_1();
|
williamr@2
|
1063 |
protected:
|
williamr@2
|
1064 |
TInt iColumnWidth;
|
williamr@2
|
1065 |
};
|
williamr@2
|
1066 |
|
williamr@2
|
1067 |
|
williamr@2
|
1068 |
|
williamr@2
|
1069 |
inline TInt CListBoxView::Flags() const
|
williamr@2
|
1070 |
{ return iFlags; }
|
williamr@2
|
1071 |
|
williamr@2
|
1072 |
inline void CListBoxView::SetFlags(TInt aMask)
|
williamr@2
|
1073 |
{ iFlags|=aMask; }
|
williamr@2
|
1074 |
|
williamr@2
|
1075 |
inline void CListBoxView::ClearFlags(TInt aMask)
|
williamr@2
|
1076 |
{ iFlags&=(~aMask); }
|
williamr@2
|
1077 |
|
williamr@2
|
1078 |
inline CListItemDrawer* CListBoxView::ItemDrawer() const
|
williamr@2
|
1079 |
{ return iItemDrawer; }
|
williamr@2
|
1080 |
|
williamr@2
|
1081 |
inline TInt CSnakingListBoxView::ColumnWidth() const
|
williamr@2
|
1082 |
{ return iColumnWidth; }
|
williamr@2
|
1083 |
|
williamr@2
|
1084 |
|
williamr@2
|
1085 |
#endif // __EIKLBV_H__
|