|
1 /* |
|
2 * Copyright (c) 2008-2009 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: List utilities |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __GLXLISTUTILS_H__ |
|
22 #define __GLXLISTUTILS_H__ |
|
23 |
|
24 #include <e32std.h> |
|
25 |
|
26 // constants |
|
27 const TUint KGlxDefaultVisibleItemsGranularity = 15; |
|
28 const TUint KGlxQHDVisibleItemsGranularity = 20; |
|
29 const TUint KGlxVGAVisibleItemsGranularity = 21; |
|
30 |
|
31 /** |
|
32 * GlxListUtils |
|
33 * |
|
34 * @author Aki Vanhatalo |
|
35 * |
|
36 * @internal reviewed 16/07/2007 by Kimmo Hoikka |
|
37 */ |
|
38 class GlxListUtils |
|
39 { |
|
40 public: |
|
41 /** |
|
42 * Normalises index in a loop into the range. If aIndex is outside the |
|
43 * list indexes (i.e., 0 and list size), this function "loops the list" |
|
44 * to return the correct index normalised to inside the list. |
|
45 * This function must not be called if the list is empty. |
|
46 * @param aIndex Index to normalise |
|
47 * @param aListLength Length of the list |
|
48 */ |
|
49 static TInt NormalizedIndex( TInt aIndex, TInt aListLength ); |
|
50 |
|
51 /** |
|
52 * Returns Visible items granularity based on feature |
|
53 * layout (i.e., qHD, VGA) |
|
54 * @return TInt visible items granularity / count |
|
55 */ |
|
56 static TInt VisibleItemsGranularityL(); |
|
57 }; |
|
58 |
|
59 #endif // __GLXLISTUTILS_H__ |
|
60 |