|
1 /* |
|
2 * Copyright (c) 2002 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 - Coordinate editor for editor/viewer form |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 #ifndef CLmkCoordinateEditor_h |
|
26 #define CLmkCoordinateEditor_h |
|
27 |
|
28 // INCLUDES |
|
29 #include "CLmkFloatEditor.h" |
|
30 |
|
31 /// FORWARD DECLARATION |
|
32 class CEikMfneSymbol; |
|
33 class CLmkMfneSeparator; |
|
34 |
|
35 // CLASS DECLARATION |
|
36 |
|
37 /** |
|
38 * CLmkCoordinateEditor extend ClmkFloatEditor's functionality |
|
39 * Implements both latitude and longitude editors. |
|
40 * Underlying floating value is just a value, which user inputs. |
|
41 * Its upper limit depends on editor type: latitude or longitude. |
|
42 * Lower limit is always 0, because coordinate sign is represented |
|
43 * by cardinal point. |
|
44 * Number() always returns coordinate in degrees. Cardinal points |
|
45 * are represented by number's sign. |
|
46 */ |
|
47 class CLmkCoordinateEditor : public CLmkFloatEditor |
|
48 { |
|
49 public: |
|
50 enum TEditorType |
|
51 { |
|
52 ELatitudeEditor, |
|
53 ELongitudeEditor |
|
54 }; |
|
55 |
|
56 public: // Constructors and destructor |
|
57 /** |
|
58 * Constructor |
|
59 * @return newly instantiated object |
|
60 */ |
|
61 CLmkCoordinateEditor(); |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 virtual ~CLmkCoordinateEditor(); |
|
67 |
|
68 /** |
|
69 * By default Symbian 2nd phase constructor |
|
70 */ |
|
71 void ConstructL(TReal aInitialValue, |
|
72 TEditorType aType); |
|
73 |
|
74 public: // From CLmkFloatEditor |
|
75 |
|
76 /** Sets value */ |
|
77 void SetNumber(TReal aNumber); |
|
78 |
|
79 /** Gets value */ |
|
80 TReal Number() const; |
|
81 |
|
82 protected: // From CLmkFloatEditor |
|
83 |
|
84 void HandleValueChanged(); |
|
85 void HandleCustomFieldChanged(TInt aCustomFieldIndex); |
|
86 |
|
87 void HandleEnter(); |
|
88 void HandleExit(); |
|
89 |
|
90 protected: // new functions |
|
91 |
|
92 // only NS or WE may be shown |
|
93 enum TCardinalPoint |
|
94 { |
|
95 ECardinalNone, |
|
96 ECardinalNorth, |
|
97 ECardinalSouth, |
|
98 ECardinalEast, |
|
99 ECardinalWest |
|
100 }; |
|
101 |
|
102 /** Abs(180) is allowed only for West */ |
|
103 void CheckEastLongitude(); |
|
104 |
|
105 void SetCardinal(TCardinalPoint aUnit); |
|
106 TCardinalPoint Cardinal() const; |
|
107 TCardinalPoint DefaultCardinal(); |
|
108 |
|
109 void ConstructDegreeMarkFieldL(); |
|
110 void ConstructCardinalPointFieldL(); |
|
111 |
|
112 void ShowDegreeAndCardinal(TBool aVisible); |
|
113 |
|
114 private: //data |
|
115 |
|
116 /// Ref: |
|
117 CLmkMfneSeparator* iDegreeField; |
|
118 |
|
119 /// Ref: |
|
120 CEikMfneSymbol* iCardinalField; |
|
121 |
|
122 TEditorType iEditorType; |
|
123 |
|
124 HBufC* iDegreeMark; |
|
125 }; |
|
126 |
|
127 #endif // CLmkCoordinateEditor_h |
|
128 |
|
129 // End of File |