epoc32/include/mw/epos_tposlmdatabasesettings.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:   TPosLmDatabaseSettings class
    15 *
    16 */
    17 
    18 
    19 
    20 #ifndef TPOSLMDATABASESETTINGS_H
    21 #define TPOSLMDATABASESETTINGS_H
    22 
    23 #include <e32std.h>
    24 
    25 const TInt KPosLmDatabaseName = 64;
    26 #define KPOSLMDATABASESETTINGSRESERVEDSIZE 31
    27 
    28 typedef TBuf<KPosLmDatabaseName> TPosLmDatabaseName;
    29 
    30 /**
    31 *  @ref TPosLmDatabaseSettings encapsulates the attributes that can be set for
    32 *  a landmark database.
    33 *
    34 *  The only available attribute is the displayable name.
    35 *
    36 *  To set a new display name, create a @ref HPosLmDatabaseInfo object
    37 *  containing the URI of the database. Call @ref SetDatabaseName on the
    38 *  @ref TPosLmDatabaseSettings member in @ref HPosLmDatabaseInfo and then
    39 *  pass the @ref HPosLmDatabaseInfo to
    40 *  @ref CPosLmDatabaseManager::ModifyDatabaseSettingsL.
    41 *
    42 *  When retrieving settings for a database, @ref IsAttributeSet can be used to
    43 *  find out whether display name is set for the database or not.
    44 *
    45 *  @lib eposlmdbmanlib.lib
    46 *  @since S60 3.0
    47 */
    48 class TPosLmDatabaseSettings
    49     {
    50     public:
    51 
    52         /**
    53         *  Enumeration of the attributes that can be set for a landmark
    54         *  database.
    55         */
    56         enum TAttribute
    57             {
    58             EName = 0x01                 /**<
    59                 Displayable name for the landmark database */
    60             };
    61 
    62     public:
    63 
    64         /**
    65         * Default constructor.
    66         */
    67         IMPORT_C TPosLmDatabaseSettings();
    68 
    69 
    70     public:
    71 
    72         /**
    73         * Checks whether a database attribute is set in this instance.
    74         *
    75         * @param aDbAttribute The database attribute to check.
    76         * @return @p ETrue if the attribute is set, otherwise @p EFalse.
    77         */
    78         IMPORT_C TBool IsAttributeSet( TAttribute aDbAttribute ) const;
    79 
    80         /**
    81         * Unset a database attribute.
    82         *
    83         * If an attribute is not set in this instance and the instance is
    84         * passed as input to a function for modifying the settings for a
    85         * database, e.g.  @ref CPosLmDatabaseManager::ModifyDatabaseSettingsL,
    86         * the attribute will be removed from the database.
    87         *
    88         * @param aDbAttribute The database attribute to unset.
    89         */
    90         IMPORT_C void UnsetAttribute( TAttribute aDbAttribute );
    91 
    92         /**
    93         * Retrieves the displayable name for the database.
    94         *
    95         * If the @p EName attribute is not set, an empty descriptor is returned.
    96         *
    97         * @return A pointer to the name descriptor. This pointer is valid until
    98         *   the @ref TPosLmDatabaseSettings instance is destroyed.
    99         */
   100         IMPORT_C TPtrC DatabaseName() const;
   101 
   102         /**
   103         * Set a displayable name for the database.
   104         *
   105         * If an empty descriptor is set, the database display name will be
   106         * set to an empty string.
   107         *
   108         * @param[in] aDatabaseName The new name for the database.
   109         */
   110         IMPORT_C void SetDatabaseName( const TPosLmDatabaseName& aDatabaseName );
   111 
   112     private:
   113 
   114         TUint8 iAttributes;
   115         TPosLmDatabaseName iName;
   116         TUint8 iReserved[KPOSLMDATABASESETTINGSRESERVEDSIZE];
   117 
   118     };
   119 
   120 #endif      // TPOSLMDATABASESETTINGS_H
   121 
   122