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

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

		Author:	Julien
		Date:	11/24/2003

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

#ifndef __I3dExMiniModeler__
#define __I3dExMiniModeler__

#if CP_PRAGMA_ONCE
#pragma once
#endif

//****** Globally Unique Ids **************************************************
MCDEFINE_GUID2(IID_I3DExMiniModeler, R_IID_I3DExMiniModeler);



// Special messge send via the function HandleUIPartHit to notify the mini modeler
// that the UI need to be refreshed because the primitive has changed
#define kMsg_MiniModeler_Refresh	6000



/// \addtogroup ExternalInterface
///
/// \{

/// This interface provide a way to edit the parameter of a primitive that are not 
/// part of its pmap without opening the corresponding modeler.
/// If a modeler support this interface, the part created by CreateMiniModelerUI will
/// be displayed in the assemble room.
///
struct I3DExMiniModeler : public IMCUnknown
{
	// ****************************************************************************
	//								
	// 
	/// Create a custom part to modify the element passed
	///
	/// \param UIPart		The part to be created.
	///	\param inElement	The primitive to be edited by the modeler.
	///	\param inDocument	The current document.
	///
	/// \return MC_S_OK if OK
	///
	virtual	MCCOMErr	MCCOMAPI CreateMiniModelerUI(IMFPart** UIPart, IMCUnknown* inElement, IMFDocument* inDocument) = 0;

	// ****************************************************************************
	//								CleanUp
	// 
	/// Should remove and destroy all the parts created in CreateMiniModeler
	///
	/// \return MC_S_OK if OK
	///
	virtual	MCCOMErr	MCCOMAPI CleanUp() = 0;

	// ****************************************************************************
	//								CanModify
	// 
	/// Returns true if the passed source can modify the primitive with the passed message.
	///	If true is returned, HandleUIPartHit will then be called to handle the
	///	modification, if false is returned, HandleUIPartHit won't be called.
	///
	/// \param inSource: the part to check
	/// \param inMessage the message id.
	///
	/// \return True if the part can modify the primitive.
	///
	virtual boolean		MCCOMAPI CanModify(	IMFResponder*		inSource,
											int32				inMessage)=0;

	// ****************************************************************************
	//								HandleUIPartHit
	// 
	/// Implement this method to modify the primitive according to the
	///	part modification.
	///
	/// \param inTopPart: the top part
	///	\param inMessage: message id
	///	\param inSource: the part where the message comes from
	///	\param inData: data
	///
	/// \return False if the message is handled, true otherwise
	///
	virtual boolean		MCCOMAPI HandleUIPartHit(	IMFPart*			inTopPart,
													int32				inMessage,
													IMFResponder*		inSource,
													void*				inData) = 0;
};


/// \}






#endif
