2 * Copyright (c) 2005-2006 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: Common declarations for Landmarks API
25 * Identifies landmarks and landmark categories in a landmark database.
29 typedef TUint32 TPosLmItemId;
32 * Identifies global categories.
36 typedef TUint16 TPosLmGlobalCategory;
39 * Identifies collection data.
43 enum TPosLmCollectionDataId
45 EPosLmCollDataNone = 0 /**<
46 Null collection data. */,
47 EPosLmCollDataCollectionName = 1 /**<
49 EPosLmCollDataCollectionDescription = 2 /**<
50 Collection description. */,
52 EPosLmCollDataContentSpecificDataBegin = 0x8000 /**<
53 Start of content specific collection meta data. */,
54 EPosLmCollDataLast = KMaxTUint16 /**<
55 Last available collection data id. */
59 * Specifies what type of event has occured.
61 * If there is no adequate event type to describe the DB change,
62 * @p EPosLmEventUnknownChanges, @p EPosLmEventLandmarkUnknownChanges or
63 * @p EPosLmEventCategoryUnknownChanges will be specified. This event type
64 * will also be used for mass operations, e.g. delete several landmarks, in
65 * order to bundle the events. This means that it is possible that multiple
66 * items have been changed. In this case, all landmarks and/or category
67 * information should be reread.
73 EPosLmEventUnknownChanges = 0 /**< Unknown change event. */,
75 EPosLmEventNewDefaultDatabaseLocation = 10 /**<
76 This event is received if the default landmark database location is
77 changed. The client has to open a new @ref CPosLandmarkDatabase handle
78 to access the new default database. */,
80 EPosLmEventMediaRemoved = 11 /**<
81 This event is received if the media where the database is stored is
82 removed. After this, the database cannot be accessed. If the media
83 is inserted again, the database must still be reopened by the
86 EPosLmEventLandmarkUnknownChanges = 100 /**<
87 Unknown change event concerning only landmarks. */,
89 EPosLmEventLandmarkCreated = 101 /**<
90 A new landmark has been created. */,
91 EPosLmEventLandmarkDeleted = 102 /**<
92 A landmark has been deleted. */,
93 EPosLmEventLandmarkUpdated = 103 /**<
94 A landmark has been updated. */,
96 EPosLmEventCategoryUnknownChanges = 200 /**<
97 Unknown change event concerning only landmark categories. */,
99 EPosLmEventCategoryCreated = 201 /**<
100 A new landmark category has been created. */,
101 EPosLmEventCategoryDeleted = 202 /**<
102 A landmark category has been deleted. */,
103 EPosLmEventCategoryUpdated = 203 /**<
104 A landmark category has been updated. */
108 * Struct for landmark database change event details.
114 TPosLmEventType iEventType; /**< Type of event. */
115 TPosLmItemId iLandmarkItemId;
116 /**< ID of an involved database item. This ID indicates that the event is
117 associated with one database item. If the change is not associated
118 with exactly one item, item ID will be set to @p KPosLmNullItemId.
119 For instance this ID will be set to @p KPosLmNullItemId for
120 @p EPosLmEventUnknownChanges events. */
121 TUint8 iUnused[8]; /**< For future use. */
126 const TUint32 KPosLmNullItemId = 0;
127 const TUint16 KPosLmNullGlobalCategory = 0;
129 const TInt KPosLmIconMaskNotUsed = -1;
131 const TInt KPosLmMaxTextFieldLength = 255;
132 const TInt KPosLmMaxDescriptionLength = 4095;
133 const TInt KPosLmMaxCategoryNameLength = 124;
135 const TUint KPosLastParsedLandmark = KMaxTUint32;
137 // Landmark specific error codes
138 // The 20 error codes in the range -30351 to -30370 is allocated for Landmarks
140 const TInt KLandmarksErrorBase = -30351;
141 const TInt KErrPosLmNotInitialized = KLandmarksErrorBase;
142 const TInt KErrPosLmUnknownFormat = KLandmarksErrorBase - 1;
144 const TInt KPosLmOperationNotComplete = 1001;
146 // Database secure format
147 _LIT(KPosLmDbSecureFormat, "secure[101FE978]");
149 // Database secure policy UID
150 const TUid KPosLmDbSecureUid = { 0x101FE978 };
155 * Releases all globally allocated landmark resources.
157 * When using some landmark services, e.g. @ref CPosLandmarkDatabase,
158 * @ref CPosLandmarkParser and @ref CPosLandmarkEncoder, resources are allocated
159 * globally. To release these resources, @ref ReleaseLandmarkResources must be
160 * called. The safest way to do this is to always call this function from the
161 * client's destructor if the client uses landmark services.
163 * This function can be called any number of times.
165 * The function has an anonymous TAny pointer parameter so that the function
166 * can be used as a cleanup function for @p TCleanupItem. The pointer is not
171 IMPORT_C void ReleaseLandmarkResources(TAny* = NULL);
173 #endif // LANDMARKS_H