1 /* |
|
2 * Copyright (c) 2002-2006 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: LandmarksUi Content File - This has the class which implements all the |
|
15 * landmarks editor/viewer fields |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef CLMKFIELDS_H |
|
26 #define CLMKFIELDS_H |
|
27 |
|
28 // INCLUDES |
|
29 #include "MLmkFieldData.h" |
|
30 #include <eikenv.h> |
|
31 #include <EPos_Landmarks.h> |
|
32 #include <lbsposition.h> |
|
33 #include <CLmkEditorDlg.h> // TLmkEditorAttributes |
|
34 |
|
35 /// FORWARD DECLARATION |
|
36 class CPosLandmarkDatabase; |
|
37 class CPosLandmark; |
|
38 class TLocality; |
|
39 |
|
40 // Define Generic Landmark fields |
|
41 enum TLmkGenericPoistionId |
|
42 { |
|
43 ELmkPositionFieldPhoneNumber = EPositionFieldBuildingTelephone, |
|
44 ELmkPositionFieldWebAddress = EPositionFieldMediaLinksStart |
|
45 }; |
|
46 |
|
47 struct TLocationData |
|
48 { |
|
49 TReal64 iLatitude; |
|
50 TReal64 iLongitude; |
|
51 TReal32 iAltitude; |
|
52 TReal32 iHorizontalAccuracy; |
|
53 TReal32 iVerticalAccuracy; |
|
54 }; |
|
55 |
|
56 // CLASS DECLARATION |
|
57 |
|
58 /** |
|
59 * Landmarks fields class, include all form's fields |
|
60 */ |
|
61 class CLmkFields : public CBase |
|
62 { |
|
63 public: // Constructors and destructor |
|
64 /** |
|
65 * Two-phased constructor. |
|
66 * @param aLabelArray |
|
67 * @param aDb |
|
68 * @param aAttributes |
|
69 * @param aLandmarkId |
|
70 * @param aLandmark |
|
71 * @return newly instantiated object |
|
72 */ |
|
73 |
|
74 IMPORT_C static CLmkFields* NewL( RPointerArray<HBufC>& aLabelArray, |
|
75 CPosLandmarkDatabase& aDb, |
|
76 TLmkEditorAttributes aAttributes, |
|
77 TPosLmItemId aLandmarkId, |
|
78 CPosLandmark* aLandmark, |
|
79 TBool aJapaneseInputMode ); |
|
80 |
|
81 /** |
|
82 * Destructor. |
|
83 */ |
|
84 IMPORT_C virtual ~CLmkFields(); |
|
85 |
|
86 private: |
|
87 /** |
|
88 * C++ default constructor. |
|
89 * @param aLabelArray |
|
90 * @param aDb |
|
91 * @param aAttributes |
|
92 * @param aLandmarkId |
|
93 * @param aLandmark |
|
94 * @return newly instantiated object |
|
95 */ |
|
96 CLmkFields( RPointerArray<HBufC>& aLabelArray, |
|
97 CPosLandmarkDatabase& aDb, |
|
98 TLmkEditorAttributes aAttributes, |
|
99 TPosLmItemId aLandmarkId, |
|
100 CPosLandmark* aLandmark, |
|
101 TBool aJapaneseInputMode ); |
|
102 |
|
103 /** |
|
104 * By default Symbian 2nd phase constructor is private. |
|
105 */ |
|
106 void ConstructL(); |
|
107 |
|
108 public: //new functions |
|
109 /** |
|
110 * Return reference to fieldData array |
|
111 * @return MLmkFieldData array |
|
112 */ |
|
113 IMPORT_C CArrayPtrFlat<MLmkFieldData>& Fields(); |
|
114 |
|
115 /** |
|
116 * Save fields |
|
117 */ |
|
118 IMPORT_C void SaveFieldsL(); |
|
119 |
|
120 /** |
|
121 * Delete landmark |
|
122 */ |
|
123 IMPORT_C void DeleteLandmarkL(); |
|
124 |
|
125 /** |
|
126 * Get one specific field from array |
|
127 * Not give Ownership |
|
128 * @param aFieldType |
|
129 * @return Pointer to MLmkFieldData |
|
130 */ |
|
131 IMPORT_C MLmkFieldData* GetField( TUint16 aFieldType ); |
|
132 |
|
133 /** |
|
134 * Get landmark id. If called before landmark is stored |
|
135 * into database it will be KPosLmNullItemId. |
|
136 * @return landmark id |
|
137 */ |
|
138 IMPORT_C TPosLmItemId LandmarkId() const; |
|
139 /** |
|
140 * Checks the disc space level whether is is enough to store a landmark or not |
|
141 * @return KErrDiscFull if disc is full or KErrNone otherwise |
|
142 */ |
|
143 IMPORT_C TInt CheckDiscSpaceL(); |
|
144 |
|
145 /** |
|
146 * Replace character 0x2029(suppose to be enter char) with space char |
|
147 * @param aText source string |
|
148 * @return modified string |
|
149 */ |
|
150 IMPORT_C static TPtr RemoveEnterCharacter( TPtrC aText ); |
|
151 |
|
152 private: //new functions |
|
153 /** |
|
154 * Create all fields |
|
155 */ |
|
156 void CreateLmkFieldsL(); |
|
157 // Create fields for Japanese style |
|
158 void CreateLmkFieldsInJapaneseModeL(); |
|
159 |
|
160 // Create fields for normal mode |
|
161 void CreateLmkFieldsInNormalModeL(); |
|
162 |
|
163 /** |
|
164 * Create specific fields |
|
165 */ |
|
166 |
|
167 |
|
168 void CreateNameFieldL( TInt aPos ); |
|
169 void CreateCategoryFieldL(); |
|
170 void CreateStreetFieldL( TInt aPos ); |
|
171 void CreateCityFieldL( TInt aPos ); |
|
172 void CreateStateProvinceFieldL( TInt aPos ); |
|
173 void CreateCountryFieldL( TInt aPos ); |
|
174 void CreatePostCodeFieldL( TInt aPos ); |
|
175 void CreateLatitudeFieldsL( TInt aPos ); |
|
176 void CreateLongitudeFieldsL( TInt aPos ); |
|
177 void CreatePositionAccuracyFieldL( TInt aPos ); |
|
178 void CreateAltitudeFieldL( TInt aPos ); |
|
179 void CreateAltitudeAccuracyFieldL( TInt aPos ); |
|
180 void CreateDescriptionFieldL( TInt aPos ); |
|
181 void CreatePhoneNumberFieldL( TInt aPos ); |
|
182 void CreateWebAddressFieldL( TInt aPos ); |
|
183 private: //data |
|
184 /// |
|
185 TLocationData iLocationData; |
|
186 |
|
187 /// Reference to database |
|
188 CPosLandmarkDatabase& iDb; |
|
189 |
|
190 // editors attributes |
|
191 TLmkEditorAttributes iAttributes; |
|
192 |
|
193 /// TPosLmItemId |
|
194 TPosLmItemId iLandmarkId; |
|
195 |
|
196 ///Ref: Landmark |
|
197 CPosLandmark* iLandmark; |
|
198 |
|
199 /// TLocality variable |
|
200 TLocality iLocality; |
|
201 |
|
202 /// Own: fields array |
|
203 CArrayPtrFlat<MLmkFieldData> iFieldsArray; |
|
204 |
|
205 ///Ref: |
|
206 RPointerArray<HBufC>* iLabelArray; |
|
207 |
|
208 /// Is new landmark created |
|
209 TBool iNewLandmark; |
|
210 // Japanese Input Mode |
|
211 TBool iJapaneseMode; |
|
212 }; |
|
213 |
|
214 #endif // CLMKFIELDS_H |
|
215 |
|
216 // End of File |
|