2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: SDK/S60, Landmarks API
19 #ifndef EPOS_CPOSLANDMARKDATABASEEXTENDED_H_
20 #define EPOS_CPOSLANDMARKDATABASEEXTENDED_H_
22 #include "epos_cposlandmarkdatabase.h"
24 class CPosLmCategoryManager;
27 * Handle to a landmark database.
29 * This class defines extensions to the functionality of @ref CPosLandmarkDatabase class.
31 * @see CPosLandmarkDatabase
33 * @lib eposlandmarks.lib.
35 class CPosLandmarkDatabaseExtended : public CPosLandmarkDatabase
40 * Opens the default landmark database.
42 * This method is the same as @ref CPosLandmarkDatabase::OpenL().
44 * The client takes ownership of the returned database handle.
46 * The database may have to be initialized before it can be used, see
47 * @ref IsInitializingNeeded and @ref InitializeL.
49 * This function requires @p ReadUserData capability.
51 * @leave KErrNotSupported This extended interface is not supported
52 * for default database.
53 * @returns A handle to the open database.
54 * @see CPosLandmarkDatabase::OpenL()
56 IMPORT_C static CPosLandmarkDatabaseExtended* OpenL();
59 * Opens a specific landmark database.
61 * This method is the same as @ref CPosLandmarkDatabase::OpenL(const TDesC&).
63 * The client refers to a database by URI. The URI consists of a
64 * protocol specifier and the database location: "protocol://location".
65 * If the client does not specify a protocol, "file://" will be assumed.
67 * For local landmark databases, the URI consists of the drive and the
68 * database file name, e.g. "c:landmarks.ldb". The path cannot be
69 * specified by the client. The extension of the database file name must
70 * be "ldb" otherwise the client will get the error @p KErrArgument.
72 * If the client specifies a local database and does not specify the
73 * drive letter, e.g. "landmarks.ldb", default database drive will be assumed.
75 * The client takes ownership of the returned database handle.
77 * The database may have to be initialized before it can be used, see
78 * @ref IsInitializingNeeded and @ref InitializeL.
80 * This function requires @p ReadUserData capability.
82 * @param[in] aDatabaseUri The URI of the database to open.
83 * @returns A handle to the open database.
85 * @leave KErrArgument Extension of the local database name is not "ldb".
86 * @leave KErrNotSupported This extended interface is not supported
87 * for specified protocol.
88 * @see CPosLandmarkDatabase::OpenL(const TDesC&)
90 IMPORT_C static CPosLandmarkDatabaseExtended* OpenL( const TDesC& aDatabaseUri );
95 IMPORT_C virtual ~CPosLandmarkDatabaseExtended();
99 /** Returns total amount of landmarks in the database.
100 * @return Number of landmarks in the database or negative error code:
101 * - KErrNotSupported if not supported in current database.
102 * - KErrPosLmNotInitialized if database is not yet initialized. */
103 IMPORT_C TInt LandmarksCount();
105 /** Returns total amount of landmark categories in the database.
106 * @return Number of landmark categories in the database or negative error code.
107 * - KErrNotSupported if not supported in current database.
108 * - KErrPosLmNotInitialized if database is not yet initialized. */
109 IMPORT_C TInt CategoriesCount();
113 /** Returns reference to category manager instance for this database. */
114 virtual CPosLmCategoryManager& CategoryManager() = 0;
118 /** Returns pointer to extension interface. Type of the
119 * requested extension interface is supplied by caller in aExtensionId.
121 * Ownership of returned object is not transferred to caller, it is kept by
124 * @param[in] aExtensionUid Type of requested extension
125 * @return Pointer to extension implementation, or NULL if not supported.
127 virtual void* GetExtension( TUid aExtensionUid ) = 0;
132 IMPORT_C CPosLandmarkDatabaseExtended();
136 // Prohibit copy constructor
137 CPosLandmarkDatabaseExtended( const CPosLandmarkDatabaseExtended& );
138 // Prohibit assigment operator
139 CPosLandmarkDatabaseExtended& operator= ( const CPosLandmarkDatabaseExtended& );
146 #endif /*EPOS_CPOSLANDMARKDATABASEEXTENDED_H_*/