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

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

		Author:	Arnaud
		Date:	11/21/2002

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

#ifndef __IMFOffscreenPart__
#define __IMFOffscreenPart__

#if CP_PRAGMA_ONCE
#pragma once
#endif


#include "MCCompObj.h"

struct IMFPart;
class TMCOffscreen;

MCDEFINE_GUID(IID_IMFOffscreenPart, 0x77a1ef6a, 0x524a, 0x4f43, 0x8a, 0x38, 0xc3, 0x8f, 0x70, 0x53, 0x9d, 0xe9);

/// \addtogroup MCF
/// \{

// ****************************************************************************
//						IMFOffscreenPart
/// <P>An IMFOffscreenPart owns an offscreen, and draws it.  It will handle deleting the offscreen
/// when necessary, but one can also tell it to delete the offscreen manually.</P>
struct IMFOffscreenPart : public IMCUnknown
{
	// ****************************************************************************
	//							GetThisPart
	/// IMFOffscreenPart owns a TMFOffscreenPart which is an IMFPart.  Returns the IMFPart interface.
	///
	/// \return A pointer to the IMFPart interface
	virtual IMFPart*		MCCOMAPI	GetThisPart			() = 0;

	// ****************************************************************************
	//							AllocateOffScreen
	/// <P>Allocates a new internal offscreen and deletes the old one.</P>
	///
	/// \param width		Width in pixels of the offscreen to allocate
	/// \param height		Height in pixels of the offscreen to allocate
	/// \param bitDepth		Bit depth of the offscreen to allocate
	///
	virtual void			MCCOMAPI	AllocateOffScreen	(uint32 width, uint32 height, uint32 bitDepth) = 0;

	// ****************************************************************************
	//							DeleteOffScreen
	/// <P>Deletes the internal offscreen.  Calling this is optional, as AllocateOffScreen()
	/// will automatically delte its old offscreen.</P>
	///
	virtual void			MCCOMAPI	DeleteOffScreen		() = 0;

	// ****************************************************************************
	//							GetOffscreen
	/// \return		A pointer to internal offscreen.  NULL if the offscreen has not been allocated.
	///
	virtual TMCOffscreen*	MCCOMAPI	GetOffscreen		() = 0;

	// ****************************************************************************
	//							DrawCheckerOffScreen
	/// <P>Draws a checkerboard pattern in the internal offscreen.  You must have already
	/// called AllocateOffScreen() prior to calling this function.</P>
	///
	virtual void			MCCOMAPI	DrawCheckerOffScreen() = 0;

	// ****************************************************************************
	//							ScreenToOffscreen
	/// <P>Conerts a point from screen coordinates into offscreen coordinates.
	/// \param	ioPoint		The point to be converted to offscreen coordinates.
	/// \return True if the point is inside the offscreen.
	///
	virtual boolean			MCCOMAPI	ScreenToOffscreen	(TMCPoint& ioPoint) = 0;

	// ****************************************************************************
	//							GetDisplayBounds
	/// <P>Returns in local coordinates the bounds into wich the offscreen is displayed.
	/// This may be different than the part's bounds if it has a different aspect ratio.
	///	\param	outBounds	A TMCRect into which the function places the bounds.  TMCRect::kInvalid if the offscreen is null
	///
	virtual void			MCCOMAPI	GetDisplayBounds	(TMCRect& outBounds) = 0;
};


/// \}








#endif
