williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2005-2006 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: CPosLmDatabaseManager class
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
#ifndef CPOSLMDATABASEMANAGER_H
|
williamr@2
|
21 |
#define CPOSLMDATABASEMANAGER_H
|
williamr@2
|
22 |
|
williamr@2
|
23 |
#include <e32base.h>
|
williamr@2
|
24 |
#include <badesca.h>
|
williamr@2
|
25 |
#include "EPos_TPosLmDatabaseEvent.h"
|
williamr@2
|
26 |
#include "EPos_TPosLmDatabaseSettings.h"
|
williamr@2
|
27 |
#include "EPos_HPosLmDatabaseInfo.h"
|
williamr@2
|
28 |
|
williamr@2
|
29 |
|
williamr@2
|
30 |
/**
|
williamr@2
|
31 |
* This class is used to manage landmark databases.
|
williamr@2
|
32 |
*
|
williamr@2
|
33 |
* @p CPosLmDatabaseManager contains functions for listing registering,
|
williamr@2
|
34 |
* unregistering, creating, deleting, copying landmark databases, etc.
|
williamr@2
|
35 |
* It also has functions for managing the default landmark database. The
|
williamr@2
|
36 |
* client can listen to events related to database management.
|
williamr@2
|
37 |
*
|
williamr@2
|
38 |
* A database is local if it resides in the phone or in some device which
|
williamr@2
|
39 |
* is mapped to the phones file system. If a database is not local, it is
|
williamr@2
|
40 |
* remote.
|
williamr@2
|
41 |
*
|
williamr@2
|
42 |
* The client refers to a database by URI. The URI consists of a protocol
|
williamr@2
|
43 |
* specifier and the database location: "protocol://location". If the
|
williamr@2
|
44 |
* client does not specify a protocol, "file://" is assumed.
|
williamr@2
|
45 |
*
|
williamr@2
|
46 |
* For local landmark databases, the URI consists of the drive and the
|
williamr@2
|
47 |
* database file name, e.g. "c:landmarks.ldb". The path cannot be specified
|
williamr@2
|
48 |
* by the client. The extension of the database file name must be "ldb".
|
williamr@2
|
49 |
* If a path is included or if the file name extension is not .ldb",
|
williamr@2
|
50 |
* the client receives the error code @p KErrArgument. For local landmark
|
williamr@2
|
51 |
* databases, the client receives the error code @p KErrBadName if the
|
williamr@2
|
52 |
* file name is invalid and @p KErrNotReady if the drive specified in the URI
|
williamr@2
|
53 |
* does not exist.
|
williamr@2
|
54 |
*
|
williamr@2
|
55 |
* If the client specifies a local database URI and does not specify the drive
|
williamr@2
|
56 |
* letter, e.g. "landmarks.ldb", default database drive is assumed.
|
williamr@2
|
57 |
*
|
williamr@2
|
58 |
* Local databases are created by calling @ref CreateDatabaseL. "Bookmarks"
|
williamr@2
|
59 |
* to remote databases are created by calling @ref RegisterDatabaseL. After
|
williamr@2
|
60 |
* this they are listed by the database manager.
|
williamr@2
|
61 |
*
|
williamr@2
|
62 |
* If @ref CPosLmDatabaseManager is used, the client must call the global
|
williamr@2
|
63 |
* function @ref ReleaseLandmarkResources before terminating, in order to
|
williamr@2
|
64 |
* release all used landmark resources, otherwise the client may receive
|
williamr@2
|
65 |
* an ALLOC panic.
|
williamr@2
|
66 |
*
|
williamr@2
|
67 |
* @lib eposlmdbmanlib.lib
|
williamr@2
|
68 |
* @since S60 3.0
|
williamr@2
|
69 |
*/
|
williamr@2
|
70 |
class CPosLmDatabaseManager : public CBase
|
williamr@2
|
71 |
{
|
williamr@2
|
72 |
public:
|
williamr@2
|
73 |
|
williamr@2
|
74 |
/**
|
williamr@2
|
75 |
* Two-phased constructor.
|
williamr@2
|
76 |
*
|
williamr@2
|
77 |
* This function requires @p ReadUserData capability.
|
williamr@2
|
78 |
*/
|
williamr@2
|
79 |
IMPORT_C static CPosLmDatabaseManager* NewL();
|
williamr@2
|
80 |
|
williamr@2
|
81 |
/**
|
williamr@2
|
82 |
* Destructor.
|
williamr@2
|
83 |
*/
|
williamr@2
|
84 |
IMPORT_C virtual ~CPosLmDatabaseManager();
|
williamr@2
|
85 |
|
williamr@2
|
86 |
public:
|
williamr@2
|
87 |
|
williamr@2
|
88 |
/**
|
williamr@2
|
89 |
* Retrieves the URI of the default landmark database.
|
williamr@2
|
90 |
*
|
williamr@2
|
91 |
* The default landmark database is the one which is opened when calling
|
williamr@2
|
92 |
* @p CPosLandmarkDatabase::OpenL without any parameters.
|
williamr@2
|
93 |
*
|
williamr@2
|
94 |
* Only "file"-protocol databases can be set as default.
|
williamr@2
|
95 |
*
|
williamr@2
|
96 |
* This function requires @p ReadUserData capability.
|
williamr@2
|
97 |
*
|
williamr@2
|
98 |
* @return The URI of the default landmark database. The client takes
|
williamr@2
|
99 |
* ownership of the descriptor object.
|
williamr@2
|
100 |
*/
|
williamr@2
|
101 |
virtual HBufC* DefaultDatabaseUriLC() = 0;
|
williamr@2
|
102 |
|
williamr@2
|
103 |
/**
|
williamr@2
|
104 |
* Sets a landmark database as default.
|
williamr@2
|
105 |
*
|
williamr@2
|
106 |
* This database is opened the next time
|
williamr@2
|
107 |
* @p CPosLandmarkDatabase::OpenL() called without parameters.
|
williamr@2
|
108 |
*
|
williamr@2
|
109 |
* To move the current default database to another drive, first use
|
williamr@2
|
110 |
* @ref CopyDatabaseL to copy the database to the new drive, then use
|
williamr@2
|
111 |
* @ref SetDefaultDatabaseUriL to set the new database as default and
|
williamr@2
|
112 |
* finally, use @ref DeleteDatabaseL if the old default database should
|
williamr@2
|
113 |
* be deleted.
|
williamr@2
|
114 |
*
|
williamr@2
|
115 |
* Only "file"-protocol databases can be set as default.
|
williamr@2
|
116 |
*
|
williamr@2
|
117 |
* This function requires @p WriteDeviceData capability.
|
williamr@2
|
118 |
*
|
williamr@2
|
119 |
* @param[in] aDatabaseUri The URI of the database which should be set as
|
williamr@2
|
120 |
* default.
|
williamr@2
|
121 |
* @leave KErrNotSupported The protocol specified something else
|
williamr@2
|
122 |
* than "file://" as protocol in the URI.
|
williamr@2
|
123 |
* @leave KErrArgument The URI is incorrect.
|
williamr@2
|
124 |
* @leave KErrNotFound The landmark database which should be set as default
|
williamr@2
|
125 |
* does not exist.
|
williamr@2
|
126 |
*/
|
williamr@2
|
127 |
virtual void SetDefaultDatabaseUriL( const TDesC& aDatabaseUri ) = 0;
|
williamr@2
|
128 |
|
williamr@2
|
129 |
/**
|
williamr@2
|
130 |
* Listens for database management events.
|
williamr@2
|
131 |
*
|
williamr@2
|
132 |
* This function is asynchronous and it completes the request
|
williamr@2
|
133 |
* status when an event occurs. At this time, the client can read
|
williamr@2
|
134 |
* event information from the retrieved event object.
|
williamr@2
|
135 |
*
|
williamr@2
|
136 |
* Event listening can be canceled by calling
|
williamr@2
|
137 |
* @ref CancelNotifyDatabaseEvent.
|
williamr@2
|
138 |
*
|
williamr@2
|
139 |
* This function requires @p ReadUserData capability.
|
williamr@2
|
140 |
*
|
williamr@2
|
141 |
* @param[out] aEvent Contains the event information when an event
|
williamr@2
|
142 |
* occurs (request completes).
|
williamr@2
|
143 |
* @param[out] aStatus Is completed with @p KErrNone if an event
|
williamr@2
|
144 |
* occurs or an error code if some error is encountered.
|
williamr@2
|
145 |
*/
|
williamr@2
|
146 |
virtual void NotifyDatabaseEvent(
|
williamr@2
|
147 |
TPosLmDatabaseEvent& aEvent,
|
williamr@2
|
148 |
TRequestStatus& aStatus
|
williamr@2
|
149 |
) = 0;
|
williamr@2
|
150 |
|
williamr@2
|
151 |
/**
|
williamr@2
|
152 |
* Cancels a call to @ref NotifyDatabaseEvent.
|
williamr@2
|
153 |
*
|
williamr@2
|
154 |
* @return @p KErrNone if the request was successfully cancelled,
|
williamr@2
|
155 |
* otherwise a system wide error code.
|
williamr@2
|
156 |
*/
|
williamr@2
|
157 |
virtual TInt CancelNotifyDatabaseEvent() = 0;
|
williamr@2
|
158 |
|
williamr@2
|
159 |
/**
|
williamr@2
|
160 |
* Retrieves the database URI associated with the last event.
|
williamr@2
|
161 |
*
|
williamr@2
|
162 |
* Some events, e.g. @p EPosLmDbDatabaseRegistered and
|
williamr@2
|
163 |
* @p EPosLmDbDatabaseUnregistered, refer to a specific database. The
|
williamr@2
|
164 |
* URI of the database can be retrieved through this function.
|
williamr@2
|
165 |
*
|
williamr@2
|
166 |
* If the URI should be retrieved, this function must be called before
|
williamr@2
|
167 |
* @ref NotifyDatabaseEvent is called again to listen for the next
|
williamr@2
|
168 |
* event.
|
williamr@2
|
169 |
*
|
williamr@2
|
170 |
* This function requires @p ReadUserData capability.
|
williamr@2
|
171 |
*
|
williamr@2
|
172 |
* @return The database URI associated with the event. The client takes
|
williamr@2
|
173 |
* ownership of the descriptor object.
|
williamr@2
|
174 |
* @leave KErrNotFound There is no database URI associated with the event
|
williamr@2
|
175 |
* or, the database URI has been discarded because the client has called
|
williamr@2
|
176 |
* @ref NotifyDatabaseEvent again.
|
williamr@2
|
177 |
*/
|
williamr@2
|
178 |
virtual HBufC* DatabaseUriFromLastEventLC() = 0;
|
williamr@2
|
179 |
|
williamr@2
|
180 |
/**
|
williamr@2
|
181 |
* Lists the URIs to all landmark databases known by the Landmarks
|
williamr@2
|
182 |
* system.
|
williamr@2
|
183 |
*
|
williamr@2
|
184 |
* The client can specify a protocol string as input to this function.
|
williamr@2
|
185 |
* The function then only returns a list of the databases which
|
williamr@2
|
186 |
* are accessed through this protocol.
|
williamr@2
|
187 |
*
|
williamr@2
|
188 |
* The client takes ownership of the returned array.
|
williamr@2
|
189 |
*
|
williamr@2
|
190 |
* If no databases are found, an empty array is returned.
|
williamr@2
|
191 |
*
|
williamr@2
|
192 |
* This function requires @p ReadUserData capability.
|
williamr@2
|
193 |
*
|
williamr@2
|
194 |
* @param[in] aProtocol The protocol for which database URIs should be
|
williamr@2
|
195 |
* listed. If no protocol is specified, i.e. if an empty string is
|
williamr@2
|
196 |
* specified, all known database URIs are listed.
|
williamr@2
|
197 |
* @return The list of database URIs.
|
williamr@2
|
198 |
* @leave KErrNotSupported The protocol is not supported in the platform.
|
williamr@2
|
199 |
*/
|
williamr@2
|
200 |
virtual CDesCArray* ListDatabasesLC( const TDesC& aProtocol = KNullDesC ) = 0;
|
williamr@2
|
201 |
|
williamr@2
|
202 |
/**
|
williamr@2
|
203 |
* Lists information about each landmark database known by the Landmarks
|
williamr@2
|
204 |
* system.
|
williamr@2
|
205 |
*
|
williamr@2
|
206 |
* The client can specify a protocol string as input to this function.
|
williamr@2
|
207 |
* The function then only returns information about the databases
|
williamr@2
|
208 |
* which are accessed through this protocol.
|
williamr@2
|
209 |
*
|
williamr@2
|
210 |
* The client specifies an array which is populated by this function.
|
williamr@2
|
211 |
* The client takes ownership of all information objects in the array.
|
williamr@2
|
212 |
*
|
williamr@2
|
213 |
* If no databases are found, an empty array is returned.
|
williamr@2
|
214 |
*
|
williamr@2
|
215 |
* This function requires @p ReadUserData capability.
|
williamr@2
|
216 |
*
|
williamr@2
|
217 |
* @param[out] aDatabaseInfoArray On return, contains information about
|
williamr@2
|
218 |
* the landmark databases. Any objects which are in the array when
|
williamr@2
|
219 |
* it is passed to this function are not removed.
|
williamr@2
|
220 |
* @param[in] aProtocol The protocol for which database URIs should be
|
williamr@2
|
221 |
* listed. If no protocol is specified, i.e. if an empty string is
|
williamr@2
|
222 |
* specified, all known database URIs are listed.
|
williamr@2
|
223 |
* @leave KErrNotSupported The protocol is not supported in the platform.
|
williamr@2
|
224 |
*/
|
williamr@2
|
225 |
virtual void ListDatabasesL(
|
williamr@2
|
226 |
RPointerArray<HPosLmDatabaseInfo>& aDatabaseInfoArray,
|
williamr@2
|
227 |
const TDesC& aProtocol = KNullDesC
|
williamr@2
|
228 |
) = 0;
|
williamr@2
|
229 |
|
williamr@2
|
230 |
/**
|
williamr@2
|
231 |
* Registers a landmark database.
|
williamr@2
|
232 |
*
|
williamr@2
|
233 |
* The landmark database is then returned when listing landmark
|
williamr@2
|
234 |
* databases.
|
williamr@2
|
235 |
*
|
williamr@2
|
236 |
* For local landmark databases, this function leaves with error code
|
williamr@2
|
237 |
* @p KErrNotSupported. To add a local database, the client must call
|
williamr@2
|
238 |
* @ref CreateDatabaseL.
|
williamr@2
|
239 |
*
|
williamr@2
|
240 |
* The client supplies an information object containing the URI of the
|
williamr@2
|
241 |
* database to register. The information object can also contain
|
williamr@2
|
242 |
* database settings, e.g. a display name for the database.
|
williamr@2
|
243 |
*
|
williamr@2
|
244 |
* This function requires @p ReadUserData and @p WriteUserData
|
williamr@2
|
245 |
* capabilities.
|
williamr@2
|
246 |
*
|
williamr@2
|
247 |
* @param[in,out] aDatabaseInfo Information about the landmark database to
|
williamr@2
|
248 |
* register. The information object will be updated with
|
williamr@2
|
249 |
* media type and drive information.
|
williamr@2
|
250 |
*
|
williamr@2
|
251 |
* @leave KErrNotSupported The protocol specified in the URI is not
|
williamr@2
|
252 |
* supported in the platform or the protocol does not allow
|
williamr@2
|
253 |
* registering landmark databases.
|
williamr@2
|
254 |
* @leave KErrArgument The URI is incorrect.
|
williamr@2
|
255 |
* @leave KErrAlreadyExists The database already exists in the registry.
|
williamr@2
|
256 |
*/
|
williamr@2
|
257 |
virtual void RegisterDatabaseL( HPosLmDatabaseInfo& aDatabaseInfo ) = 0;
|
williamr@2
|
258 |
|
williamr@2
|
259 |
/**
|
williamr@2
|
260 |
* Unregisters a landmark database.
|
williamr@2
|
261 |
*
|
williamr@2
|
262 |
* After this, the landmark database is not returned when listing
|
williamr@2
|
263 |
* landmark databases.
|
williamr@2
|
264 |
*
|
williamr@2
|
265 |
* For local landmark databases, this function leaves with error code
|
williamr@2
|
266 |
* @p KErrNotSupported. To remove a local database, the client must call
|
williamr@2
|
267 |
* @ref DeleteDatabaseL.
|
williamr@2
|
268 |
*
|
williamr@2
|
269 |
* This function requires @p ReadUserData and @p WriteUserData
|
williamr@2
|
270 |
* capabilities.
|
williamr@2
|
271 |
*
|
williamr@2
|
272 |
* @param[in] aDatabaseUri The URI of the database to register.
|
williamr@2
|
273 |
*
|
williamr@2
|
274 |
* @leave KErrNotSupported The protocol specified in the URI is not
|
williamr@2
|
275 |
* supported in the platform or the protocol does not allow
|
williamr@2
|
276 |
* unregistering landmark databases.
|
williamr@2
|
277 |
* @leave KErrArgument The URI is incorrect.
|
williamr@2
|
278 |
*/
|
williamr@2
|
279 |
virtual void UnregisterDatabaseL( const TDesC& aDatabaseUri ) = 0;
|
williamr@2
|
280 |
|
williamr@2
|
281 |
/**
|
williamr@2
|
282 |
* Unregisters all landmark database which are accessed through a
|
williamr@2
|
283 |
* certain protocol.
|
williamr@2
|
284 |
*
|
williamr@2
|
285 |
* After this, the landmark databases are not be returned when listing
|
williamr@2
|
286 |
* landmark databases.
|
williamr@2
|
287 |
*
|
williamr@2
|
288 |
* For local landmark databases, this function leaves with error code
|
williamr@2
|
289 |
* @p KErrNotSupported. To remove a local database, the client must call
|
williamr@2
|
290 |
* @ref DeleteDatabaseL.
|
williamr@2
|
291 |
*
|
williamr@2
|
292 |
* This function requires @p ReadUserData and @p WriteUserData
|
williamr@2
|
293 |
* capabilities.
|
williamr@2
|
294 |
*
|
williamr@2
|
295 |
* @param[in] aProtocol The protocol to unregister all databases for.
|
williamr@2
|
296 |
*
|
williamr@2
|
297 |
* @leave KErrNotSupported The protocol is not supported in the platform
|
williamr@2
|
298 |
* or the protocol does not allow unregistering landmark databases.
|
williamr@2
|
299 |
* @leave KErrArgument The protocol is an empty string.
|
williamr@2
|
300 |
*/
|
williamr@2
|
301 |
virtual void UnregisterAllDatabasesL( const TDesC& aProtocol ) = 0;
|
williamr@2
|
302 |
|
williamr@2
|
303 |
/**
|
williamr@2
|
304 |
* Modifies the settings for a landmark database.
|
williamr@2
|
305 |
*
|
williamr@2
|
306 |
* This function requires @p ReadUserData and @p WriteUserData
|
williamr@2
|
307 |
* capabilities.
|
williamr@2
|
308 |
*
|
williamr@2
|
309 |
* @param[in] aDatabaseUri The URI of the database to modify settings for.
|
williamr@2
|
310 |
* @param[in] aDatabaseSettings The new settings for the database.
|
williamr@2
|
311 |
*
|
williamr@2
|
312 |
* @leave KErrNotSupported The protocol specified in the URI is not
|
williamr@2
|
313 |
* supported in the platform.
|
williamr@2
|
314 |
* @leave KErrNotFound The specified database is not found.
|
williamr@2
|
315 |
* @leave KErrArgument The URI is incorrect.
|
williamr@2
|
316 |
*/
|
williamr@2
|
317 |
virtual void ModifyDatabaseSettingsL(
|
williamr@2
|
318 |
const TDesC& aDatabaseUri,
|
williamr@2
|
319 |
const TPosLmDatabaseSettings& aDatabaseSettings
|
williamr@2
|
320 |
) = 0;
|
williamr@2
|
321 |
|
williamr@2
|
322 |
/**
|
williamr@2
|
323 |
* Retrieve information about a landmark database.
|
williamr@2
|
324 |
*
|
williamr@2
|
325 |
* This function requires @p ReadUserData capability.
|
williamr@2
|
326 |
*
|
williamr@2
|
327 |
* @param[in,out] aDatabaseInfo An information object containing the URI of the
|
williamr@2
|
328 |
* landmark database. On return, the object contains information about
|
williamr@2
|
329 |
* the landmark database, including any database settings.
|
williamr@2
|
330 |
*
|
williamr@2
|
331 |
* @leave KErrNotSupported The protocol specified in the URI is not
|
williamr@2
|
332 |
* supported in the platform.
|
williamr@2
|
333 |
* @leave KErrNotFound The specified database is not found.
|
williamr@2
|
334 |
* @leave KErrArgument The URI is incorrect.
|
williamr@2
|
335 |
*/
|
williamr@2
|
336 |
virtual void GetDatabaseInfoL( HPosLmDatabaseInfo& aDatabaseInfo ) = 0;
|
williamr@2
|
337 |
|
williamr@2
|
338 |
/**
|
williamr@2
|
339 |
* Checks if the specified landmark database exists.
|
williamr@2
|
340 |
*
|
williamr@2
|
341 |
* The database to check is specified by passing a URI to this function.
|
williamr@2
|
342 |
* URI construction is described in the class description for
|
williamr@2
|
343 |
* @ref CPosLmDatabaseManager. The URI must point to a database which is
|
williamr@2
|
344 |
* handled by this database manager, i.e. not a remote location.
|
williamr@2
|
345 |
*
|
williamr@2
|
346 |
* This function requires @p ReadUserData capability. If the database is
|
williamr@2
|
347 |
* remote, @p NetworkServices capability is also needed.
|
williamr@2
|
348 |
*
|
williamr@2
|
349 |
* @param[in] aDatabaseUri The URI of the database which should be checked
|
williamr@2
|
350 |
* for existence.
|
williamr@2
|
351 |
* @return @p ETrue if the database exists, otherwise @p EFalse.
|
williamr@2
|
352 |
*
|
williamr@2
|
353 |
* @leave KErrNotSupported The protocol specified in the URI is not
|
williamr@2
|
354 |
* supported.
|
williamr@2
|
355 |
* @leave KErrArgument The URI is incorrect.
|
williamr@2
|
356 |
*/
|
williamr@2
|
357 |
virtual TBool DatabaseExistsL( const TDesC& aDatabaseUri ) = 0;
|
williamr@2
|
358 |
|
williamr@2
|
359 |
/**
|
williamr@2
|
360 |
* Creates a landmark database.
|
williamr@2
|
361 |
*
|
williamr@2
|
362 |
* This function requires @p ReadUserData and @p WriteUserData
|
williamr@2
|
363 |
* capabilities. If the database is remote, @p NetworkServices
|
williamr@2
|
364 |
* capability is also needed.
|
williamr@2
|
365 |
*
|
williamr@2
|
366 |
* @param aDatabaseInfo Information about the landmark database to
|
williamr@2
|
367 |
* create. The information object will be updated with
|
williamr@2
|
368 |
* media type and drive information.
|
williamr@2
|
369 |
*
|
williamr@2
|
370 |
* @leave KErrNotSupported The protocol specified in the URI is not
|
williamr@2
|
371 |
* supported.
|
williamr@2
|
372 |
* @leave KErrArgument The URI is incorrect.
|
williamr@2
|
373 |
* @leave KErrAlreadyExists There is already a database at this URI.
|
williamr@2
|
374 |
*/
|
williamr@2
|
375 |
virtual void CreateDatabaseL( HPosLmDatabaseInfo& aDatabaseInfo ) = 0;
|
williamr@2
|
376 |
|
williamr@2
|
377 |
/**
|
williamr@2
|
378 |
* Deletes a landmark database.
|
williamr@2
|
379 |
*
|
williamr@2
|
380 |
* The database to delete is specified by passing a URI to this
|
williamr@2
|
381 |
* function. URI construction is described in the class description for
|
williamr@2
|
382 |
* @ref CPosLmDatabaseManager.
|
williamr@2
|
383 |
*
|
williamr@2
|
384 |
* If the specified database does not exist, the call is ignored.
|
williamr@2
|
385 |
*
|
williamr@2
|
386 |
* This function requires @p ReadUserData and @p WriteUserData
|
williamr@2
|
387 |
* capabilities. If the database is remote, @p NetworkServices
|
williamr@2
|
388 |
* capability is also needed.
|
williamr@2
|
389 |
*
|
williamr@2
|
390 |
* @param aDatabaseUri The URI of the database to delete.
|
williamr@2
|
391 |
*
|
williamr@2
|
392 |
* @leave KErrNotSupported The protocol specified in the URI is not
|
williamr@2
|
393 |
* supported.
|
williamr@2
|
394 |
* @leave KErrArgument The URI is incorrect.
|
williamr@2
|
395 |
* @leave KErrInUse The database is in use by some client.
|
williamr@2
|
396 |
* @leave KErrAccessDenied The database is read-only.
|
williamr@2
|
397 |
*/
|
williamr@2
|
398 |
virtual void DeleteDatabaseL( const TDesC& aDatabaseUri ) = 0;
|
williamr@2
|
399 |
|
williamr@2
|
400 |
/**
|
williamr@2
|
401 |
* Copies a landmark database to a new location.
|
williamr@2
|
402 |
*
|
williamr@2
|
403 |
* Database locations are specified as URIs. URI construction is
|
williamr@2
|
404 |
* described in the class description for @ref CPosLmDatabaseManager.
|
williamr@2
|
405 |
* Target URI protocol must be the same as source URI protocol.
|
williamr@2
|
406 |
*
|
williamr@2
|
407 |
* This function requires @p ReadUserData and @p WriteUserData
|
williamr@2
|
408 |
* capabilities. If the databases are remote, @p NetworkServices
|
williamr@2
|
409 |
* capability is also needed.
|
williamr@2
|
410 |
*
|
williamr@2
|
411 |
* @param[in] aSourceUri The URI of the database to copy.
|
williamr@2
|
412 |
* @param[in] aTargetUri The URI of the new database location.
|
williamr@2
|
413 |
*
|
williamr@2
|
414 |
* @leave KErrNotSupported The protocol specified in the a URI is not
|
williamr@2
|
415 |
* supported.
|
williamr@2
|
416 |
* @leave KErrArgument A URI is incorrect.
|
williamr@2
|
417 |
* @leave KErrAlreadyExists There is already a database at the target URI.
|
williamr@2
|
418 |
* @leave KErrInUse There is a write-lock on the database, e.g. some client
|
williamr@2
|
419 |
* is currently modifying the database.
|
williamr@2
|
420 |
* @leave KErrNotFound There is no database at the source URI.
|
williamr@2
|
421 |
*/
|
williamr@2
|
422 |
virtual void CopyDatabaseL(
|
williamr@2
|
423 |
const TDesC& aSourceUri,
|
williamr@2
|
424 |
const TDesC& aTargetUri
|
williamr@2
|
425 |
) = 0;
|
williamr@2
|
426 |
|
williamr@2
|
427 |
protected:
|
williamr@2
|
428 |
|
williamr@2
|
429 |
// C++ constructor.
|
williamr@2
|
430 |
IMPORT_C CPosLmDatabaseManager();
|
williamr@2
|
431 |
|
williamr@2
|
432 |
private:
|
williamr@2
|
433 |
|
williamr@2
|
434 |
// Prohibit copy constructor
|
williamr@2
|
435 |
CPosLmDatabaseManager( const CPosLmDatabaseManager& );
|
williamr@2
|
436 |
// Prohibit assigment operator
|
williamr@2
|
437 |
CPosLmDatabaseManager& operator= ( const CPosLmDatabaseManager& );
|
williamr@2
|
438 |
|
williamr@2
|
439 |
private:
|
williamr@2
|
440 |
|
williamr@2
|
441 |
// Implementation Uid
|
williamr@2
|
442 |
TUid iDtorIdKey;
|
williamr@2
|
443 |
};
|
williamr@2
|
444 |
|
williamr@2
|
445 |
#endif // CPOSLMDATABASEMANAGER_H
|
williamr@2
|
446 |
|
williamr@2
|
447 |
|