landmarksui/uicontrols/inc/CLmkFloatEditor.h
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:31:27 +0100
branchRCL_3
changeset 18 870918037e16
parent 0 522cd55cc3d7
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201033 Kit: 201035

/*
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:    LandmarksUi Content File -    Implements float editor's functionality.
*
*/








#ifndef CLmkFloatEditor_h
#define CLmkFloatEditor_h

//  INCLUDES
#include <EikMfne.h>
class CLmkMfneFloat;

// CLASS DECLARATION

/**
* CLmkFloatEditor class
* Contain two number editor and one separator.
*/
class CLmkFloatEditor : public CEikMfne
    {
    public:  // Constructors and destructor
        /**
         * Create CLmkFloatEditor object
         * @return newly instantiated object
         */
        CLmkFloatEditor();

        /**
         * Destructor.
         */
        virtual ~CLmkFloatEditor();

    protected:

		/**
		* By default Symbian 2nd phase constructor
        * @param aNumberOfFields field array's size
		*/
		void BaseConstructL(TInt aNumberOfFields = 1);

        /** Creates floating point value field
         *  and adds it to the array of Mfne fields
         *  @param aMaxNumSignificantDigits number of digits in float editor
         */
        void ConstructValueFieldL(
            TInt aMaxNumSignificantDigits,
            TInt aMaxDecimals);

    public:

        /** Sets value */
	    virtual void SetNumber(TReal aNumber);

        /** Gets value */
	    virtual TReal Number() const;

	    /** Whether value in this editor was modified by user */
	    TBool IsModified();

        /** Shortcut to know if current value is NaN */
        TBool IsNan();

    public: // From CCoeControl;

        void FocusChanged(TDrawNow aDrawNow);
        TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);

    protected: // from CEikMfne

	protected: //new functions

        TBool SetLimits(TReal aMinimumValue, TReal aMaximumValue);
        void GetLimits(TReal& aMinimumValue, TReal& aMaximumValue);

        virtual void HandleValueChanged();
        virtual void HandleCustomFieldChanged(TInt aCustomFieldIndex);

        virtual void HandleEnter();
        virtual void HandleExit();

        TInt FindValueField();
        void HighlightField(TInt aFieldPosition);

    private: //data
        // Ref:
        CLmkMfneFloat*  iValueField;

        // Whether value in this editor was modified by user
        TBool           iIsModified;

        TBool           iIsMirroredLayout;
    };

#endif      // CLmkFloatEditor_h

// End of File