1 epos_cposlmitemiterator.h |
1 /* |
|
2 * Copyright (c) 2005-2006 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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: CPosLmItemIterator class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPOSLMITEMITERATOR_H |
|
20 #define CPOSLMITEMITERATOR_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include "EPos_Landmarks.h" |
|
24 |
|
25 /** |
|
26 * Landmark item iterator. |
|
27 * |
|
28 * This is an abstract base class for objects which iterates a set of database |
|
29 * items in a single database. |
|
30 * |
|
31 * A database item is an item which is stored in a landmark database, i.e. a |
|
32 * landmark or a landmark category. |
|
33 * |
|
34 * Note that an iterator either iterates categories or landmarks. The items are |
|
35 * never mixed. |
|
36 * |
|
37 * This class does not export a constructor. The instance is created by the |
|
38 * operation which generates the item set to be iterated. The iterator may |
|
39 * implement a caching scheme, but that scheme depends on what is iterated. |
|
40 * |
|
41 * @lib eposlandmarks.lib |
|
42 * @since S60 3.0 |
|
43 */ |
|
44 class CPosLmItemIterator : public CBase |
|
45 { |
|
46 public: |
|
47 |
|
48 /** |
|
49 * Destructor. |
|
50 */ |
|
51 IMPORT_C virtual ~CPosLmItemIterator(); |
|
52 |
|
53 public: |
|
54 |
|
55 /** |
|
56 * Returns the next database item ID in the iterated set. |
|
57 * |
|
58 * The first call will return the first database item ID in the set. |
|
59 * |
|
60 * @return The next database item ID, or @p KPosLmNullItemId if there |
|
61 * are no more database items in the iterated set. |
|
62 */ |
|
63 virtual TPosLmItemId NextL() = 0; |
|
64 |
|
65 /** |
|
66 * Resets the database item iterator. |
|
67 * |
|
68 * The next call to @ref NextL will return the first database item ID in |
|
69 * the iterated set. |
|
70 */ |
|
71 virtual void Reset() = 0; |
|
72 |
|
73 /** |
|
74 * Returns the number of database items which are iterated. |
|
75 * |
|
76 * @return Number of items in the iterated database item set. |
|
77 */ |
|
78 virtual TUint NumOfItemsL() = 0; |
|
79 |
|
80 /** |
|
81 * Fetches a sequence of database items from the iterated set. |
|
82 * |
|
83 * The client supplies an ID array which will be filled by this |
|
84 * operation. The array will be reset before any items are added. |
|
85 * |
|
86 * The client specifies which database item sequence to fetch by |
|
87 * supplying a start index (0 is the first item) and the number of items |
|
88 * to fetch. |
|
89 * |
|
90 * @param[out] aIdArray On return contains the requested items. |
|
91 * @param[in] aStartIndex The index of the first item to fetch. |
|
92 * @param[in] aNumOfItems The number of items to fetch |
|
93 * |
|
94 * @panic "Landmarks Client"-EPosSpecifiedIntervalLiesOutsideIteratedSet |
|
95 * specified interval lies [partially] outside the iterated set. |
|
96 */ |
|
97 virtual void GetItemIdsL( |
|
98 RArray<TPosLmItemId>& aIdArray, |
|
99 TInt aStartIndex, |
|
100 TInt aNumOfItems |
|
101 ) = 0; |
|
102 |
|
103 protected: |
|
104 |
|
105 // C++ constructor. |
|
106 IMPORT_C CPosLmItemIterator(); |
|
107 |
|
108 private: |
|
109 |
|
110 // Prohibit copy constructor |
|
111 CPosLmItemIterator( const CPosLmItemIterator& ); |
|
112 // Prohibit assigment operator |
|
113 CPosLmItemIterator& operator= ( const CPosLmItemIterator& ); |
|
114 |
|
115 }; |
|
116 |
|
117 #endif // CPOSLMITEMITERATOR_H |
|
118 |
|
119 |