epoc32/include/mw/epos_landmarks.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 /*
     2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  Common declarations for Landmarks API
    15 *
    16 */
    17 
    18 
    19 #ifndef LANDMARKS_H
    20 #define LANDMARKS_H
    21 
    22 #include <e32std.h>
    23 
    24 /**
    25 *  Identifies landmarks and landmark categories in a landmark database.
    26 *
    27 *  @since S60 3.0
    28 */
    29 typedef TUint32 TPosLmItemId;
    30 
    31 /**
    32 *  Identifies global categories.
    33 *
    34 *  @since S60 3.0
    35 */
    36 typedef TUint16 TPosLmGlobalCategory;
    37 
    38 /**
    39 *  Identifies collection data.
    40 *
    41 *  @since S60 3.0
    42 */
    43 enum TPosLmCollectionDataId
    44     {
    45     EPosLmCollDataNone = 0                              /**<
    46         Null collection data. */,
    47     EPosLmCollDataCollectionName = 1                    /**<
    48         Collection name. */,
    49     EPosLmCollDataCollectionDescription = 2             /**<
    50         Collection description. */,
    51 
    52     EPosLmCollDataContentSpecificDataBegin = 0x8000     /**<
    53         Start of content specific collection meta data. */,
    54     EPosLmCollDataLast = KMaxTUint16                    /**<
    55         Last available collection data id. */
    56     };
    57 
    58 /**
    59 *  Specifies what type of event has occured.
    60 *
    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.
    68 *
    69 *  @since S60 3.0
    70 */
    71 enum TPosLmEventType
    72     {
    73     EPosLmEventUnknownChanges = 0  /**< Unknown change event. */,
    74 
    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. */,
    79 
    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
    84         client. */,
    85 
    86     EPosLmEventLandmarkUnknownChanges = 100 /**<
    87         Unknown change event concerning only landmarks. */,
    88 
    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. */,
    95 
    96     EPosLmEventCategoryUnknownChanges  = 200 /**<
    97         Unknown change event concerning only landmark categories. */,
    98 
    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. */
   105     };
   106 
   107 /**
   108 *  Struct for landmark database change event details.
   109 *
   110 *  @since S60 3.0
   111 */
   112 struct TPosLmEvent
   113     {
   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. */
   122     };
   123 
   124 
   125 // CONSTANTS
   126 const TUint32 KPosLmNullItemId = 0;
   127 const TUint16 KPosLmNullGlobalCategory = 0;
   128 
   129 const TInt KPosLmIconMaskNotUsed = -1;
   130 
   131 const TInt KPosLmMaxTextFieldLength = 255;
   132 const TInt KPosLmMaxDescriptionLength = 4095;
   133 const TInt KPosLmMaxCategoryNameLength = 124;
   134 
   135 const TUint KPosLastParsedLandmark = KMaxTUint32;
   136 
   137 // Landmark specific error codes
   138 // The 20 error codes in the range -30351 to -30370 is allocated for Landmarks
   139 // subsystem.
   140 const TInt KLandmarksErrorBase = -30351;
   141 const TInt KErrPosLmNotInitialized = KLandmarksErrorBase;
   142 const TInt KErrPosLmUnknownFormat = KLandmarksErrorBase - 1;
   143 
   144 const TInt KPosLmOperationNotComplete = 1001;
   145 
   146 // Database secure format
   147 _LIT(KPosLmDbSecureFormat, "secure[101FE978]");
   148 
   149 // Database secure policy UID
   150 const TUid KPosLmDbSecureUid = { 0x101FE978 };
   151 
   152 // Global functions
   153 
   154 /**
   155 * Releases all globally allocated landmark resources.
   156 *
   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.
   162 *
   163 * This function can be called any number of times.
   164 *
   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
   167 * used.
   168 *
   169 * @since S60 3.0
   170 */
   171 IMPORT_C void ReleaseLandmarkResources(TAny* = NULL);
   172 
   173 #endif      // LANDMARKS_H
   174 
   175