2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Numeric Editor derived from Uikon's CEikEdwin
15 * These specializations of CEikEdwin maintain a numeric content,
16 * access methods and validation.
22 #if !defined(__AKNNUMEDWIN_H__)
23 #define __AKNNUMEDWIN_H__
27 #include <aknnumed.h> // CAknNumericEdwin
30 _LIT( KAknIntegerFormat, "%d" );
35 * The CAknIntegerEdwin class implements an editor for an integer values.
37 * The editor has an associated resource struct @c AVKON_INTEGER_EDWIN and
38 * control factory identifier @c EAknCtIntegerEdwin.
40 * @since Series 60 0.9
42 class CAknIntegerEdwin : public CAknNumericEdwin
46 * Two-phased constructor.
47 * @param aMin The minimum allowable value.
48 * @param aMax The maximum allowable value.
49 * @param aMaxChars The maximum allowable number of the digits.
50 * @return Pointer to a fully constructed editor object.
52 IMPORT_C static CAknIntegerEdwin* NewL(TInt aMin,
57 * Constructs controls from a resource file.
58 * Function reads needed values from a @c AVKON_INTEGER_EDWIN resource.
59 * Essential for Dialog/Form construction.
60 * @param aReader The resource reader with which to access the control's
63 IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aReader);
66 * 2nd phase constructor.
67 * @param aMin The minimum allowable value.
68 * @param aMax The maximum allowable value.
69 * @param aMaxChars The maximum allowable number of the digits.
71 IMPORT_C void ConstructL( TInt aMin, TInt aMax, TInt aMaxChars );
76 * Sets the current value of the editor.
77 * The control is not redrawn.
78 * @param aValue Current value of the editor.
80 IMPORT_C void SetValueL(TInt aValue);
83 * Sets the value that is returned when the editor field is left empty or
85 * @param aUnsetValue The default value to be returned.
87 IMPORT_C void SetUnsetValue( TInt aUnsetValue);
90 * Gets the current value of the editor.
91 * Validity of the value is checked, if the editor is empty, the unset value
92 * is used. The value is put into aValue parameter even if it is not valid.
93 * @param aValue Reference to the integer used to store the value got from
95 * @return Indicates the validation status.
97 IMPORT_C TValidationStatus GetTextAsInteger( TInt& aValue );
100 * Sets the minimum allowable value of the editor.
101 * @param aMinimumValue The minimum value.
103 IMPORT_C void SetMinimumIntegerValue( TInt aMinimumValue );
106 * Sets the maximum allowable value of the editor.
107 * @param aMaximumValue The maximum value.
109 IMPORT_C void SetMaximumIntegerValue( TInt aMaximumValue );
113 * From @c CCoeControl. Prepares for focus loss.
114 * Called by the framework just before focus is removed from the control.
116 IMPORT_C void PrepareForFocusLossL();
119 * From @c CCoeControl. Handles a change to the control's resources.
120 * @since Series 60 2.0
121 * @param aType a message UID value.
123 IMPORT_C void HandleResourceChange(TInt aType);
126 * From @c CCoeControl. Handles key events.
127 * Called by framework when a key event occurs.
128 * @since Series 60 2.0
129 * @param aKeyEvent The key event that occured.
130 * @param aType The type of key event that occured.
131 * @return @c EKeyWasConsumed if the event was processed,
132 * @c EKeyWasNotConsumed if the event was not processed.
134 IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
137 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
140 * Checks if the number of the editor is within the min and max boundaries.
141 * If not, the method set the number to closest legal value and highlights the
142 * number text in the editor.
144 IMPORT_C TBool CheckNumber();
147 void CommonConstructL(TInt aMin,
153 void RefreshFromLocale();
158 IMPORT_C void* ExtensionInterface( TUid aInterface );
160 private: // from CEikEdwin
161 IMPORT_C void Reserved_3();
168 TDigitType iDigitType;
169 TInt iSpare_Integer_2;