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