×
Namespaces

Variants
Actions
(Difference between revisions)

How to manage landmark categories

From Nokia Developer Wiki
Jump to: navigation, search
Den123 (Talk | contribs)
savaj (Talk | contribs)
Line 5: Line 5:
 
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:'''
*''clmkcategoryselectordlg.h''
+
<code cpp>
*''tlmkitemiddbcombiinfo.h''
+
#include <clmkcategoryselectordlg.h>
 +
#include <tlmkitemiddbcombiinfo.h>
 +
</code>
  
And link against:
+
'''And link against:'''
*''lmkcommonui.lib''
+
<code cpp>
*''eposlandmarks.lib''
+
LIBRARY  lmkcommonui.lib
*''lbs.lib''
+
LIBRARY  eposlandmarks.lib
 +
LIBRARY  lbs.lib
 +
</code>
  
 +
'''Source:'''
 
<code cpp>
 
<code cpp>
 
CPosLandmark* lm = ... // specify your landmark
 
CPosLandmark* lm = ... // specify your landmark

Revision as of 18:00, 30 March 2009

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();

Internal Links

48 page views in the last 30 days.