williamr@2: /* williamr@2: * Copyright (c) 2005-2006 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: Common declarations for Landmarks API williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef LANDMARKS_H williamr@2: #define LANDMARKS_H williamr@2: williamr@2: #include williamr@2: williamr@2: /** williamr@2: * Identifies landmarks and landmark categories in a landmark database. williamr@2: * williamr@2: * @since S60 3.0 williamr@2: */ williamr@2: typedef TUint32 TPosLmItemId; williamr@2: williamr@2: /** williamr@2: * Identifies global categories. williamr@2: * williamr@2: * @since S60 3.0 williamr@2: */ williamr@2: typedef TUint16 TPosLmGlobalCategory; williamr@2: williamr@2: /** williamr@2: * Identifies collection data. williamr@2: * williamr@2: * @since S60 3.0 williamr@2: */ williamr@2: enum TPosLmCollectionDataId williamr@2: { williamr@2: EPosLmCollDataNone = 0 /**< williamr@2: Null collection data. */, williamr@2: EPosLmCollDataCollectionName = 1 /**< williamr@2: Collection name. */, williamr@2: EPosLmCollDataCollectionDescription = 2 /**< williamr@2: Collection description. */, williamr@2: williamr@2: EPosLmCollDataContentSpecificDataBegin = 0x8000 /**< williamr@2: Start of content specific collection meta data. */, williamr@2: EPosLmCollDataLast = KMaxTUint16 /**< williamr@2: Last available collection data id. */ williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Specifies what type of event has occured. williamr@2: * williamr@2: * If there is no adequate event type to describe the DB change, williamr@2: * @p EPosLmEventUnknownChanges, @p EPosLmEventLandmarkUnknownChanges or williamr@2: * @p EPosLmEventCategoryUnknownChanges will be specified. This event type williamr@2: * will also be used for mass operations, e.g. delete several landmarks, in williamr@2: * order to bundle the events. This means that it is possible that multiple williamr@2: * items have been changed. In this case, all landmarks and/or category williamr@2: * information should be reread. williamr@2: * williamr@2: * @since S60 3.0 williamr@2: */ williamr@2: enum TPosLmEventType williamr@2: { williamr@2: EPosLmEventUnknownChanges = 0 /**< Unknown change event. */, williamr@2: williamr@2: EPosLmEventNewDefaultDatabaseLocation = 10 /**< williamr@2: This event is received if the default landmark database location is williamr@2: changed. The client has to open a new @ref CPosLandmarkDatabase handle williamr@2: to access the new default database. */, williamr@2: williamr@2: EPosLmEventMediaRemoved = 11 /**< williamr@2: This event is received if the media where the database is stored is williamr@2: removed. After this, the database cannot be accessed. If the media williamr@2: is inserted again, the database must still be reopened by the williamr@2: client. */, williamr@2: williamr@2: EPosLmEventLandmarkUnknownChanges = 100 /**< williamr@2: Unknown change event concerning only landmarks. */, williamr@2: williamr@2: EPosLmEventLandmarkCreated = 101 /**< williamr@2: A new landmark has been created. */, williamr@2: EPosLmEventLandmarkDeleted = 102 /**< williamr@2: A landmark has been deleted. */, williamr@2: EPosLmEventLandmarkUpdated = 103 /**< williamr@2: A landmark has been updated. */, williamr@2: williamr@2: EPosLmEventCategoryUnknownChanges = 200 /**< williamr@2: Unknown change event concerning only landmark categories. */, williamr@2: williamr@2: EPosLmEventCategoryCreated = 201 /**< williamr@2: A new landmark category has been created. */, williamr@2: EPosLmEventCategoryDeleted = 202 /**< williamr@2: A landmark category has been deleted. */, williamr@2: EPosLmEventCategoryUpdated = 203 /**< williamr@2: A landmark category has been updated. */ williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Struct for landmark database change event details. williamr@2: * williamr@2: * @since S60 3.0 williamr@2: */ williamr@2: struct TPosLmEvent williamr@2: { williamr@2: TPosLmEventType iEventType; /**< Type of event. */ williamr@2: TPosLmItemId iLandmarkItemId; williamr@2: /**< ID of an involved database item. This ID indicates that the event is williamr@2: associated with one database item. If the change is not associated williamr@2: with exactly one item, item ID will be set to @p KPosLmNullItemId. williamr@2: For instance this ID will be set to @p KPosLmNullItemId for williamr@2: @p EPosLmEventUnknownChanges events. */ williamr@2: TUint8 iUnused[8]; /**< For future use. */ williamr@2: }; williamr@2: williamr@2: williamr@2: // CONSTANTS williamr@2: const TUint32 KPosLmNullItemId = 0; williamr@2: const TUint16 KPosLmNullGlobalCategory = 0; williamr@2: williamr@2: const TInt KPosLmIconMaskNotUsed = -1; williamr@2: williamr@2: const TInt KPosLmMaxTextFieldLength = 255; williamr@2: const TInt KPosLmMaxDescriptionLength = 4095; williamr@2: const TInt KPosLmMaxCategoryNameLength = 124; williamr@2: williamr@2: const TUint KPosLastParsedLandmark = KMaxTUint32; williamr@2: williamr@2: // Landmark specific error codes williamr@2: // The 20 error codes in the range -30351 to -30370 is allocated for Landmarks williamr@2: // subsystem. williamr@2: const TInt KLandmarksErrorBase = -30351; williamr@2: const TInt KErrPosLmNotInitialized = KLandmarksErrorBase; williamr@2: const TInt KErrPosLmUnknownFormat = KLandmarksErrorBase - 1; williamr@2: williamr@2: const TInt KPosLmOperationNotComplete = 1001; williamr@2: williamr@2: // Database secure format williamr@2: _LIT(KPosLmDbSecureFormat, "secure[101FE978]"); williamr@2: williamr@2: // Database secure policy UID williamr@2: const TUid KPosLmDbSecureUid = { 0x101FE978 }; williamr@2: williamr@2: // Global functions williamr@2: williamr@2: /** williamr@2: * Releases all globally allocated landmark resources. williamr@2: * williamr@2: * When using some landmark services, e.g. @ref CPosLandmarkDatabase, williamr@2: * @ref CPosLandmarkParser and @ref CPosLandmarkEncoder, resources are allocated williamr@2: * globally. To release these resources, @ref ReleaseLandmarkResources must be williamr@2: * called. The safest way to do this is to always call this function from the williamr@2: * client's destructor if the client uses landmark services. williamr@2: * williamr@2: * This function can be called any number of times. williamr@2: * williamr@2: * The function has an anonymous TAny pointer parameter so that the function williamr@2: * can be used as a cleanup function for @p TCleanupItem. The pointer is not williamr@2: * used. williamr@2: * williamr@2: * @since S60 3.0 williamr@2: */ williamr@2: IMPORT_C void ReleaseLandmarkResources(TAny* = NULL); williamr@2: williamr@2: #endif // LANDMARKS_H williamr@2: williamr@2: