class CPosLmCategoryManager : public CBase |
Category management for a landmark database.
A landmark database can contain a number of categories which can be assigned to the landmarks in the database. A landmark can be associated with multiple categories, e.g. a landmark can be a "Restaurant" and a "Pub". Categories also enable filtered searches, e.g. a client could search for nearby restaurants.
This class contains functions for managing landmark categories. This includes reading, listing, creating and updating landmark categories.
NetworkServices capability is required for remote databases.
Public Member Functions | |
---|---|
~CPosLmCategoryManager () | |
TPosLmItemId | AddCategoryL ( CPosLandmarkCategory &) |
CPosLmOperation * | AddCategoryToLandmarksL ( TPosLmItemId , RArray < TPosLmItemId > &) |
CPosLmItemIterator * | CategoryIteratorL ( TCategorySortPref ) |
TPosLmItemId | GetCategoryL (const TDesC &) |
TPosLmItemId | GetGlobalCategoryL ( TPosLmGlobalCategory ) |
HBufC * | GlobalCategoryNameL ( TPosLmGlobalCategory ) |
IMPORT_C CPosLmCategoryManager * | NewL ( CPosLandmarkDatabase &) |
CPosLandmarkCategory * | ReadCategoryLC ( TPosLmItemId ) |
CPosLmItemIterator * | ReferencedCategoryIteratorL ( TCategorySortPref ) |
CPosLmOperation * | RemoveCategoriesL (const RArray < TPosLmItemId > &) |
CPosLmOperation * | RemoveCategoryFromLandmarksL ( TPosLmItemId , RArray < TPosLmItemId > &) |
CPosLmOperation * | RemoveCategoryL ( TPosLmItemId ) |
CPosLmOperation * | ResetGlobalCategoriesL () |
void | UpdateCategoryL (const CPosLandmarkCategory &) |
Protected Member Functions | |
---|---|
CPosLmCategoryManager () |
Private Member Functions | |
---|---|
CPosLmCategoryManager (const CPosLmCategoryManager &) | |
CPosLmCategoryManager & | operator= (const CPosLmCategoryManager &) |
Public Member Enumerations | |
---|---|
enum | TCategorySortPref { ECategorySortOrderNone = 0, ECategorySortOrderNameAscending , ECategorySortOrderNameDescending } |
Private Attributes | |
---|---|
TUid | iDtorIdKey |
CPosLmCategoryManager | ( | const CPosLmCategoryManager & | ) | [private] |
const CPosLmCategoryManager & |
TPosLmItemId | AddCategoryL | ( | CPosLandmarkCategory & | aCategory | ) | [pure virtual] |
Adds a landmark category to the database and returns its ID.
This function requires ReadUserData and WriteUserData capabilities.
CPosLandmarkCategory & aCategory | The landmark category to add. |
CPosLmOperation * | AddCategoryToLandmarksL | ( | TPosLmItemId | aCategoryId, |
RArray < TPosLmItemId > & | aLandmarkIdArray | |||
) | [pure virtual] |
Adds a category to a set of landmarks.
If the category is already contained in one of the landmarks, nothing will be further added to that landmark.
The function returns an operation object which can be run in either synchronous or asynchronous mode. If it is run in asynchronous mode 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 category has only been added to a subset of the landmarks.
The client takes ownership of the returned operation object.
Note: There is no need to call CPosLandmarkDatabase::UpdateLandmark for this change to take place.
If the database is read only, the returned operation will fail with error code KErrAccessDenied .
While adding the category to the landmarks, this operation will acquire a write-lock on the database.
This function requires ReadUserData and WriteUserData capabilities.
TPosLmItemId aCategoryId | The category to add to the set of landmarks. |
RArray < TPosLmItemId > & aLandmarkIdArray | The landmarks to add the category to. |
CPosLmItemIterator * | CategoryIteratorL | ( | TCategorySortPref | aSortPref = ECategorySortOrderNone | ) | [pure virtual] |
Returns an object for iterating the landmark categories in the database.
The client takes ownership of the returned iterator object.
This function requires ReadUserData capability.
TCategorySortPref aSortPref = ECategorySortOrderNone | How to sort the categories. Default is no sorting. |
TPosLmItemId | GetCategoryL | ( | const TDesC & | aCategoryName | ) | [pure virtual] |
Gets a category by name.
This function only looks for an exact match.
This function requires ReadUserData capability.
const TDesC & aCategoryName | The name of the category to get. |
TPosLmItemId | GetGlobalCategoryL | ( | TPosLmGlobalCategory | aGlobalCategory | ) | [pure virtual] |
Gets the ID of a global category.
TPosLmGlobalCategory aGlobalCategory | The global category to look for. |
HBufC * | GlobalCategoryNameL | ( | TPosLmGlobalCategory | aGlobalCategory | ) | [pure virtual] |
Gets the predefined name of a global category.
TPosLmGlobalCategory aGlobalCategory | The global category to get a name for. |
IMPORT_C CPosLmCategoryManager * | NewL | ( | CPosLandmarkDatabase & | aLandmarkDatabase | ) | [static] |
Two-phased constructor.
The client takes ownership of the category manager.
CPosLandmarkDatabase & aLandmarkDatabase | The landmark database to manage categories in. |
CPosLandmarkCategory * | ReadCategoryLC | ( | TPosLmItemId | aCategoryId | ) | [pure virtual] |
Reads a landmark category from the database.
This function requires ReadUserData capability.
TPosLmItemId aCategoryId | The ID of the landmark category to read. |
CPosLmItemIterator * | ReferencedCategoryIteratorL | ( | TCategorySortPref | aSortPref = ECategorySortOrderNone | ) | [pure virtual] |
Returns an object for iterating referenced landmark categories in the database.
The iterator object is reset, so that the first CPosLmItemIterator::NextL call will return the first landmark category.
The client takes ownership of the returned iterator object.
This function requires ReadUserData capability.
TCategorySortPref aSortPref = ECategorySortOrderNone | How to sort the categories. Default is no sorting. |
CPosLmOperation * | RemoveCategoriesL | ( | const RArray < TPosLmItemId > & | aCategoryIdArray | ) | [pure virtual] |
Remove a set of landmark categories from the database.
This call will also remove the categories from all landmarks which contained them.
The function returns an operation object which can be run in either synchronous or asynchronous mode. If it is run in asynchronous mode 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 landmark categories have been deleted.
The client takes ownership of the returned operation object.
If the database is read only, the returned operation will fail with error code KErrAccessDenied .
This call will also remove the categories from all landmarks which contained them.
While removing the category, this operation will acquire a write-lock on the database.
This function requires ReadUserData and WriteUserData capabilities.
const RArray < TPosLmItemId > & aCategoryIdArray | The IDs of the landmark categories to delete. |
CPosLmOperation * | RemoveCategoryFromLandmarksL | ( | TPosLmItemId | aCategoryId, |
RArray < TPosLmItemId > & | aLandmarkIdArray | |||
) | [pure virtual] |
Removes a category from a set of landmarks.
If the category is not found in one of the landmarks, nothing will happen for that landmark.
The function returns an operation object which can be run in either synchronous or asynchronous mode. If it is run in asynchronous mode 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 category has only been removed from a subset of the landmarks.
The client takes ownership of the returned operation object.
If the database is read only, the returned operation will fail with error code KErrAccessDenied .
While removing the category from the landmarks, this operation will acquire a write-lock on the database.
This function requires ReadUserData and WriteUserData capabilities.
TPosLmItemId aCategoryId | The category to remove from the set of landmarks. |
RArray < TPosLmItemId > & aLandmarkIdArray | The landmarks to remove the category from. |
CPosLmOperation * | RemoveCategoryL | ( | TPosLmItemId | aCategoryId | ) | [pure virtual] |
Removes a landmark category from the database.
This call will also remove the category from all landmarks which contained it.
The function returns an operation object which can be run in either synchronous or asynchronous mode. If it is run in asynchronous mode 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 category has not been removed, but some landmarks may no longer contain this category
The client takes ownership of the returned operation object.
While removing the category, this operation will acquire a write-lock on the database.
This function requires ReadUserData and WriteUserData capabilities.
TPosLmItemId aCategoryId | The ID of the landmark category to delete. |
CPosLmOperation * | ResetGlobalCategoriesL | ( | ) | [pure virtual] |
Resets the information for all global categories.
The function returns an operation object which can be run in either synchronous or asynchronous mode. If it is run in asynchronous mode the client can supervise the progress of the operation.
If the CPosLmOperation object is deleted before the operation is complete, it is possible that that only a subset of the global categories have been resetted.
The client takes ownership of the returned operation object.
While resetting, this operation will acquire a write-lock on the database.
This function requires ReadUserData and WriteUserData capabilities.
void | UpdateCategoryL | ( | const CPosLandmarkCategory & | aCategory | ) | [pure virtual] |
Updates a landmark category in the database.
This function requires ReadUserData and WriteUserData capabilities.
const CPosLandmarkCategory & aCategory | The new landmark category data. |
CPosLmCategoryManager & | operator= | ( | const CPosLmCategoryManager & | ) | [private] |
const CPosLmCategoryManager & |
Specifies the sort preference for landmark categories.
ECategorySortOrderNone = 0 |
Categories not sorted |
ECategorySortOrderNameAscending |
Sorted ascending by category name. |
ECategorySortOrderNameDescending |
Sorted descending by category name. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.