epoc32/include/mw/epos_landmarks.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). 
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  Common declarations for Landmarks API
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
#ifndef LANDMARKS_H
williamr@2
    20
#define LANDMARKS_H
williamr@2
    21
williamr@2
    22
#include <e32std.h>
williamr@2
    23
williamr@2
    24
/**
williamr@2
    25
*  Identifies landmarks and landmark categories in a landmark database.
williamr@2
    26
*
williamr@2
    27
*  @since S60 3.0
williamr@2
    28
*/
williamr@2
    29
typedef TUint32 TPosLmItemId;
williamr@2
    30
williamr@2
    31
/**
williamr@2
    32
*  Identifies global categories.
williamr@2
    33
*
williamr@2
    34
*  @since S60 3.0
williamr@2
    35
*/
williamr@2
    36
typedef TUint16 TPosLmGlobalCategory;
williamr@2
    37
williamr@2
    38
/**
williamr@2
    39
*  Identifies collection data.
williamr@2
    40
*
williamr@2
    41
*  @since S60 3.0
williamr@2
    42
*/
williamr@2
    43
enum TPosLmCollectionDataId
williamr@2
    44
    {
williamr@2
    45
    EPosLmCollDataNone = 0                              /**<
williamr@2
    46
        Null collection data. */,
williamr@2
    47
    EPosLmCollDataCollectionName = 1                    /**<
williamr@2
    48
        Collection name. */,
williamr@2
    49
    EPosLmCollDataCollectionDescription = 2             /**<
williamr@2
    50
        Collection description. */,
williamr@2
    51
williamr@2
    52
    EPosLmCollDataContentSpecificDataBegin = 0x8000     /**<
williamr@2
    53
        Start of content specific collection meta data. */,
williamr@2
    54
    EPosLmCollDataLast = KMaxTUint16                    /**<
williamr@2
    55
        Last available collection data id. */
williamr@2
    56
    };
williamr@2
    57
williamr@2
    58
/**
williamr@2
    59
*  Specifies what type of event has occured.
williamr@2
    60
*
williamr@2
    61
*  If there is no adequate event type to describe the DB change,
williamr@2
    62
*  @p EPosLmEventUnknownChanges, @p EPosLmEventLandmarkUnknownChanges or
williamr@2
    63
*  @p EPosLmEventCategoryUnknownChanges will be specified. This event type
williamr@2
    64
*  will also be used for mass operations, e.g. delete several landmarks, in
williamr@2
    65
*  order to bundle the events. This means that it is possible that multiple
williamr@2
    66
*  items have been changed. In this case, all landmarks and/or category
williamr@2
    67
*  information should be reread.
williamr@2
    68
*
williamr@2
    69
*  @since S60 3.0
williamr@2
    70
*/
williamr@2
    71
enum TPosLmEventType
williamr@2
    72
    {
williamr@2
    73
    EPosLmEventUnknownChanges = 0  /**< Unknown change event. */,
williamr@2
    74
williamr@2
    75
    EPosLmEventNewDefaultDatabaseLocation = 10  /**<
williamr@2
    76
        This event is received if the default landmark database location is
williamr@2
    77
        changed. The client has to open a new @ref CPosLandmarkDatabase handle
williamr@2
    78
        to access the new default database. */,
williamr@2
    79
williamr@2
    80
    EPosLmEventMediaRemoved = 11  /**<
williamr@2
    81
        This event is received if the media where the database is stored is
williamr@2
    82
        removed. After this, the database cannot be accessed. If the media
williamr@2
    83
        is inserted again, the database must still be reopened by the
williamr@2
    84
        client. */,
williamr@2
    85
williamr@2
    86
    EPosLmEventLandmarkUnknownChanges = 100 /**<
williamr@2
    87
        Unknown change event concerning only landmarks. */,
williamr@2
    88
williamr@2
    89
    EPosLmEventLandmarkCreated = 101 /**<
williamr@2
    90
        A new landmark has been created. */,
williamr@2
    91
    EPosLmEventLandmarkDeleted = 102 /**<
williamr@2
    92
        A landmark has been deleted. */,
williamr@2
    93
    EPosLmEventLandmarkUpdated = 103 /**<
williamr@2
    94
        A landmark has been updated. */,
williamr@2
    95
williamr@2
    96
    EPosLmEventCategoryUnknownChanges  = 200 /**<
williamr@2
    97
        Unknown change event concerning only landmark categories. */,
williamr@2
    98
williamr@2
    99
    EPosLmEventCategoryCreated = 201 /**<
williamr@2
   100
        A new landmark category has been created. */,
williamr@2
   101
    EPosLmEventCategoryDeleted = 202 /**<
williamr@2
   102
        A landmark category has been deleted. */,
williamr@2
   103
    EPosLmEventCategoryUpdated = 203 /**<
williamr@2
   104
        A landmark category has been updated. */
williamr@2
   105
    };
williamr@2
   106
williamr@2
   107
/**
williamr@2
   108
*  Struct for landmark database change event details.
williamr@2
   109
*
williamr@2
   110
*  @since S60 3.0
williamr@2
   111
*/
williamr@2
   112
struct TPosLmEvent
williamr@2
   113
    {
williamr@2
   114
    TPosLmEventType iEventType;        /**< Type of event. */
williamr@2
   115
    TPosLmItemId iLandmarkItemId;
williamr@2
   116
    /**< ID of an involved database item. This ID indicates that the event is
williamr@2
   117
         associated with one database item. If the change is not associated
williamr@2
   118
         with exactly one item, item ID will be set to @p KPosLmNullItemId.
williamr@2
   119
         For instance this ID will be set to @p KPosLmNullItemId for
williamr@2
   120
         @p EPosLmEventUnknownChanges events. */
williamr@2
   121
    TUint8 iUnused[8];                  /**< For future use. */
williamr@2
   122
    };
williamr@2
   123
williamr@2
   124
williamr@2
   125
// CONSTANTS
williamr@2
   126
const TUint32 KPosLmNullItemId = 0;
williamr@2
   127
const TUint16 KPosLmNullGlobalCategory = 0;
williamr@2
   128
williamr@2
   129
const TInt KPosLmIconMaskNotUsed = -1;
williamr@2
   130
williamr@2
   131
const TInt KPosLmMaxTextFieldLength = 255;
williamr@2
   132
const TInt KPosLmMaxDescriptionLength = 4095;
williamr@2
   133
const TInt KPosLmMaxCategoryNameLength = 124;
williamr@2
   134
williamr@2
   135
const TUint KPosLastParsedLandmark = KMaxTUint32;
williamr@2
   136
williamr@2
   137
// Landmark specific error codes
williamr@2
   138
// The 20 error codes in the range -30351 to -30370 is allocated for Landmarks
williamr@2
   139
// subsystem.
williamr@2
   140
const TInt KLandmarksErrorBase = -30351;
williamr@2
   141
const TInt KErrPosLmNotInitialized = KLandmarksErrorBase;
williamr@2
   142
const TInt KErrPosLmUnknownFormat = KLandmarksErrorBase - 1;
williamr@2
   143
williamr@2
   144
const TInt KPosLmOperationNotComplete = 1001;
williamr@2
   145
williamr@2
   146
// Database secure format
williamr@2
   147
_LIT(KPosLmDbSecureFormat, "secure[101FE978]");
williamr@2
   148
williamr@2
   149
// Database secure policy UID
williamr@2
   150
const TUid KPosLmDbSecureUid = { 0x101FE978 };
williamr@2
   151
williamr@2
   152
// Global functions
williamr@2
   153
williamr@2
   154
/**
williamr@2
   155
* Releases all globally allocated landmark resources.
williamr@2
   156
*
williamr@2
   157
* When using some landmark services, e.g. @ref CPosLandmarkDatabase,
williamr@2
   158
* @ref CPosLandmarkParser and @ref CPosLandmarkEncoder, resources are allocated
williamr@2
   159
* globally. To release these resources, @ref ReleaseLandmarkResources must be
williamr@2
   160
* called. The safest way to do this is to always call this function from the
williamr@2
   161
* client's destructor if the client uses landmark services.
williamr@2
   162
*
williamr@2
   163
* This function can be called any number of times.
williamr@2
   164
*
williamr@2
   165
* The function has an anonymous TAny pointer parameter so that the function
williamr@2
   166
* can be used as a cleanup function for @p TCleanupItem. The pointer is not
williamr@2
   167
* used.
williamr@2
   168
*
williamr@2
   169
* @since S60 3.0
williamr@2
   170
*/
williamr@2
   171
IMPORT_C void ReleaseLandmarkResources(TAny* = NULL);
williamr@2
   172
williamr@2
   173
#endif      // LANDMARKS_H
williamr@2
   174
williamr@2
   175