API published in: S60 3rd Ed
Link against: eposlandmarks.lib
Required Capabilities
None
Exceptions
The capability ReadUserData is required in:
CPosLandmarkDatabase::OpenL();
CPosLandmarkDatabase::OpenL( const TDesC & aDatabaseUri );
CPosLandmarkDatabase::InitializeL();
CPosLandmarkDatabase::ReadLandmarkLC( TPosLmItemId aLandmarkId );
CPosLandmarkDatabase::LandmarkIteratorL();
CPosLandmarkDatabase::LandmarkIteratorL( const TPosLmSortPref & aSortPref );
CPosLandmarkDatabase::AddLandmarkL( CPosLandmark & aLandmark );
CPosLandmarkDatabase::UpdateLandmarkL( const CPosLandmark & aLandmark );
CPosLandmarkDatabase::RemoveLandmarkL( TPosLmItemId aLandmarkId );
CPosLandmarkDatabase::RemoveLandmarksL( const RArray< TPosLmItemId > & aLandmarkIdArray );
CPosLandmarkDatabase::RemoveAllLandmarksL();
CPosLandmarkDatabase::ReadPartialLandmarkLC( TPosLmItemId aLandmarkId );
CPosLandmarkDatabase::PreparePartialLandmarksL( const RArray< TPosLmItemId > & aLandmarkIdArray );
CPosLandmarkDatabase::SizeL();
CPosLandmarkDatabase::CompactL();
CPosLandmarkDatabase::NotifyDatabaseEvent( TPosLmEvent & aEvent, TRequestStatus & aStatus );
CPosLandmarkDatabase::CancelNotifyDatabaseEvent();
CPosLandmarkDatabase::ImportLandmarksL( CPosLandmarkParser& aLandmarkParser, TTransferOptions aTransferOptions );
CPosLandmarkDatabase::ImportLandmarksL( CPosLandmarkParser& aLandmarkParser, const RArray<TUint>& aLandmarkSelection, TTransferOptions aTransferOptions );
CPosLmCategoryManager::ReadCategoryLC( TPosLmItemId aCategoryId );
CPosLmCategoryManager::CategoryIteratorL( TCategorySortPref aSortPref );
CPosLmCategoryManager::ReferencedCategoryIteratorL( TCategorySortPref aSortPref )
CPosLmCategoryManager::AddCategoryL( CPosLandmarkCategory & aCategory );
CPosLmCategoryManager::UpdateCategoryL( const CPosLandmarkCategory & aCategory );
CPosLmCategoryManager::RemoveCategoryL( TPosLmItemId aCategoryId );
CPosLmCategoryManager::RemoveCategoriesL( const RArray< TPosLmItemId > & aCategoryIdArray );
CPosLmCategoryManager::AddCategoryToLandmarksL( TPosLmItemId aCategoryId, RArray< TPosLmItemId > & aLandmarkIdArray );
CPosLmCategoryManager::RemoveCategoryFromLandmarksL( TPosLmItemId aCategoryId, RArray< TPosLmItemId > & aLandmarkIdArray );
CPosLmCategoryManager::GetCategoryL( const TDesC & aCategoryName );
CPosLmCategoryManager::GetGlobalCategoryL( TPosLmGlobalCategory aGlobalCategory );
CPosLmCategoryManager::ResetGlobalCategoriesL();
The capability WriteUserData is required in:
CPosLandmarkDatabase::AddLandmarkL( CPosLandmark& aLandmark );
CPosLandmarkDatabase::UpdateLandmarkL( const CPosLandmark& aLandmark );
CPosLandmarkDatabase::RemoveLandmarkL( TPosLmItemId aLandmarkId );
CPosLandmarkDatabase::RemoveLandmarksL( const RArray<TPosLmItemId>& aLandmarkIdArray );
CPosLandmarkDatabase::RemoveAllLandmarksL();
CPosLandmarkDatabase::CompactL();
CPosLandmarkDatabase::ImportLandmarksL( CPosLandmarkParser& aLandmarkParser, TTransferOptions aTransferOptions );
CPosLandmarkDatabase::ImportLandmarksL( CPosLandmarkParser& aLandmarkParser, const RArray<TUint>& aLandmarkSelection, TTransferOptions aTransferOptions );
CPosLmCategoryManager::AddCategoryL( CPosLandmarkCategory & aCategory );
CPosLmCategoryManager::UpdateCategoryL( const CPosLandmarkCategory & aCategory );
CPosLmCategoryManager::RemoveCategoryL( TPosLmItemId aCategoryId );
CPosLmCategoryManager::RemoveCategoriesL( const RArray< TPosLmItemId > & aCategoryIdArray );
CPosLmCategoryManager::AddCategoryToLandmarksL( TPosLmItemId aCategoryId, RArray< TPosLmItemId > & aLandmarkIdArray );
CPosLmCategoryManager::RemoveCategoryFromLandmarksL( TPosLmItemId aCategoryId, RArray< TPosLmItemId > & aLandmarkIdArray );
CPosLmCategoryManager::ResetGlobalCategoriesL();
Other Information
The capability NetworkServices is required to work with remote databases.
#include <epos_cposlandmarkdatabase.h>
This class contains functions for creating, iterating, reading, modifying and deleting landmarks.
Operations on the database may fail with error code KErrCorrupt
if the database is damaged. The client can try to recover the database by calling CPosLandmarkDatabase::InitializeL().
Operations on the database may fail with error code KErrLocked
if another client is writing to the database. Write operations can also fail with this error code if another client is currently
reading from the database.
If CPosLandmarkDatabase is used, the client must call the global function ReleaseLandmarkResources() before terminating in order to release all used landmark resources, otherwise the client may receive an ALLOC panic.
NetworkServices
capability is required for remote databases.
Public Types |
|
typedef TUint | TTransferOptions |
Bitmap for specifying a group of transfer options defined by _TAttributes. |
|
enum | _TTransferOptions { EDefaultOptions = 0, EIncludeCategories = 0x01, EIncludeGlobalCategoryNames = 0x02, ESupressCategoryCreation = 0x04 } |
Specifies options for importing and exporting landmarks. More... |
|
Public Member Functions |
|
virtual IMPORT_C | ~CPosLandmarkDatabase () |
Destructor. |
|
virtual TBool | IsInitializingNeeded () const =0 |
Checks if the database is in need of initialization. |
|
virtual CPosLmOperation * | InitializeL ()=0 |
Initializes the database. |
|
virtual CPosLandmark * | ReadLandmarkLC (TPosLmItemId aLandmarkId)=0 |
Reads a landmark from the database. |
|
virtual CPosLmItemIterator * | LandmarkIteratorL ()=0 |
Returns an object for iterating the landmarks in the database. |
|
virtual CPosLmItemIterator * | LandmarkIteratorL (const TPosLmSortPref &aSortPref)=0 |
Returns an object for iterating the landmarks in the database. |
|
virtual TPosLmItemId | AddLandmarkL (CPosLandmark &aLandmark)=0 |
Adds a new landmark to the database and returns its ID. |
|
virtual void | UpdateLandmarkL (const CPosLandmark &aLandmark)=0 |
Updates a landmark in the database. |
|
virtual void | RemoveLandmarkL (TPosLmItemId aLandmarkId)=0 |
Removes a landmark from the database. |
|
virtual CPosLmOperation * | RemoveLandmarksL (const RArray< TPosLmItemId > &aLandmarkIdArray)=0 |
Removes a set of landmarks from the database. |
|
virtual CPosLmOperation * | RemoveAllLandmarksL ()=0 |
Removes all landmarks from the database. |
|
virtual CPosLmPartialReadParameters * | PartialReadParametersLC ()=0 |
Returns the partial read parameters for this database handle. |
|
virtual void | SetPartialReadParametersL (const CPosLmPartialReadParameters &aPartialSettings)=0 |
Sets the partial read parameters for this database handle. |
|
virtual CPosLandmark * | ReadPartialLandmarkLC (TPosLmItemId aLandmarkId)=0 |
Reads partial data from a landmark in the database. |
|
virtual CPosLmOperation * | PreparePartialLandmarksL (const RArray< TPosLmItemId > &aLandmarkIdArray)=0 |
Reads partial data from a set of landmarks in the database. |
|
virtual CArrayPtr< CPosLandmark > * | TakePreparedPartialLandmarksL (CPosLmOperation *aPreparePartialLandmarkOperation)=0 |
Fetches the result from a call to PreparePartialLandmarksL. |
|
virtual HBufC * | DatabaseUriLC ()=0 |
Returns a URI which points to the landmark database storage. |
|
virtual TSize | SizeL ()=0 |
Returns size information for the database. |
|
virtual CPosLmOperation * | CompactL ()=0 |
Compacts the landmark database. |
|
virtual void | NotifyDatabaseEvent (TPosLmEvent &aEvent, TRequestStatus &aStatus)=0 |
Listens for database events. |
|
virtual TInt | CancelNotifyDatabaseEvent ()=0 |
Cancels a call to NotifyDatabaseEvent. |
|
virtual CPosLmOperation * | ExportLandmarksL (CPosLandmarkEncoder &aLandmarkEncoder, const RArray< TPosLmItemId > &aLandmarkIdArray, TTransferOptions aTransferOptions)=0 |
Exports a number of landmarks. |
|
virtual CPosLmOperation * | ImportLandmarksL (CPosLandmarkParser &aLandmarkParser, TTransferOptions aTransferOptions)=0 |
Import a set of landmarks. |
|
virtual CPosLmOperation * | ImportLandmarksL (CPosLandmarkParser &aLandmarkParser, const RArray< TUint > &aLandmarkSelection, TTransferOptions aTransferOptions)=0 |
Import a set of landmarks. |
|
virtual CPosLmItemIterator * | ImportedLandmarksIteratorL (CPosLmOperation *aImportOperation)=0 |
Returns an object for iterating the landmarks added in an import operation. |
|
TUid | ImplementationId () const |
Static Public Member Functions |
|
static IMPORT_C CPosLandmarkDatabase * | OpenL () |
Opens the default landmark database. |
|
static IMPORT_C CPosLandmarkDatabase * | OpenL (const TDesC &aDatabaseUri) |
Opens a specific landmark database. |
|
Protected Member Functions |
|
IMPORT_C | CPosLandmarkDatabase () |
Data Structures |
|
struct | TSize |
Encapsulates size information for a landmark database. More... |
|
Bitmap for specifying a group of transfer options defined by _TAttributes. |
|
|
Destructor. |
|
|
Adds a new landmark to the database and returns its ID.
This function requires
|
|
Cancels a call to NotifyDatabaseEvent.
This function requires
|
|
Compacts the landmark database.
The function returns an operation object which can be run in incremental mode. If it is run incrementally the client can supervise the progress of the operation. The client takes ownership of the returned operation object.
This function requires
|
|
Returns a URI which points to the landmark database storage. The URI may point to a file in the terminal file system or on a remote file. The client takes ownership of the returned descriptor.
|
|
Exports a number of landmarks.
The client must also provide a list of the landmarks which should be exported. If one of the landmarks are not found in the
database, the returned operation fails with error code The client does not have to add any landmarks to the encoder object. This function will add the ones specified in the ID array. The function returns an operation object which can be run in incremental mode. If it is run incrementally the client can supervise the progress of the operation. If the CPosLmOperation object is deleted before the operation is complete, it is possible that only a subset of the landmarks have been exported. The client takes ownership of the returned operation object. When all landmarks have been exported the client must finalize encoding by calling CPosLandmarkEncoder::FinalizeEncodingL.
This function requires
|
|
|
Returns an object for iterating the landmarks added in an import operation. To import landmarks ImportLandmarksL is used. If ImportedLandmarksIteratorL is called before the ImportLandmarksL operation has completed, the iterator will iterate the landmarks imported so far. Landmarks imported after the iterator is obtained will not affect the iterator. A new iterator must be obtained to iterate these new landmarks. The client takes ownership of the returned iterator object.
|
|
Import a set of landmarks.
In this overload of the function, the client can pass an array defining a subset of the landmarks in the parser object. This way the client can select to import only a part of the landmark content. The function returns an operation object which can be run in incremental mode. If it is run incrementally the client can supervise the progress of the operation. If the CPosLmOperation object is deleted before the operation is complete, it is possible that only a subset of the landmarks have been imported. The client takes ownership of the returned operation object. After completion ImportedLandmarksIteratorL can be called to retrieve the IDs of the added landmarks.
The
This function requires
|
|
Import a set of landmarks.
The function returns an operation object which can be run in incremental mode. If it is run incrementally the client can supervise the progress of the operation. If the CPosLmOperation object is deleted before the operation is complete, it is possible that only a subset of the landmarks have been imported. The client takes ownership of the returned operation object. After completion ImportedLandmarksIteratorL can be called to retrieve the IDs of the added landmarks.
The
This function requires
|
|
Initializes the database. This function may have to be called right after the database is opened. IsInitializingNeeded can be called to find out if initialization is needed. If the database becomes damaged, the client can call InitializeL to try to recover the database. It is ok to call even if initialization is not needed. In this case, the operation will not do anything.
If the database needs to be initialized, the client must call InitializeL, otherwise the database may not be possible to access. Access functions may leave with The function returns an operation object which can be run in incremental mode. If it is run incrementally the client can supervise the progress of the operation. If the CPosLmOperation object is deleted before the operation is complete, it is possible that the database is not yet initialized. The client takes ownership of the returned operation object.
This function requires
|
|
Checks if the database is in need of initialization.
If the database needs to be initialized, the client must call InitializeL, otherwise the database may not be possible to access. Access functions may leave with Initialization may be needed also if the database becomes damaged. The client can then try to call InitializeL to try to recover the database.
|
|
Returns an object for iterating the landmarks in the database.
This overload of the iterator function takes a sort preference object as input. The sort preference object specifies how the landmarks should be sorted by the iterator. Only sorting by landmark name is supported. The client takes ownership of the returned iterator object.
This function requires
|
|
Returns an object for iterating the landmarks in the database.
The client takes ownership of the returned iterator object.
This function requires
|
|
Listens for database events.
This function is asynchronous and it will complete the request status when an event occurs. At this time Event listening can be cancelled by calling CancelNotifyDatabaseEvent.
This function requires
|
|
Opens a specific landmark database. The client refers to a database by URI. The URI consists of a protocol specifier and the database location: "protocol://location". If the client does not specify a protocol, "file://" will be assumed.
For local landmark databases, the URI consists of the drive and the database file name, e.g. "c:landmarks.ldb". The path cannot
be specified by the client. The extension of the database file name must be "ldb" otherwise the client will get the error
If the client specifies a local database and does not specify the drive letter, e.g. "landmarks.ldb", default database drive will be assumed. The client takes ownership of the returned database handle. The database may have to be initialized before it can be used, see IsInitializingNeeded and InitializeL.
This function requires
|
|
Opens the default landmark database. The client takes ownership of the returned database handle. The database may have to be initialized before it can be used, see IsInitializingNeeded and InitializeL.
This function requires
|
|
Returns the partial read parameters for this database handle. Partial read parameters are used to define which landmark data should be returned when ReadPartialLandmarkLC is called. The client takes ownership of the returned parameter object.
|
|
Reads partial data from a set of landmarks in the database.
Note that the returned data may be very big if all attributes in each landmark are requested. A typical use for this function is to retrieve the names for a set of landmarks. When the request is completed, the result can be retrieved by calling TakePreparedPartialLandmarksL. The function returns an operation object which can be run in incremental mode. If it is run incrementally the client can supervise the progress of the operation. The client takes ownership of the returned operation object. While preparing landmark information, this operation will acquire a read-lock on the database.
This function requires
|
|
Reads a landmark from the database.
This function requires
|
|
Reads partial data from a landmark in the database.
The client takes ownership of the returned landmark object.
This function requires
|
|
Removes all landmarks from the database.
If the CPosLmOperation object is deleted before the operation is complete, it is possible that only a subset of the landmarks have been deleted. The client takes ownership of the returned operation object. While removing landmarks, this operation will acquire a write-lock on the database.
This function requires
|
|
Removes a landmark from the database.
This function requires
|
|
Removes a set of landmarks from the database.
The function returns an operation object which can be run in incremental mode. If it is run incrementally the client can supervise the progress of the operation. If the CPosLmOperation object is deleted before the operation is complete, it is possible that only a subset of the landmarks have been deleted. The client takes ownership of the returned operation object. While removing landmarks, this operation will acquire a write-lock on the database.
This function requires
|
|
Sets the partial read parameters for this database handle. Partial read parameters are used to define which landmark data should be returned when ReadPartialLandmarkLC is called.
|
|
Returns size information for the database.
This function requires
|
|
Fetches the result from a call to PreparePartialLandmarksL.
If reading a landmark failed during preparation, the corresponding pointer value in the returned array will be NULL. For instance, reading can fail if the specified ID does not exist in the database. The client takes ownership of the returned array object including the contained landmark objects.
|
|
Updates a landmark in the database.
KErrArgument .
Note that any updates in the database made since the landmark object was read from the database will be overwritten by this operation. A landmark can contain the IDs of the categories it belongs to. If any of these categories does not exist in the database, the update operation will still complete successfully but the category which was not found will be ignored.
This function requires
|