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

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

		Author:	charles
		Date:	4/2/2005

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

#ifndef __IShPartUtilities__
#define __IShPartUtilities__

#if CP_PRAGMA_ONCE
#pragma once
#endif


#include "MFPartTypes.h"


struct IShowBackBufferWindow;
class TMCWindowInfo;
struct IMFToolGroup;
struct IMFDialogPart;
struct IMFPart;
struct TPartFindingInfo;

template <class T> class TMCArray;

/// \addtogroup Utilities
/// \{

/// Utilities for creating parts.
struct IShPartUtilities: public IMCUnknown
{
public:
	
	// ****************************************************************************
	//								CreatePartByName
	// 
	/// Creates a part by class name.  Also allows you to specify the ID of the part extension
	/// to associate with this part, if any.
	/// 
	/// \param outPart          Returns a pointer to the part created
	/// \param inPartName       String to specify name of part to create (ie "TMFCollapsiblePart")
	/// \param inPartID         ID to assign to the part (ie 'sndC')
	/// \param inPartExtension  ID of the part extension to create for this part (ie 'seqC')  
	/// 
	virtual MCCOMErr MCCOMAPI CreatePartByName			(IMFPart** outPart, TMCString& inPartName, IDType inPartID, IDType inPartExtension) = 0;
	
	// ****************************************************************************
	//								CreatePartByResource
	// 
	/// Creates a part from a resource.  Looks in the current resource file for a resource matching inResType
	/// with the ID specified by inResID.  
	/// \see CWhileInCompResFile
	/// 
	/// \param outPart    Returns a pointer to the part created
	/// \param inResType  Type of resource to create (See MFPartTypes.h)
	/// \param inResID    Resource ID of the part to create
	/// 
	virtual MCCOMErr MCCOMAPI CreatePartByResource		(IMFPart** outPart, EMFResources inResType, ResourceID inResID) = 0;


	// ****************************************************************************
	//								CreateDialogByResource
	// 
	/// Creates a dialog from resources and optionally looks for some parts inside.
	/// 
	/// \param outDialog    the new dialog
	/// \param inResID      the id of the resource to load
	/// \param inResIsNode  is the resource a node (otherwise its a dialog)
	/// \param ioPart		optional part that you want to find in the resource (if you only want one)
	/// \param ioPartArray  optional parts that you want to find in the resource(if you want many, in which case set ioPart to null)
	/// 
	virtual void	 MCCOMAPI CreateDialogByResource	(	IMFDialogPart**						outDialog,
															ResourceID							inResID,
															boolean								inResIsNode,
															const TPartFindingInfo*				ioPart= NULL,
															const TMCArray<TPartFindingInfo>*	ioPartArray= NULL) = 0;
	
	// ****************************************************************************
	//								CreateToolGroup
	// 
	/// Creates a tool group based based on a resource (only 'TBAR' or 'Wind' for now).
	/// \see CWhileInCompResFile
	///
	/// \param outGroup			Returns a pointer to the group created
	/// \param inResourceID		Resource ID to load
	/// \param inResourceKind	The kind of resource to load (kMFToolbarResourceType or kMFWindowResourceType)
	/// \param inFamilyID		Family ID to assign to the group.
	/// \param overrideColorCoef Sets the color coefficient that will be applied to the icons of the group
	/// 
	virtual void	MCCOMAPI CreateToolGroup			(	IMFToolGroup**		outGroup, 
															const ResourceID	inResourceID, 
															const EMFResources	inResourceKind, 
															const IDType		inFamilyID,
															const real32		overrideColorCoef= 1.0f) = 0;

	// ****************************************************************************
	//								CreateIMFWindow
	// 
	/// Creates a window according to the parameters in inWindowInfo.
	/// 
	/// \param outWindow     Returns a pointer to the window created
	/// \param inWindowInfo  Window information for the window to create
	/// 
	virtual void	 MCCOMAPI CreateIMFWindow			(IMFWindow** outWindow, const TMCWindowInfo& inWindowInfo) = 0;
	
	// ****************************************************************************
	//								CreateShowBackBufferWindow
	// 
	/// Creates a ShowBackBufferWindow, which is generally used only by the application.  Do not call.
	/// 
	/// \param outWindow     Returns a pointer to the window created
	/// \param inWindowInfo  Window information for the window to create
	/// 
	virtual void 	 MCCOMAPI CreateShowBackBufferWindow(IShowBackBufferWindow** outWindow, const TMCWindowInfo& inWindowInfo) = 0;

	// ****************************************************************************
	//								Alert
	// 
	/// Display an altert message.
	/// \note Also available: IShUtilities::DoAlert() and IShUtilities::Alert()
	/// 
	/// \param message  Text of the message to display to the user.
	/// 
	virtual void	MCCOMAPI Alert(const TMCString& message) = 0;

}; 

/// \}

#endif
