// EIKFPNE.H
//
// Copyright (c) 1997-1999 Symbian Ltd.  All rights reserved.
//

#ifndef __EIKFPNE_H__
#define __EIKFPNE_H__

#ifndef __EIKEDWIN_H__
#include <eikedwin.h>
#endif

class CEikFloatingPointEditor : public CEikEdwin
	{
public:
	IMPORT_C CEikFloatingPointEditor();
	IMPORT_C void ConstructL(const TReal& aMin,const TReal& aMax,TInt aTextLimit);
	IMPORT_C TReal Value() const;
	IMPORT_C void SetValueL(const TReal* aValue);
	IMPORT_C void SetMinMax(TReal aMin,TReal aMax);
	IMPORT_C void GetMinMax(TReal& aMin,TReal& aMax) const;
public: // framework
	IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aReader);
	IMPORT_C virtual void PrepareForFocusLossL();
private:
	TReal iValue;
	TReal iMin;
	TReal iMax;
	};

class CEikFixedPointEditor : public CEikEdwin
	{
public:
	IMPORT_C CEikFixedPointEditor();
	IMPORT_C void ConstructL(TInt aMin,TInt aMax);
	IMPORT_C TInt Value() const;
	IMPORT_C void SetValueL(const TInt* aValue);
	IMPORT_C void SetMinMax(TInt aMin, TInt aMax);
	IMPORT_C void GetMinMax(TInt& aMin, TInt& aMax) const;
	IMPORT_C void SetDecimalPlaces(TInt aDecimalPlaces);
	IMPORT_C TInt DecimalPlaces() const;
public:	// framework
	IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aReader);
	IMPORT_C virtual void PrepareForFocusLossL();
private:
	TInt RequiredNumberOfCharacters() const;
private:
	TInt iValue;
	TInt iMin;
	TInt iMax;
	TInt iDecimalPlaces;
	};

class CEikTwipsEditor : public CEikEdwin
	{
public:
	IMPORT_C CEikTwipsEditor();
	IMPORT_C void ConstructL(TInt aMin,TInt aMax);
	IMPORT_C TInt Value() const;
	IMPORT_C void SetValueL(const TInt* aValue);
	IMPORT_C void SetMinMax(TInt aMin, TInt aMax);
	IMPORT_C void GetMinMax(TInt& aMin, TInt& aMax) const;
	IMPORT_C void SetUnits(TUnitsFormat aUnitsFormat);
	IMPORT_C TUnitsFormat Units();
public:	// framework
	IMPORT_C virtual void ConstructFromResourceL(TResourceReader& aReader);
	IMPORT_C virtual void PrepareForFocusLossL();
private:
	TInt RequiredNumberOfCharacters() const;
private:
	TInt iValue;
	TInt iMin;
	TInt iMax;
	TUnitsFormat iUnits;
	};

class Twips
	{
public:
	// Use locale information to determine units
	IMPORT_C static void TwipsToString(TInt aTwips, TInt aDecimalPlaces, TDes& aDes);
	IMPORT_C static TBool StringToTwips(const TDes& aDes, TInt& aTwips);// returns false if string invalid
	// Use units passed as parameter
	IMPORT_C static void TwipsToString(TInt aTwips, TUnitsFormat aUnitsFormat, TInt aDecimalPlaces, TDes& aDes);
	IMPORT_C static TBool StringToTwips(const TDes& aDes, TUnitsFormat aUnitsFormat, TInt& aTwips);// returns false if string invalid
	};

#endif
