/****************************************************************************************************

		IMFEditTextPart.h
		Copyright: (c) 2001 Eovia Corp. All rights reserved.

		Author:	Arnaud
		Date:	3/12/2003

****************************************************************************************************/

#ifndef __IMFEditTextPart__
#define __IMFEditTextPart__

#if CP_PRAGMA_ONCE
#pragma once
#endif


#include "MCCompObj.h"
#include "MCUITextStyle.h"

struct IMFPart;

MCDEFINE_GUID(IID_IMFEditTextPart, 0xd7efdd64, 0x7455, 0x4618, 0xba, 0x13, 0xd5, 0x48, 0x2b, 0x7a, 0xa8, 0x11);


/// Modes for the edit text
///
enum ETextKind 
{
	kTEXT_TextKind = 0,			///<	Accepts only character text (pstring).
	kTEXT_Int32Kind,			///<	Accepts/displays int32 values.
	kTEXT_Real32Kind,			///<	Accepts/displays real32 values.
	kTEXT_FourCharKind			///<	Accepts four character values and converts them to int32.
								///<	Displays int32 values as four character values.
};

/// Stucture used to get and set the options of an edit text (IMFEditTextPart)
///
struct TEditTextInfo
{
	ETextKind			fTextKind;		///< Text is of kind text, int32, or real32
	real32				fTextMin;		///< Minimum value allowed, if we're using numbers.
	real32				fTextMax;		///< Maximum value allowed, if we're using numbers.
	int32				fTextUnits;		///< The kind of units our value represents?
	int32				fDatabaseUnits;	///< What unit should be used given by setvalue and returned by getvalue ?
	int32				fDPI;			///< The pixel to inches ratio
	uint32				fMaxStrLength;	///< Max length our string can be.
	int8				fTextDecimals;	///< Number of decimals used for real32 values.
	MCTextJustification	fJustification;	///< How we shall justify our text.
	real32				fSpacing;		///< Spacing between characters.
	real32				fMultiplyBy;	///< Multiplication coeficient
	boolean				fDoRangeCheck;	///< Must we check to see if we're between textMin/textMax?
	boolean				fUseUnits;		///< Must we use textUnits to set/get our value?
	boolean				fMultiLine;		///< Does this edit field support multiple lines of text?
	boolean				fShowUnit;		///< when fUseUnits is on, you can hide the unit in the edit text field by setting this to false
};


/// \addtogroup MCF
/// \{

/// This is the interface for an Edit Text Part.
///
struct IMFEditTextPart : public IMCUnknown
{
	// ****************************************************************************
	//								GetThisPart
	// 
	/// The interface to IMFPart (always supported by IMFEditTextPart)
	/// 
	/// 
	virtual IMFPart*	MCCOMAPI GetThisPart() = 0;

	virtual void		MCCOMAPI GetTextInfo(TEditTextInfo& outInfo) const = 0;
	virtual void		MCCOMAPI SetTextInfo(const TEditTextInfo& inInfo) = 0;


	/// Returns true if the edit text sends a value changed message for every key pressed.
	virtual boolean		MCCOMAPI GetNotifyOnAllChanges(void)const = 0;

	/// Sets if the edit text should send a value changed message for every key pressed.
	virtual void		MCCOMAPI SetNotifyOnAllChanges(boolean inState) = 0;
};

/// \}


#endif

