|
1 /* |
|
2 * Copyright (c) 2005-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: Header file for CFMRadioFrequencyNumber |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CFMRADIOFREQUENCYNUMBER_H |
|
20 #define CFMRADIOFREQUENCYNUMBER_H |
|
21 |
|
22 #include <eikmfne.h> |
|
23 |
|
24 /** Flags */ |
|
25 enum |
|
26 { |
|
27 EFillWithLeadingZeros =0x1, |
|
28 EPreserveOldWidthBeforeEditing =0x2, |
|
29 ERepresentsYear =0x4, |
|
30 EPublicallySettableFlags =EFillWithLeadingZeros|EPreserveOldWidthBeforeEditing|ERepresentsYear, |
|
31 EIsBeingEditedWithCursor =0x8, |
|
32 EIsUninitialised =0x10 |
|
33 }; |
|
34 |
|
35 /** |
|
36 * Custom field for frequency number. |
|
37 */ |
|
38 class CFMRadioFrequencyNumber : public CEikMfneField |
|
39 { |
|
40 |
|
41 public: // Methods |
|
42 |
|
43 /** |
|
44 * Static constructor. |
|
45 */ |
|
46 static CFMRadioFrequencyNumber* NewL( |
|
47 const CFont& aFont, |
|
48 TInt aMinimumValue, |
|
49 TInt aMaximumValue, |
|
50 TInt aInitialValue, |
|
51 TUint32 aFlags ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 ~CFMRadioFrequencyNumber(); |
|
57 |
|
58 /** |
|
59 * Sets new value in this number field. |
|
60 * |
|
61 * @param aValue New value |
|
62 * @param aFont Current font |
|
63 */ |
|
64 void SetValue( TInt aValue, const CFont& aFont ); |
|
65 |
|
66 /** |
|
67 * Gets the value in this number field. |
|
68 * |
|
69 * @return Value |
|
70 */ |
|
71 TInt Value() const; |
|
72 |
|
73 /** |
|
74 * Sets digit type of this number field. |
|
75 * |
|
76 * @param aDigitType New digit type |
|
77 * @param aFont Current font |
|
78 */ |
|
79 void SetDigitType( TDigitType aDigitType, const CFont& aFont ); |
|
80 |
|
81 /** |
|
82 * Gets digit type of this number field. |
|
83 * |
|
84 * @return aDigitType Digit type |
|
85 */ |
|
86 TDigitType DigitType() const; |
|
87 |
|
88 // from base class CEikMfneField |
|
89 /** |
|
90 * From CEikMfneField |
|
91 * |
|
92 * @see CEikMfneField::IsValid() |
|
93 */ |
|
94 TBool IsValid() const; |
|
95 |
|
96 /** |
|
97 * From CEikMfneField |
|
98 * |
|
99 * @see CEikMfneField::IsEditable. |
|
100 */ |
|
101 TBool IsEditable() const; |
|
102 |
|
103 /** |
|
104 * From CEikMfneField |
|
105 * |
|
106 * @see CEikMfneField::HighlightType. |
|
107 */ |
|
108 THighlightType HighlightType() const; |
|
109 |
|
110 /** |
|
111 * From CEikMfneField |
|
112 * CEikMfneField::HandleKey( |
|
113 * const CFont& aFont, |
|
114 * const TKeyEvent& aKeyEvent, |
|
115 * TBool aInterpretLeftAndRightAsEarEvents, |
|
116 * TBool& aDataAltered, |
|
117 * TInt& aHighlightIncrement |
|
118 */ |
|
119 void HandleKey( |
|
120 const CFont& aFont, |
|
121 const TKeyEvent& aKeyEvent, |
|
122 TBool aInterpretLeftAndRightAsEarEvents, |
|
123 TBool& aDataAltered, |
|
124 TInt& aHighlightIncrement ); |
|
125 |
|
126 /** |
|
127 * From CEikMfneField |
|
128 * |
|
129 * @see CEikMfneField::HandleDeHighlight( |
|
130 * const CFont& aFont, |
|
131 * CEikonEnv& aEikonEnv, |
|
132 * TBool& aDataAltered, |
|
133 * TBool& aError ) |
|
134 */ |
|
135 void HandleDeHighlight( |
|
136 const CFont& aFont, |
|
137 CEikonEnv& aEikonEnv, |
|
138 TBool& aDataAltered, |
|
139 TBool& aError); |
|
140 |
|
141 protected: // Methods |
|
142 |
|
143 private: //Methods |
|
144 |
|
145 /** |
|
146 * C++ default constructor. |
|
147 */ |
|
148 CFMRadioFrequencyNumber( |
|
149 TInt aMinimumValue, |
|
150 TInt aMaximumValue, |
|
151 TUint32 aFlags ); |
|
152 |
|
153 /** |
|
154 * By default Symbian 2nd phase constructor is private. |
|
155 */ |
|
156 void ConstructL( const CFont& aFont, TInt aInitialValue ); |
|
157 |
|
158 /** |
|
159 * Gets maximum width of this field in pixels. |
|
160 */ |
|
161 TInt MaximumWidthInPixels( |
|
162 const CFont& aFont, |
|
163 TBool aShrinkToMinimumSize ); |
|
164 |
|
165 /** |
|
166 * Gets input capabilities of this field. |
|
167 */ |
|
168 TCoeInputCapabilities InputCapabilities() const; |
|
169 |
|
170 /** |
|
171 * Get textual representation of the value in this field. |
|
172 */ |
|
173 const TDesC& Text() const; |
|
174 |
|
175 /** |
|
176 * Gets numerical representation of the value in this field. |
|
177 */ |
|
178 TInt ValueFromText() const; |
|
179 |
|
180 private: // Data |
|
181 /** |
|
182 * Minimum value of this field. |
|
183 */ |
|
184 TInt iMinimumValue; |
|
185 |
|
186 /** |
|
187 * Maximum value of this field. |
|
188 */ |
|
189 TInt iMaximumValue; |
|
190 |
|
191 /** |
|
192 * Maximum number of digits value in this field. |
|
193 */ |
|
194 TInt iMaxDigits; |
|
195 |
|
196 /** |
|
197 * Flags of this field. |
|
198 */ |
|
199 TUint32 iFlags; |
|
200 |
|
201 /** |
|
202 * Holds the value of this field. |
|
203 */ |
|
204 HBufC* iText; |
|
205 |
|
206 /** |
|
207 * Digit type of this field. |
|
208 */ |
|
209 TDigitType iDigitType; |
|
210 |
|
211 }; |
|
212 |
|
213 #endif // CFMRADIOFREQUENCYNUMBER_H |
|
214 |