author | andrews@symbian.org |
Thu, 25 Jun 2009 01:40:38 +0100 | |
changeset 4 | 79513c90e348 |
parent 0 | 14df0fbfcc4e |
permissions | -rw-r--r-- |
0
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
1 |
/* |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
8 |
* |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
11 |
* |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
13 |
* |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
14 |
* Description: CLandmarkIterable class implementation |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
15 |
* |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
17 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
18 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
19 |
#include <e32math.h> |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
20 |
#include <epos_cposlandmark.h> |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
21 |
#include <epos_cposlandmarkdatabase.h> |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
22 |
#include <epos_cposlmitemiterator.h> |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
23 |
#include <lbsposition.h> |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
24 |
#include "clandmarkiterable.h" |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
25 |
#include "landmarkliwparams.hrh" |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
26 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
27 |
// ============================ MEMBER FUNCTIONS =============================== |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
28 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
29 |
// ----------------------------------------------------------------------------- |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
30 |
// CLandmarkIterable::NewL( CPosLmItemIterator* aIterator, |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
31 |
// TDesC& aDatabaseUri ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
32 |
// Two-phased constructor. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
33 |
// ----------------------------------------------------------------------------- |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
34 |
// |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
35 |
CLandmarkIterable* CLandmarkIterable::NewL( CPosLmItemIterator* aIterator, |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
36 |
const TDesC& aDatabaseUri ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
37 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
38 |
CLandmarkIterable* self = new (ELeave) CLandmarkIterable(aIterator); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
39 |
CleanupStack::PushL(self); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
40 |
self->ConstructL(aDatabaseUri); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
41 |
CleanupStack::Pop(self); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
42 |
return self; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
43 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
44 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
45 |
// ----------------------------------------------------------------------------- |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
46 |
// CLandmarkIterable::ConstructL( const TDesC & aDatabaseUri ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
47 |
// Symbian 2nd phase constructor can leave. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
48 |
// ----------------------------------------------------------------------------- |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
49 |
// |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
50 |
void CLandmarkIterable::ConstructL( const TDesC& aDatabaseUri ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
51 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
52 |
iDatabase = CPosLandmarkDatabase::OpenL(aDatabaseUri); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
53 |
if ( iDatabase->IsInitializingNeeded() ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
54 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
55 |
ExecuteAndDeleteLD(iDatabase->InitializeL()); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
56 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
57 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
58 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
59 |
// ----------------------------------------------------------------------------- |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
60 |
// CLandmarkIterable::CLandmarkIterable( CPosLmItemIterator* aIterator ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
61 |
// C++ default constructor can NOT contain any code, that might leave. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
62 |
// ----------------------------------------------------------------------------- |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
63 |
// |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
64 |
CLandmarkIterable::CLandmarkIterable( CPosLmItemIterator* aIterator ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
65 |
: iIterator(aIterator) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
66 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
67 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
68 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
69 |
// ----------------------------------------------------------------------------- |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
70 |
// CLandmarkIterable::~CLandmarkIterable() |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
71 |
// Destructor. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
72 |
// ----------------------------------------------------------------------------- |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
73 |
// |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
74 |
CLandmarkIterable::~CLandmarkIterable() |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
75 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
76 |
delete iIterator; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
77 |
delete iLandmark; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
78 |
delete iDatabase; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
79 |
delete iLandmarkId; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
80 |
iCategoryIds.ResetAndDestroy(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
81 |
iCategoryIds.Close(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
82 |
ReleaseLandmarkResources(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
83 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
84 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
85 |
// ----------------------------------------------------------------------------- |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
86 |
// CLandmarkIterable::Reset() |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
87 |
// Resets the iterator. NextL has to be called to retrieve the first item. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
88 |
// ----------------------------------------------------------------------------- |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
89 |
// |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
90 |
void CLandmarkIterable::Reset() |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
91 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
92 |
iIterator->Reset(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
93 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
94 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
95 |
// ----------------------------------------------------------------------------- |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
96 |
// CLandmarkIterable::NextL( TLiwVariant& aEntry ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
97 |
// retrievs the next item in the list. |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
98 |
// ----------------------------------------------------------------------------- |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
99 |
// |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
100 |
TBool CLandmarkIterable::NextL( TLiwVariant& aEntry ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
101 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
102 |
if ( iLandmark ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
103 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
104 |
delete iLandmark; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
105 |
iLandmark = NULL; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
106 |
delete iLandmarkId; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
107 |
iLandmarkId = NULL; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
108 |
iCategoryIds.ResetAndDestroy(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
109 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
110 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
111 |
TPosLmItemId landmarkId = iIterator->NextL(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
112 |
if ( KPosLmNullItemId == landmarkId ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
113 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
114 |
return EFalse; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
115 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
116 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
117 |
TPtrC landmarkName; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
118 |
TLocality location; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
119 |
TReal32 coverageRadius; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
120 |
TPtrC iconFileName; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
121 |
TInt iconIndex; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
122 |
TInt iconMaskIndex; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
123 |
TPtrC description; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
124 |
TUint numberOfId; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
125 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
126 |
CLiwMap* landmarkMap = CLiwDefaultMap::NewL(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
127 |
CleanupClosePushL (*landmarkMap ); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
128 |
RArray<TPosLmItemId> categoryIdArray; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
129 |
CleanupClosePushL(categoryIdArray); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
130 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
131 |
iLandmark = iDatabase->ReadLandmarkLC(landmarkId); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
132 |
CleanupStack::Pop(iLandmark); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
133 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
134 |
iLandmarkId = HBufC::NewL(KMaxIDStringLength); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
135 |
iLandmarkId->Des().Num(landmarkId,EDecimal); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
136 |
landmarkMap->InsertL(KId,TLiwVariant(iLandmarkId)); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
137 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
138 |
if ( iLandmark->GetLandmarkName(landmarkName) == KErrNone ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
139 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
140 |
landmarkMap->InsertL(KLandmarkName,TLiwVariant(landmarkName)); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
141 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
142 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
143 |
if ( iLandmark->GetPosition(location) == KErrNone ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
144 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
145 |
CLiwMap* positionMap = CLiwDefaultMap::NewL(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
146 |
CleanupClosePushL (*positionMap ); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
147 |
TRealX num = location.Latitude(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
148 |
if( !num.IsNaN() ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
149 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
150 |
positionMap->InsertL(KLatitude,TLiwVariant((TReal)num)); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
151 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
152 |
num = location.Longitude(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
153 |
if( !num.IsNaN() ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
154 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
155 |
positionMap->InsertL(KLongitude,TLiwVariant((TReal)num)); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
156 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
157 |
num = location.Altitude(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
158 |
if( !num.IsNaN() ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
159 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
160 |
positionMap->InsertL(KAltitude,TLiwVariant((TReal)num)); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
161 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
162 |
num = location.HorizontalAccuracy(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
163 |
if( !num.IsNaN() ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
164 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
165 |
positionMap->InsertL(KHAccuracy,TLiwVariant((TReal)num)); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
166 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
167 |
num = location.VerticalAccuracy(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
168 |
if( !num.IsNaN() ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
169 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
170 |
positionMap->InsertL(KVAccuracy,TLiwVariant((TReal)num)); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
171 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
172 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
173 |
landmarkMap->InsertL(KLandmarkPosition,TLiwVariant(positionMap)); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
174 |
CleanupStack::PopAndDestroy (positionMap ); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
175 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
176 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
177 |
if ( iLandmark->GetCoverageRadius(coverageRadius) == KErrNone ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
178 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
179 |
landmarkMap->InsertL(KCoverageRadius,TLiwVariant(coverageRadius)); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
180 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
181 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
182 |
iLandmark->GetCategoriesL(categoryIdArray); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
183 |
TInt catCount = categoryIdArray.Count(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
184 |
if ( catCount ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
185 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
186 |
CLiwList* categoryList = CLiwDefaultList::NewL(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
187 |
CleanupClosePushL ( *categoryList ); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
188 |
for ( TInt index = 0; index < catCount; ++index ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
189 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
190 |
HBufC* catId = HBufC::NewLC(KMaxIDStringLength); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
191 |
iCategoryIds.AppendL(catId); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
192 |
CleanupStack::Pop(catId); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
193 |
catId->Des().Num(categoryIdArray[index],EDecimal); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
194 |
categoryList->AppendL(TLiwVariant(catId)); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
195 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
196 |
landmarkMap->InsertL(KCategoryInfo,TLiwVariant(categoryList)); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
197 |
CleanupStack::PopAndDestroy (categoryList ); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
198 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
199 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
200 |
if ( iLandmark->GetIcon(iconFileName,iconIndex,iconMaskIndex) == KErrNone ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
201 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
202 |
landmarkMap->InsertL(KIconFile,TLiwVariant(iconFileName)); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
203 |
landmarkMap->InsertL(KIconIndex,TLiwVariant((TInt32)iconIndex)); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
204 |
landmarkMap->InsertL(KIconMaskIndex,TLiwVariant((TInt32)iconMaskIndex)); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
205 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
206 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
207 |
if ( iLandmark->GetLandmarkDescription(description) == KErrNone ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
208 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
209 |
landmarkMap->InsertL(KLandmarkDesc,TLiwVariant(description)); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
210 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
211 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
212 |
numberOfId = iLandmark->NumOfAvailablePositionFields(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
213 |
if ( numberOfId ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
214 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
215 |
CLiwMap* fieldMap = CLiwDefaultMap::NewL(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
216 |
CleanupClosePushL (*fieldMap ); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
217 |
TPositionFieldId fieldId = iLandmark->FirstPositionFieldId(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
218 |
TPtrC fieldValue; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
219 |
TLiwVariant variant; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
220 |
while( numberOfId-- ) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
221 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
222 |
iLandmark->GetPositionField(fieldId,fieldValue); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
223 |
variant.Set(fieldValue); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
224 |
if ( EPositionFieldCountry == fieldId) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
225 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
226 |
fieldMap->InsertL(KLandmarkCountry,variant); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
227 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
228 |
if ( EPositionFieldPostalCode == fieldId) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
229 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
230 |
fieldMap->InsertL(KLandmarkAreaCode,variant); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
231 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
232 |
if ( EPositionFieldCity == fieldId) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
233 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
234 |
fieldMap->InsertL(KLandmarkCity,variant); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
235 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
236 |
if ( EPositionFieldDistrict == fieldId) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
237 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
238 |
fieldMap->InsertL(KLandmarkDistrict,variant); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
239 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
240 |
if ( EPositionFieldBuildingName == fieldId) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
241 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
242 |
fieldMap->InsertL(KLandmarkBuildingName,variant); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
243 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
244 |
if ( EPositionFieldStreet == fieldId) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
245 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
246 |
fieldMap->InsertL(KLandmarkStreet,variant); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
247 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
248 |
if ( EPositionFieldBuildingTelephone == fieldId) |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
249 |
{ |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
250 |
fieldMap->InsertL(KLandmarkTelephone,variant); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
251 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
252 |
fieldId = iLandmark->NextPositionFieldId(fieldId); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
253 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
254 |
landmarkMap->InsertL(KLandmarkFields,TLiwVariant(fieldMap)); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
255 |
CleanupStack::PopAndDestroy (fieldMap ); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
256 |
variant.Reset(); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
257 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
258 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
259 |
CleanupStack::PopAndDestroy(&categoryIdArray); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
260 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
261 |
aEntry.SetL(landmarkMap); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
262 |
CleanupStack::PopAndDestroy (landmarkMap ); |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
263 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
264 |
return ETrue; |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
265 |
} |
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
266 |
|
14df0fbfcc4e
Revision: 200912
Kiiskinen Klaus (Nokia-D-MSW/Tampere) <klaus.kiiskinen@nokia.com>
parents:
diff
changeset
|
267 |
//end of file |