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

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

		Author:	Arnaud
		Date:	5/22/2003

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

#ifndef __IMFSplitBarPart__
#define __IMFSplitBarPart__

#if CP_PRAGMA_ONCE
#pragma once
#endif


#include "MCCompObj.h"


MCDEFINE_GUID(IID_IMFSplitBarPart, 0x15533a6f, 0x2e91, 0x4342, 0x9d, 0x58, 0x2a, 0x5f, 0x5, 0x9b, 0x17, 0x29);

/// \addtogroup MCF
/// \{

enum ESplitDirection
{ 
	kAutoSplit		= 0,	///<split direction computed from split bar's size (fSize.x >= fSize.y => kVerticalSplit)
	kVerticalSplit	= 1,	///<changes the vertical size and positions of the controled parts
	kHorizontalSplit= 2,	///<changes the horizontal size and positions of the controled parts

	kInvalidSplitDirection	= 0xFFFFFFFF
};


enum ESplitMode
{
	kBasicSplitMode				= 0,	///<compatibility mode
	kConstantRatioSplitMode		= 1,	///<the split position stays at a constant proportion of the parent's size
	kPreferedSizeSplitMode		= 2,	///<the split bar tries to give the prefered part the prefered size (but always stays visible)

	kInvalidSplitMode	= 0xFFFFFFFF
};


///<P>IMFSplitBarPart dynamically resizes (and moves) two parts (must be sons of our parent)
///the topLeft part is assumed to be on the top(or left) of the splitbar 
///and the botRight part is assumed to be on the bottom (or right).</P>
///
///<P>The ratio of space allocated for each part goes from 0.0 to 1.0.  0.0 implies 
///no space for the first part, while 1.0 gives all the space to the first part.</P>
///<P>If the split mode is set to kPreferedSizeSplitMode, the split bar will 
///try to give the prefered part its prefered amount of space, but will always stay
///visible.
///
struct IMFSplitBarPart : public IMCUnknown
{
	//an IMFSplitBarPart is always an IMFPart
	virtual IMFPart*		MCCOMAPI GetThisPart		() = 0;

	//Applies the current settings to the splitbar and the controled parts
	virtual void			MCCOMAPI RepositionParts	() = 0;

	virtual MFPartID		MCCOMAPI GetTopLeftPartID	() = 0;
	virtual void			MCCOMAPI SetTopLeftPartID	(MFPartID inTopLeftPartID) = 0;

	virtual MFPartID		MCCOMAPI GetBotRightPartID	() = 0;
	virtual void			MCCOMAPI SetBotRightPartID	(MFPartID inBotRightPartID) = 0;

	virtual ESplitDirection MCCOMAPI GetSplitDirection	() = 0;
	virtual void			MCCOMAPI SetSplitDirection	(ESplitDirection inDirection) = 0;	

	//When the split mode is NOT kBasicSplitMode the split bar makes sure that itself 
	//and the two contoled parts fill their parent
	virtual ESplitMode		MCCOMAPI GetSplitMode		() = 0;
	virtual void			MCCOMAPI SetSplitMode		(ESplitMode inSplitMode) = 0;

	//Gets/Sets the split ratio (for the kConstantRatioSplitMode)
	//0.0f => no room for the first part, 1.0 =>all room for first part.
	virtual real			MCCOMAPI GetSplitRatio		() = 0;
	virtual void			MCCOMAPI SetSplitRatio		(real inSplitRatio) = 0;

	//Gets/Sets the prefered size of the prefered part (for the kPreferedSizeSplitMode)
	virtual int32			MCCOMAPI GetPreferedSize	() = 0;
	virtual void			MCCOMAPI SetPreferedSize	(int32 inPreferedSize) = 0;

	//Gets/Sets the prefered part ID (for the kPreferedSizeSplitMode)
	virtual MFPartID		MCCOMAPI GetPreferedPartID	() = 0;
	virtual void			MCCOMAPI SetPreferedPartID	(MFPartID inPreferedPartID) = 0;

	// Adjust the position of the split bar with a delta value
	virtual void			MCCOMAPI AdjustSplitBar		(int32 delta) = 0;
};

/// \}

#endif