|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef LANDMARKS_H_ |
|
22 #define LANDMARKS_H_ |
|
23 |
|
24 #include "engine.h" |
|
25 #include "creator_modulebase.h" |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <EPos_Landmarks.h> |
|
29 |
|
30 class CLandmarkParameters; |
|
31 class CPosLandmarkDatabase; |
|
32 class CPosLmOperation; |
|
33 |
|
34 static const TInt KLandmarkFieldLength = 256; |
|
35 |
|
36 class CCreatorLandmarks : public CCreatorModuleBase |
|
37 { |
|
38 public: |
|
39 static CCreatorLandmarks* NewL(CCreatorEngine* aEngine); |
|
40 static CCreatorLandmarks* NewLC(CCreatorEngine* aEngine); |
|
41 ~CCreatorLandmarks(); |
|
42 |
|
43 private: |
|
44 CCreatorLandmarks(); |
|
45 void ConstructL(CCreatorEngine* aEngine); // from MCreatorModuleBase |
|
46 TPosLmItemId GetCategoryIdL( TPosLmGlobalCategory aGlobalCategoryID ); |
|
47 |
|
48 public: |
|
49 TBool AskDataFromUserL( TInt aCommand ); // from MCreatorModuleBase |
|
50 |
|
51 TInt CreateLandmarkEntryL(CLandmarkParameters *aParameters); |
|
52 static TPosLmGlobalCategory GetCategoryIdL(const TDesC& aCategoryStr); |
|
53 void DeleteAllL(); |
|
54 void DeleteAllCreatedByCreatorL(); |
|
55 |
|
56 private: |
|
57 CPosLandmarkDatabase* iLandmarkDb; |
|
58 CLandmarkParameters* iParameters; |
|
59 CPosLmOperation* iLmOperation; |
|
60 RArray<TPosLmItemId> iEntryIds; // TPosLmItemId (==TUint32) CPosLandmark::LandmarkId() |
|
61 public: |
|
62 }; |
|
63 |
|
64 |
|
65 class CLandmarkParameters : public CCreatorModuleBaseParameters |
|
66 { |
|
67 public: |
|
68 HBufC* iName; |
|
69 RArray<TUint> iCategories; |
|
70 HBufC* iStreet; |
|
71 HBufC* iCity; |
|
72 HBufC* iState; |
|
73 HBufC* iCountry; |
|
74 HBufC* iPostCode; |
|
75 HBufC* iDescription; |
|
76 HBufC* iPhonenumber; |
|
77 HBufC* iUrl; |
|
78 TReal64 iLatitude; |
|
79 TReal64 iLongitude; |
|
80 TReal32 iPositionAccuracy; |
|
81 TReal32 iAltitude; |
|
82 TReal32 iAltitudeAccuracy; |
|
83 |
|
84 void SetRandomNameL(CCreatorEngine& aEngine); |
|
85 void SetRandomUrlL(CCreatorEngine& aEngine); |
|
86 void AddRandomCategoryL(CCreatorEngine& aEngine); |
|
87 void SetRandomStreetL(CCreatorEngine& aEngine); |
|
88 void SetRandomCityL(CCreatorEngine& aEngine); |
|
89 void SetRandomStateL(CCreatorEngine& aEngine); |
|
90 void SetRandomCountryL(CCreatorEngine& aEngine); |
|
91 void SetRandomPostCodeL(CCreatorEngine& aEngine); |
|
92 void SetRandomLatitudeL(CCreatorEngine& aEngine); |
|
93 void SetRandomLongitudeL(CCreatorEngine& aEngine); |
|
94 void SetRandomPositionAccuracyL(CCreatorEngine& aEngine); |
|
95 void SetRandomAltitudeL(CCreatorEngine& aEngine); |
|
96 void SetRandomAltitudeAccuracyL(CCreatorEngine& aEngine); |
|
97 void SetRandomDescriptionL(CCreatorEngine& aEngine); |
|
98 void SetRandomPhoneNumberL(CCreatorEngine& aEngine); |
|
99 |
|
100 private: |
|
101 |
|
102 public: |
|
103 CLandmarkParameters(); |
|
104 ~CLandmarkParameters(); |
|
105 }; |
|
106 #endif /*LANDMARKS_H_*/ |