#ifndef __IMFSliderPart__
#define __IMFSliderPart__
/****************************************************************************************

		IMFSliderPart.h

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

		Author:	Emil
		Date:	9/15/99

		COM interface to internal slider objects.

		Revision History

		when		who			what & why
		==========	==========	======================================================

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

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "MCCompObj.h"
struct IMFPart;

MCDEFINE_GUID(IID_IMFSliderPart, 0xa9637766, 0x6bb3, 0x11d3, 0xa7, 0xfa, 0x0, 0x60, 0x97, 0xb, 0xc5, 0x21);
MCDEFINE_GUID(IID_IMFLinearSliderPart, 0xd5e04751, 0x9354, 0x4f4a, 0x98, 0x22, 0xa3, 0x5f, 0x68, 0xf1, 0x5a, 0x85);

/// \addtogroup MCF
/// \{

/// <P>Interface for a slider part.  Sliders present a handle ("thumb") on a slider that the user
/// can move one way or the other to select a value.  Sliders can have multiple thumbs, each 
/// with a value.  To access the values of each slider, use the GetValue() function.  If the 
/// slider has one thumb, call it with a kReal32ParamType.  If the slider has two, call it with a 
/// kVector2ParamType, and if it has three thumbs, use a kVector3ParamType.  For more than three
/// thumbs, things are not so simple. Please contact us for details should you need sliders
/// with more than three thumbs.</P>
/// \see IMFPart::GetValue()
/// 
struct IMFSliderPart : public IMCUnknown
{
	/// Sets the slider title
	virtual void		MCCOMAPI SetTitle(const TMCString& inTitle) = 0;

	// -Description:
	//		Sets the bounds of the slider
	// -Parameters:
	//		min: the minimum value allowed for the slider
	//		max: the maximum value allowed for the slider
	//		resetValues: tells if the old value(s) should be clamped into the new [min, max]
	//	
	virtual void		MCCOMAPI SetMinMax(real32 min, real32 max, boolean resetValues = true) = 0;
	
	// -Returns: the snap increment	
	virtual real32		MCCOMAPI GetSnap() = 0;

	// -Description: sets the snap increment
	virtual void		MCCOMAPI SetSnap(real32 snap) = 0;

	// -Returns: the number of thumbs (indexes) of the slider
	virtual int32		MCCOMAPI GetNbThumbs() = 0;

	// -Description:
	//		Adds a new thumb to the slider		
	//
	// -Parameters:
	//		index:	the new thumb's index
	//		value:	the value for the new thumb
	virtual void		MCCOMAPI AddThumb(int32 index, real32 value) = 0;

	// -Description:
	//		Removes a thumb from the slider		
	//
	// -Parameters:
	//		index: index of the thumb to remove	
	virtual void		MCCOMAPI RemoveThumb(int32 index) = 0;

	
	// -Returns: the interface to IMFPart (always supported by IMFSliderPart)
	virtual IMFPart*	MCCOMAPI GetThisPart() = 0;
	
};


/// <P>Interface for a linear slider part.
/// \see IMFSliderPart

struct IMFLinearSliderPart : public IMCUnknown
{
	/// Sets use or not of a custom display range
	virtual void		MCCOMAPI SetUseCustomDisplayedRange(boolean useCustomRange) = 0;

	/// Sets the min/max value that is displayed (not this is not the min/max of the slider part, the
	/// user can still enter a different value using the edit text)
	virtual void		MCCOMAPI SetMinMaxDisplayedValue(real32 minDiplayed, real32 maxDisplayed) = 0;

	/// Gets the current min/max value that is displayed
	virtual void		MCCOMAPI GetMinMaxDisplayedValue(real32& minDiplayed, real32& maxDisplayed) = 0;
};


enum ESliderAttributes //Attributes for TMFSlider
{
	kThumbs_Token					= 'NbTh', //kInt32ParamType:			the number of thumbs
	kSnpValue_Token					= 'SnpV', //kReal32ParamType:			percent to snap to 	
	kFirstThumbImageID				= 'ThI1', //kInt16ParamType:			resID of 1st thumb image
	kSecondThumbImageID				= 'ThI2', //kInt16ParamType:			resID of 2nd thumb image
	kThirdThumbImageID				= 'ThI3', //kInt16ParamType:			resID of 3rd thumb image
	kDisplayType_Token				= 'DiTy', //kInt32ParamType:			ESliderDisplayType
	kNbDecimals_Token				= 'NbDc', //kInt32ParamType:			number of decimals displayed
	kDisplayParts_Token				= 'DiPa', //kInt32ParamType:			ESliderDisplayParts
	kAllowOverlapping_Token			= 'AlOv', //kBooleanParamType:			allows the thumbs to overlap
	kDisplayBoundsAsThumbs_Token	= 'DBaT', //kBooleanParamType:			The bounds are displayed as static thumbs
	kDisplayOnly_Token				= 'DiOn', //kBooleanParamType:			allows or not the user to move the slider
	kAddRemoveThumbs_Token			= 'AdRe', //kBooleanParamType:			allows or not the user to add thumbs
	kTitle_Token					= 'SlTi', //kMCDynamicStringParamType:	The slider's title
	kCurValue_Token					= 'CurV', //kReal32ParamType:			the value of the active thumb
	kMinValue_Token					= 'MinV', //kReal32ParamType:			the min value for the slider
	kMaxValue_Token					= 'MAxV', //kReal32ParamType:			the max value for the slider
	kDisplayValueFactor_Token		= 'ValF', //kReal32ParamType:			multiplies the internal value for display (only when kDisplayNormal)
};


enum ELinearSliderAttributes //Attributes for TMFLinearSliderPart
{
	kFirstRailImageID				= 'RlI1', //kInt16ParamType:			resID of 1st rail part
	kSecondRailImageID				= 'RlI2', //kInt16ParamType:			resID of 2nd rail part
	kThirdRailImageID				= 'RlI3', //kInt16ParamType:			resID of 3rd rail part	
	kDisplayScale_Token				= 'ScDi', //kInt32ParamType:			ELinearSliderDisplayScale
	kTitleAndValueDisplayRatio_Token= 'TDRa', //kVector2ParamType:			forces the length of the title/value to be a given percent of the total size of the slider
	kMinValueDisplayed_Token		= 'MnDp', //kReal32ParamType:			the value displayed as min (>= fMin)
	kMaxValueDisplayed_Token		= 'MxDp', //kReal32ParamType:			the value displayed as max (<= fMax)
	kCustomDisplayRange_Token		= 'CstR', //kBooleanParamType:			allow user to override displayed min/max through the edittext
	kLinearSliderValueDefaultWidth_Token	= 'LSVW', //kInt32ParamType:	allow user to override the default width of the edit text's value
};


enum ELinearSliderDisplayScale
{
	kDisplayScaleNormal= 0, 
	kDisplayScaleLeftLog, 
	kDisplayScaleCenterLog, 
	kDisplayScaleRightLog,

	kInvalidLinearSliderDisplayScale= 0xFFFFFFFF
};


enum ESliderDisplayType
{	
	kDisplayNormal	= 0, 
	kDisplayPercent	, 
	kDisplayDegree, 
	kDisplayPercentMapMinMax,

	kInvalidSliderDisplayType= 0xFFFFFFFF
};


enum ESliderDisplayParts
{
	kDisplayAllParts=0, 
	kDisplayOnlyRail, 
	kDisplayValueAligned,

	kInvalidSliderDisplayParts= 0xFFFFFFFF
};

/// \}
#endif

