How to manage landmark categories
From Forum Nokia Wiki
The following code snippet demonstrates how to append selected categories to the specified landmark
It is necessary to include the following headers:
- clmkcategoryselectordlg.h
- tlmkitemiddbcombiinfo.h
And link against:
- lmkcommonui.lib
- eposlandmarks.lib
- lbs.lib
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
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| http post | wask | General Symbian C++ | 14 | 2008-03-27 11:42 |
| How to manage time for sub threads | novis | Python | 8 | 2008-03-27 03:29 |
| image details - name and copyright | mmrvka | General Browsing | 3 | 2003-07-11 10:40 |
| Very very stange indeed | the_mincer | General Symbian C++ | 6 | 2007-07-24 22:26 |
| Event handling in JMenu in JPanel | mpyhajar | Mobile Java Media (Graphics & Sounds) | 2 | 2003-07-24 08:58 |
