|
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 "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: CLandmarkCategoryIterable class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __CLANDMARKDATABASEITERABLE_H__ |
|
20 #define __CLANDMARKDATABASEITERABLE_H__ |
|
21 |
|
22 //INCLUDES |
|
23 #include <liwvariant.h> |
|
24 |
|
25 /** |
|
26 * CDatabaseIterable |
|
27 * This class inherits from CLiwIterable and implements the Reset() and |
|
28 * NextL(TLiwVariant& aEntry) functions. This class is used to iterate through |
|
29 * a list of databases. |
|
30 */ |
|
31 // CLASS DECLARATION |
|
32 NONSHARABLE_CLASS(CDatabaseIterable): public CLiwIterable |
|
33 { |
|
34 public://New Methods |
|
35 |
|
36 /** |
|
37 * NewL. |
|
38 * Two-phased constructor. |
|
39 * Create a CDatabaseIterable object. |
|
40 * @param aDbList The list of databases to be iterated. |
|
41 * @return A pointer to the created instance of CDatabaseIterable. |
|
42 */ |
|
43 static CDatabaseIterable* NewL( CDesCArray* aDbList ); |
|
44 |
|
45 /** |
|
46 * ~CDatabaseIterator |
|
47 * Destructor. |
|
48 */ |
|
49 ~CDatabaseIterable(); |
|
50 |
|
51 private: |
|
52 |
|
53 /** |
|
54 * ConstructL |
|
55 * 2nd phase constructor. |
|
56 * Perform the second phase construction of a |
|
57 * CDatabaseIterable object. |
|
58 */ |
|
59 void ConstructL(); |
|
60 |
|
61 /** |
|
62 * CDatabaseIterable. |
|
63 * C++ default constructor. |
|
64 * @param aDbList The list of databases to be iterated. |
|
65 */ |
|
66 CDatabaseIterable( CDesCArray* aDbList ); |
|
67 |
|
68 protected: |
|
69 |
|
70 // Resets the iterator. |
|
71 void Reset(); |
|
72 |
|
73 // Iterates over the collection entries to fetch the next data element. |
|
74 TBool NextL(TLiwVariant& aEntry); |
|
75 |
|
76 private: |
|
77 |
|
78 /** |
|
79 * iDbManager |
|
80 * The handle to the CPosLmDatabaseManager. |
|
81 */ |
|
82 CPosLmDatabaseManager* iDbManager; |
|
83 |
|
84 /** |
|
85 * iDatabaseList |
|
86 * The handle to the CDesCArray database array. |
|
87 */ |
|
88 CDesCArray* iDatabaseList; |
|
89 |
|
90 /** |
|
91 * iIndex |
|
92 * This holds the index of the current database to which the iterable is pointing. |
|
93 */ |
|
94 TInt iIndex; |
|
95 |
|
96 /** |
|
97 * iCount |
|
98 * This holds the count of the total databases in the list. |
|
99 */ |
|
100 TInt iCount; |
|
101 }; |
|
102 |
|
103 #endif //__CLANDMARKDATABASEITERABLE_H__ |