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

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

		Author:	Arnaud
		Date:	10/9/2003

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

#ifndef __IMFPartSwitcher__
#define __IMFPartSwitcher__

#if CP_PRAGMA_ONCE
#pragma once
#endif


#include "MCCompObj.h"


struct IMFPart;
template <class T> class TMCCountedPtrArray;


MCDEFINE_GUID(IID_IMFPartSwitcher, 0x1a8f570d, 0xddd8, 0x4564, 0x93, 0xa8, 0x5b, 0x6b, 0xd1, 0x74, 0xde, 0x96);



/// \addtogroup MCF
/// \{

/// <P>IMFPartSwitcher is a node part that keeps a list of (some) of it child parts 
/// and shows only one of them. It is very similar to tabs.
/// When you add parts, they IMFPartSwitcher becomes their owner and will destroy them when they are removed
/// When you add or remove part through this interface, they will be automatically added/removed as child of the IMFPartSwitcher.</P>
///		<P>Inserted/added parts are set to invisible and disabled
///		<P>Note that IMFPartSwitcher should also support Get/SetValue() with kInt32ValueType to switch the shown page
///
struct IMFPartSwitcher : public IMCUnknown
{
	// -Returns: the interface to IMFPart (always supported by IMFPartSwitcher)
	virtual IMFPart*	MCCOMAPI	GetThisPart		() = 0;

	//returns the number of parts currently handled by this part (may not be the number of children)
	virtual int32		MCCOMAPI	GetPartsCount	()	const = 0;

	
	// -Description:
	//		Sets the parts to switch between
	// -Parameters:
	//		inParts: the list of parts IMFPartSwitcher is going to handle
	// -Note:
	//		this part hides all the given parts (and takes ownership of them)
	//		previous part will be removed and destroyed
	virtual void		MCCOMAPI	SetParts		(const TMCCountedPtrArray<IMFPart>& inParts) = 0;

	 
	// -Description:
	//		Inserts a new part in the list of handled parts
	// -Parameters:
	//		insertPos:	where to insert the part
	//		inPart:		the part to insert (will become hidden)
	virtual void		MCCOMAPI	InsertPart		(int32 insertPos, IMFPart* inPart) = 0;

	 
	// -Description:
	//		Removes and destroys some of oour parts
	// -Parameters:
	//		index: where to start removing parts
	//		count: how many should be removed
	virtual void		MCCOMAPI	RemoveParts		(int32 index, int32 count) = 0;

	
	// -Description:
	//		Shows the given part (and hides the previous one)
	virtual void		MCCOMAPI	ShowPart		(int32 inPartIndex) = 0;

		
	// -Returns:
	//		the currently shown part (can return NULL)
	virtual IMFPart*	MCCOMAPI	GetShownPart	() = 0;
};
/// \}



#endif
