author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 17 Dec 2009 09:09:50 +0200 | |
changeset 26 | 5d0ec8b709be |
parent 5 | 989d2f495d90 |
permissions | -rw-r--r-- |
5 | 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: CLandmarkManageHandlers class |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#ifndef __CLANDMARKMANAGEHANDLERS_H__ |
|
20 |
#define __CLANDMARKMANAGEHANDLERS_H__ |
|
21 |
||
22 |
// INCLUDES |
|
23 |
#include <e32base.h> |
|
24 |
#include <e32cmn.h> |
|
25 |
||
26 |
//FORWARD DECLARARTION |
|
27 |
class CPosLandmarkDatabase; |
|
28 |
class CPosLmCategoryManager; |
|
29 |
class CPosLandmarkSearch; |
|
30 |
class CLandmarkHandler; |
|
31 |
||
32 |
/** |
|
33 |
* CLandmarkManageHandlers |
|
34 |
* This class maintains a list of handles to different databases. |
|
35 |
*/ |
|
36 |
// CLASS DECLARATION |
|
37 |
NONSHARABLE_CLASS(CLandmarkManageHandlers): public CBase |
|
38 |
{ |
|
39 |
public: // New methods |
|
40 |
||
41 |
/** |
|
42 |
* NewL. |
|
43 |
* Two-phased constructor. |
|
44 |
* Create a CPosLmManageHandle object. |
|
45 |
* @return A pointer to the newly created instance of CLandmarkManageHandlers. |
|
46 |
*/ |
|
47 |
static CLandmarkManageHandlers* NewL(); |
|
48 |
||
49 |
/** |
|
50 |
* ~CPosLmManageHandle |
|
51 |
* Destructor. |
|
52 |
*/ |
|
53 |
~CLandmarkManageHandlers(); |
|
54 |
||
55 |
public: // Functions to create, return and destroy handle |
|
56 |
||
57 |
/** |
|
58 |
* CreateHandlerL |
|
59 |
* This creates and returns CLandmarkHandler instance. |
|
60 |
* @param aDatabaseUri The URI of the database to be opened. |
|
61 |
* @return A pointer to the newly created instance of CLandmarkHandler. |
|
62 |
*/ |
|
63 |
CLandmarkHandler* CreateHandlerL( const TDesC& aDatabaseUri ); |
|
64 |
||
65 |
/** |
|
66 |
* GetHandlerL |
|
67 |
* This returns CLandmarkHandler instance. |
|
68 |
* @param aDatabaseUri The URI of the database to be opened. |
|
69 |
* @return A pointer to an existing instance of CLandmarkHandler. |
|
70 |
*/ |
|
71 |
CLandmarkHandler* GetHandlerL( const TDesC& aDatabaseUri ); |
|
72 |
||
73 |
/** |
|
74 |
* CloseHandler |
|
75 |
* This destroys CLandmarkHandler instance. |
|
76 |
* @param aHandler The CLandmarkHandler instance to be destroyed. |
|
77 |
*/ |
|
78 |
void CloseHandler( CLandmarkHandler* aHandler ); |
|
79 |
||
80 |
/** |
|
81 |
* SetDefaultHandler |
|
82 |
* This changes the default handle managed by this class. |
|
83 |
* @param aHandler The CLandmarkHandler instance to be set as default. |
|
84 |
*/ |
|
85 |
void SetDefaultHandler( CLandmarkHandler* aHandler ); |
|
86 |
||
87 |
private: // Constructors |
|
88 |
||
89 |
/** |
|
90 |
* CLandmarkManageHandlers. |
|
91 |
* C++ default constructor. |
|
92 |
*/ |
|
93 |
CLandmarkManageHandlers(); |
|
94 |
||
95 |
private: // Data members |
|
96 |
||
97 |
/** |
|
98 |
* iHandlers |
|
99 |
* Array of CLandmarkHandler instances to all open databases. |
|
100 |
*/ |
|
101 |
RPointerArray <CLandmarkHandler> iHandlers; |
|
102 |
||
103 |
/** |
|
104 |
* iDefaultHandler |
|
105 |
* CLandmarkHandler instance to the default database. |
|
106 |
*/ |
|
107 |
CLandmarkHandler* iDefaultHandler; |
|
108 |
}; |
|
109 |
||
110 |
/** |
|
111 |
* CLandmarkHandler |
|
112 |
* This class maintains a handle to an open database as well as the CPosLmCategoryManager |
|
113 |
* handle and CPosLandmarkSearch handle associated with the CPosLandmarkDatabase |
|
114 |
* database. |
|
115 |
*/ |
|
116 |
// CLASS DECLARATION |
|
117 |
NONSHARABLE_CLASS(CLandmarkHandler): public CBase |
|
118 |
{ |
|
119 |
public: // New methods |
|
120 |
||
121 |
/** |
|
122 |
* CreateL. |
|
123 |
* Two-phased constructor. |
|
124 |
* Create a CLandmarkHandler object. |
|
125 |
* @param aDatabaseUri The URI of the database to be opened. |
|
126 |
* @return A pointer to the created instance of CLandmarkHandler. |
|
127 |
*/ |
|
128 |
static CLandmarkHandler* CreateL( const TDesC& aDatabaseUri ); |
|
129 |
||
26
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
130 |
|
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
131 |
TInt DecRef(); |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
132 |
|
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
133 |
void IncRef(); |
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
134 |
|
5 | 135 |
/** |
136 |
* ~CLandmarkHandler |
|
137 |
* Destructor. |
|
138 |
*/ |
|
139 |
~CLandmarkHandler(); |
|
140 |
||
141 |
public: // Functions to retrieve data members |
|
142 |
||
143 |
/** |
|
144 |
* LandmarkDatabaseHandle. |
|
145 |
* @return The handle to CPosLandmarkDatabase instance. |
|
146 |
*/ |
|
147 |
inline CPosLandmarkDatabase* LandmarkDatabaseHandle (); |
|
148 |
||
149 |
/** |
|
150 |
* CategoryManagerHandle. |
|
151 |
* @return The handle to CPosLmCategoryManager instance. |
|
152 |
*/ |
|
153 |
inline CPosLmCategoryManager* CategoryManagerHandle (); |
|
154 |
||
155 |
/** |
|
156 |
* LandmarkSearchHandle. |
|
157 |
* @return The handle to CPosLandmarkSearch instance. |
|
158 |
*/ |
|
159 |
inline CPosLandmarkSearch* LandmarkSearchHandle (); |
|
160 |
||
161 |
/** |
|
162 |
* GetDatabaseUri. |
|
163 |
* @param aDatabaseUri The URI of the open CPosLandmarkDatabase. |
|
164 |
*/ |
|
165 |
inline void GetDatabaseUri( TPtrC& aDatabaseUri ) const; |
|
166 |
||
167 |
/** |
|
168 |
* InitL. |
|
169 |
* This initializes the CPosLandmarkDatabase if required. |
|
170 |
*/ |
|
171 |
void InitL(); |
|
172 |
||
173 |
private: // Constructors |
|
174 |
||
175 |
/** |
|
176 |
* ConstructL |
|
177 |
* 2nd phase constructor. |
|
178 |
* Perform the second phase construction of a |
|
179 |
* CLandmarkHandler object. |
|
180 |
* @param aDatabaseUri The URI of the CPosLandmarkDatabase to be opened. |
|
181 |
*/ |
|
182 |
void ConstructL(const TDesC& aDatabaseUri); |
|
183 |
||
184 |
/** |
|
185 |
* CLandmarkHandler. |
|
186 |
* C++ default constructor. |
|
187 |
*/ |
|
188 |
CLandmarkHandler(); |
|
189 |
||
190 |
private: // Data members |
|
191 |
||
192 |
/** |
|
193 |
* iDatabaseUri |
|
194 |
* The URI of the open CPosLandmarkDatabase. |
|
195 |
*/ |
|
196 |
HBufC* iDatabaseUri; |
|
197 |
||
198 |
/** |
|
199 |
* iLandmarkDatabaseHandle |
|
200 |
* The handle to the open CPosLandmarkDatabase. |
|
201 |
*/ |
|
202 |
CPosLandmarkDatabase* iLandmarkDatabaseHandle; |
|
203 |
||
204 |
/** |
|
205 |
* iLmCategoryManagerHandle |
|
206 |
* The handle to the CPosLmCategoryManager of the database. |
|
207 |
*/ |
|
208 |
CPosLmCategoryManager* iLmCategoryManagerHandle; |
|
209 |
||
210 |
/** |
|
211 |
* iLandmarkSearchHandle |
|
212 |
* The handle to the CPosLandmarkSearch of the database. |
|
213 |
*/ |
|
214 |
CPosLandmarkSearch* iLandmarkSearchHandle; |
|
26
5d0ec8b709be
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
215 |
TInt iRefCount; |
5 | 216 |
}; |
217 |
||
218 |
#include "clandmarkhandler.inl" |
|
219 |
||
220 |
#endif // __CLANDMARKMANAGEHANDLERS_H__ |
|
221 |
||
222 |
// End of File |