williamr@2: /* williamr@2: * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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 williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: SDK/S60, Landmarks API williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef EPOS_CPOSLANDMARKDATABASEEXTENDED_H_ williamr@2: #define EPOS_CPOSLANDMARKDATABASEEXTENDED_H_ williamr@2: williamr@2: #include "epos_cposlandmarkdatabase.h" williamr@2: williamr@2: class CPosLmCategoryManager; williamr@2: williamr@2: /** williamr@2: * Handle to a landmark database. williamr@2: * williamr@2: * This class defines extensions to the functionality of @ref CPosLandmarkDatabase class. williamr@2: * williamr@2: * @see CPosLandmarkDatabase williamr@2: * @since S60 3.2 williamr@2: * @lib eposlandmarks.lib. williamr@2: */ williamr@2: class CPosLandmarkDatabaseExtended : public CPosLandmarkDatabase williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Opens the default landmark database. williamr@2: * williamr@2: * This method is the same as @ref CPosLandmarkDatabase::OpenL(). williamr@2: * williamr@2: * The client takes ownership of the returned database handle. williamr@2: * williamr@2: * The database may have to be initialized before it can be used, see williamr@2: * @ref IsInitializingNeeded and @ref InitializeL. williamr@2: * williamr@2: * This function requires @p ReadUserData capability. williamr@2: * williamr@2: * @leave KErrNotSupported This extended interface is not supported williamr@2: * for default database. williamr@2: * @returns A handle to the open database. williamr@2: * @see CPosLandmarkDatabase::OpenL() williamr@2: */ williamr@2: IMPORT_C static CPosLandmarkDatabaseExtended* OpenL(); williamr@2: williamr@2: /** williamr@2: * Opens a specific landmark database. williamr@2: * williamr@2: * This method is the same as @ref CPosLandmarkDatabase::OpenL(const TDesC&). williamr@2: * williamr@2: * The client refers to a database by URI. The URI consists of a williamr@2: * protocol specifier and the database location: "protocol://location". williamr@2: * If the client does not specify a protocol, "file://" will be assumed. williamr@2: * williamr@2: * For local landmark databases, the URI consists of the drive and the williamr@2: * database file name, e.g. "c:landmarks.ldb". The path cannot be williamr@2: * specified by the client. The extension of the database file name must williamr@2: * be "ldb" otherwise the client will get the error @p KErrArgument. williamr@2: * williamr@2: * If the client specifies a local database and does not specify the williamr@2: * drive letter, e.g. "landmarks.ldb", default database drive will be assumed. williamr@2: * williamr@2: * The client takes ownership of the returned database handle. williamr@2: * williamr@2: * The database may have to be initialized before it can be used, see williamr@2: * @ref IsInitializingNeeded and @ref InitializeL. williamr@2: * williamr@2: * This function requires @p ReadUserData capability. williamr@2: * williamr@2: * @param[in] aDatabaseUri The URI of the database to open. williamr@2: * @returns A handle to the open database. williamr@2: * williamr@2: * @leave KErrArgument Extension of the local database name is not "ldb". williamr@2: * @leave KErrNotSupported This extended interface is not supported williamr@2: * for specified protocol. williamr@2: * @see CPosLandmarkDatabase::OpenL(const TDesC&) williamr@2: */ williamr@2: IMPORT_C static CPosLandmarkDatabaseExtended* OpenL( const TDesC& aDatabaseUri ); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C virtual ~CPosLandmarkDatabaseExtended(); williamr@2: williamr@2: public: williamr@2: williamr@2: /** Returns total amount of landmarks in the database. williamr@2: * @return Number of landmarks in the database or negative error code: williamr@2: * - KErrNotSupported if not supported in current database. williamr@2: * - KErrPosLmNotInitialized if database is not yet initialized. */ williamr@2: IMPORT_C TInt LandmarksCount(); williamr@2: williamr@2: /** Returns total amount of landmark categories in the database. williamr@2: * @return Number of landmark categories in the database or negative error code. williamr@2: * - KErrNotSupported if not supported in current database. williamr@2: * - KErrPosLmNotInitialized if database is not yet initialized. */ williamr@2: IMPORT_C TInt CategoriesCount(); williamr@2: williamr@2: public: williamr@2: williamr@2: /** Returns reference to category manager instance for this database. */ williamr@2: virtual CPosLmCategoryManager& CategoryManager() = 0; williamr@2: williamr@2: protected: williamr@2: williamr@2: /** Returns pointer to extension interface. Type of the williamr@2: * requested extension interface is supplied by caller in aExtensionId. williamr@2: * williamr@2: * Ownership of returned object is not transferred to caller, it is kept by williamr@2: * implementation. williamr@2: * williamr@2: * @param[in] aExtensionUid Type of requested extension williamr@2: * @return Pointer to extension implementation, or NULL if not supported. williamr@2: */ williamr@2: virtual void* GetExtension( TUid aExtensionUid ) = 0; williamr@2: williamr@2: protected: williamr@2: williamr@2: // C++ constructor. williamr@2: IMPORT_C CPosLandmarkDatabaseExtended(); williamr@2: williamr@2: private: williamr@2: williamr@2: // Prohibit copy constructor williamr@2: CPosLandmarkDatabaseExtended( const CPosLandmarkDatabaseExtended& ); williamr@2: // Prohibit assigment operator williamr@2: CPosLandmarkDatabaseExtended& operator= ( const CPosLandmarkDatabaseExtended& ); williamr@2: williamr@2: private: williamr@2: TInt8 reserved[32]; williamr@2: }; williamr@2: williamr@2: williamr@2: #endif /*EPOS_CPOSLANDMARKDATABASEEXTENDED_H_*/