×
Namespaces

Variants
Actions
(Difference between revisions)

How to manage landmark categories

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Move to correct Category:Location)
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Add ArticleMetaData)
 
Line 1: Line 1:
 +
{{ArticleMetaData <!-- v1.2 -->
 +
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
 +
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 +
|devices= <!-- Devices tested against - e.g. ''devices=Nokia 6131 NFC, Nokia C7-00'') -->
 +
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Qt SDK 1.1.4]) -->
 +
|platform= <!-- Compatible platforms - e.g. Symbian^1 and later, Qt 4.6 and later -->
 +
|devicecompatability= <!-- Compatible devices e.g.: All* (must have internal GPS) -->
 +
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Signing requirements - empty or one of: Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20080526
 +
|author= [[User:Den123]]
 +
}}
 
[[Category:Location]][[Category:Symbian C++]]
 
[[Category:Location]][[Category:Symbian C++]]
 
The following code snippet demonstrates how to append selected categories to the specified landmark
 
The following code snippet demonstrates how to append selected categories to the specified landmark
Line 10: Line 32:
 
'''And link against:'''
 
'''And link against:'''
 
<code cpp>
 
<code cpp>
LIBRARY lmkcommonui.lib
+
LIBRARY lmkcommonui.lib
LIBRARY eposlandmarks.lib
+
LIBRARY eposlandmarks.lib
LIBRARY lbs.lib
+
LIBRARY lbs.lib
 
</code>
 
</code>
  
Line 59: Line 81:
 
== Internal Links ==
 
== Internal Links ==
 
* [[How to select and show a landmark]]
 
* [[How to select and show a landmark]]
* [[KIS000784 - Landmarks category selector dialog leaks memory]]
+
* [[Archived:Landmarks category selector dialog leaks memory (Known Issue)]]
 
* [[Landmarks/web client example using Carbide.c++ and UI designer]]
 
* [[Landmarks/web client example using Carbide.c++ and UI designer]]
 
* [[How to use Landmarks API]]
 
* [[How to use Landmarks API]]
Line 69: Line 91:
 
* [[Retrieving location information]]
 
* [[Retrieving location information]]
  
[[Category:Code Examples]]
+
[[Category:Code Snippet]]
  
 
[[Category:How To]]
 
[[Category:How To]]

Latest revision as of 06:13, 26 July 2012

Article Metadata
Article
Created: Den123 (26 May 2008)
Last edited: hamishwillee (26 Jul 2012)

The following code snippet demonstrates how to append selected categories to the specified landmark

It is necessary to include the following headers:

#include <clmkcategoryselectordlg.h>
#include <tlmkitemiddbcombiinfo.h>

And link against:

LIBRARY lmkcommonui.lib
LIBRARY eposlandmarks.lib
LIBRARY lbs.lib

Source:

CPosLandmark* lm = ... // specify your landmark
 
// prepare dialog
CLmkCategorySelectorDlg * selectCategoriesDlg = CLmkCategorySelectorDlg :: NewL( ETrue );
selectCategoriesDlg->SetMopParent( this );
RArray< TLmkItemIdDbCombiInfo > arrCategories;
CleanupClosePushL( arrCategories );
 
// select array of categories
if( selectCategoriesDlg->ExecuteLD( arrCategories ) != 0 )
{
for( int i = 0; i < arrCategories.Count(); i++ )
{
// get current category ID
TPosLmItemId categoryId = arrCategories[ i ].GetItemId();
if( categoryId != KPosLmNullItemId )
lm->AddCategoryL( categoryId );
}
delete arrCategories[0].GetLmDb(); // fixing memory leak
}
CleanupStack::PopAndDestroy(); // arrCategories


And the following code snippet demonstrates how to remove all categories from the specified landmark:

CPosLandmark* lm = ... // specify your landmark
 
RArray< TPosLmItemId > categories;
// read all landmark categories
lm->GetCategoriesL( categories );
for( int i = 0; i < categories.Count(); i++ )
{
TPosLmItemId categoryId = categories[ i ];
// remove current category
lm->RemoveCategory( categoryId );
}
categories.Close();

[edit] Internal Links

This page was last modified on 26 July 2012, at 06:13.
63 page views in the last 30 days.
×