×
Namespaces

Variants
Actions
(Difference between revisions)

How to manage landmark categories

From Nokia Developer Wiki
Jump to: navigation, search
Den123 (Talk | contribs)
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Add ArticleMetaData)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[Category:Symbian C++]]
+
{{ArticleMetaData <!-- v1.2 -->
[[Category:Code Examples]]
+
|sourcecode= <!-- Link to example source code e.g. [[Media:The Code Example ZIP.zip]] -->
[[Category:Location Based Services]]
+
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
[[Category:How To]]
+
|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++]]
 
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
  
It is necessary to include the following headers:
+
'''It is necessary to include the following headers:'''
 +
<code cpp>
 +
#include <clmkcategoryselectordlg.h>
 +
#include <tlmkitemiddbcombiinfo.h>
 +
</code>
  
    * clmkcategoryselectordlg.h
+
'''And link against:'''
    * tlmkitemiddbcombiinfo.h
+
<code cpp>
 
+
LIBRARY lmkcommonui.lib
And link against:
+
LIBRARY eposlandmarks.lib
 
+
LIBRARY lbs.lib
    * lmkcommonui.lib  
+
</code>
    * eposlandmarks.lib  
+
    * lbs.lib
+
  
 +
'''Source:'''
 
<code cpp>
 
<code cpp>
 
CPosLandmark* lm = ... // specify your landmark
 
CPosLandmark* lm = ... // specify your landmark
Line 58: Line 80:
  
 
== 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]]
 +
* [[How to use Landmarks API]]
 +
* [[How to compact local landmark databases]]
 +
* [[How to export landmarks from database to file]]
 +
* [[How to import landmarks from file to database]]
 +
* [[Execution of landmark operations]]
 +
* [[How to obtain and save current location]]
 +
* [[Retrieving location information]]
 +
 
 +
[[Category:Code Snippet]]
 +
 
 +
[[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.
43 page views in the last 30 days.
×