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

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

		Author:	Arnaud
		Date:	11/21/2002

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

#ifndef __IMFPreviewPart__
#define __IMFPreviewPart__

#if CP_PRAGMA_ONCE
#pragma once
#endif


#include "MCCompObj.h"

struct IMFPart;
class TMCRect;

MCDEFINE_GUID(IID_IMFPreviewPart, 0xa9ce102, 0xb988, 0x4331, 0xbc, 0x6b, 0xa7, 0x5f, 0xb5, 0x3a, 0x9, 0x7d);

/// \addtogroup MCF
/// \{

// ****************************************************************************
// -Description:
/// \verbatim
///     Generic preview interface.  Particularly used in user interfaces
///     for post renderers.
///
///     A preview needs to be contained by a TMFPreviewControlerPart, which
///     can be any of its parents.
///
///     In its FinishRead(), the controller will find its preview and call 
///     SetControlerPart() and SetPreviewKind().
///     In its Receive(), the controller will call the preview's ReceiveFromControler()
///     This enables us to create a reference part with the preview, zoom 
///     toolbar, autoupdate button...that can be used for different previews,
///     as the previewKind is stored by the controller
/// 
///     For example, let's look at the Depth of Field dialog in MCSketch:
///     The preview:
///         is a leafpart, with the TPostRenderZoomablePreviewPart classname
///         has a part ID of 'EPPI' (referenced by the contoller)
///         has the following custom tokens (for TPostRenderZoomablePreviewPart )
///             RNDP      rndP     (ID of the render button in the DOF node)
///             RSTP      rstP     (ID of the resetview button in the DOF node)
///             AUTO      auto     (ID of the Auto Update checkbox in the DOF node)
///             PZTB      pzTB     (ID of the pan/zoom toolbar in the DOF node)
///
///     the topmost node part is the controler: 
///         its classname is TMFPreviewControlerPart
///         its custom tokens are:
///             PVID followed by the 4charid of the TPostRenderZoomablePreviewPart (eg EPPI)
///             PVKN followed by the 4charid of the postrenderer to preview RfDF
///\endverbatim
struct IMFPreviewPart : public IMCUnknown
{
	// ****************************************************************************
	//								GetThisPart
	// 
	/// Preview Parts are Parts, so this function will return the IMFPart interface to it.
	/// \return A pointer to the IMFPart interface to this Preview Part.
	/// 
	virtual IMFPart*			MCCOMAPI GetThisPart() = 0;

	// ****************************************************************************
	// -Description:
	//		RESERVED for TMFPreviewControlerPart of other similar part
	//		tells the preview who is its controller
	virtual void				MCCOMAPI SetControlerPart(IMFPart* controler) = 0;

	// ****************************************************************************
	// -Description:
	//		RESERVED for TMFPreviewControlerPart of other similar part
	//		tells the preview what kind of preview ir is
	virtual void				MCCOMAPI SetPreviewKind(IDType previewKind) = 0;

	// ****************************************************************************
	// -Description:
	//		RESERVED for TMFPreviewControlerPart of other similar part
	//		forwards any message received by the controller to the preview so it can react to parts outside it.
	virtual	EMFReceiveResult	MCCOMAPI ReceiveFromControler(MessageID message, IMFResponder* source, void* data) = 0;
};

/// \}





#endif
