landmarksui/uicontrols/inc/CLmkFloatEditor.h
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     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 -    Implements float editor's functionality.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #ifndef CLmkFloatEditor_h
       
    26 #define CLmkFloatEditor_h
       
    27 
       
    28 //  INCLUDES
       
    29 #include <EikMfne.h>
       
    30 class CLmkMfneFloat;
       
    31 
       
    32 // CLASS DECLARATION
       
    33 
       
    34 /**
       
    35 * CLmkFloatEditor class
       
    36 * Contain two number editor and one separator.
       
    37 */
       
    38 class CLmkFloatEditor : public CEikMfne
       
    39     {
       
    40     public:  // Constructors and destructor
       
    41         /**
       
    42          * Create CLmkFloatEditor object
       
    43          * @return newly instantiated object
       
    44          */
       
    45         CLmkFloatEditor();
       
    46 
       
    47         /**
       
    48          * Destructor.
       
    49          */
       
    50         virtual ~CLmkFloatEditor();
       
    51 
       
    52     protected:
       
    53 
       
    54 		/**
       
    55 		* By default Symbian 2nd phase constructor
       
    56         * @param aNumberOfFields field array's size
       
    57 		*/
       
    58 		void BaseConstructL(TInt aNumberOfFields = 1);
       
    59 
       
    60         /** Creates floating point value field
       
    61          *  and adds it to the array of Mfne fields
       
    62          *  @param aMaxNumSignificantDigits number of digits in float editor
       
    63          */
       
    64         void ConstructValueFieldL(
       
    65             TInt aMaxNumSignificantDigits,
       
    66             TInt aMaxDecimals);
       
    67 
       
    68     public:
       
    69 
       
    70         /** Sets value */
       
    71 	    virtual void SetNumber(TReal aNumber);
       
    72 
       
    73         /** Gets value */
       
    74 	    virtual TReal Number() const;
       
    75 
       
    76 	    /** Whether value in this editor was modified by user */
       
    77 	    TBool IsModified();
       
    78 
       
    79         /** Shortcut to know if current value is NaN */
       
    80         TBool IsNan();
       
    81 
       
    82     public: // From CCoeControl;
       
    83 
       
    84         void FocusChanged(TDrawNow aDrawNow);
       
    85         TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
       
    86 
       
    87     protected: // from CEikMfne
       
    88 
       
    89 	protected: //new functions
       
    90 
       
    91         TBool SetLimits(TReal aMinimumValue, TReal aMaximumValue);
       
    92         void GetLimits(TReal& aMinimumValue, TReal& aMaximumValue);
       
    93 
       
    94         virtual void HandleValueChanged();
       
    95         virtual void HandleCustomFieldChanged(TInt aCustomFieldIndex);
       
    96 
       
    97         virtual void HandleEnter();
       
    98         virtual void HandleExit();
       
    99 
       
   100         TInt FindValueField();
       
   101         void HighlightField(TInt aFieldPosition);
       
   102 
       
   103     private: //data
       
   104         // Ref:
       
   105         CLmkMfneFloat*  iValueField;
       
   106 
       
   107         // Whether value in this editor was modified by user
       
   108         TBool           iIsModified;
       
   109 
       
   110         TBool           iIsMirroredLayout;
       
   111     };
       
   112 
       
   113 #endif      // CLmkFloatEditor_h
       
   114 
       
   115 // End of File