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

		ImportFileData.h
		Copyright: (c) 2002 Eovia Corp. All rights reserved.

		Author:	Arnaud
		Date:	1/23/2007

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

#ifndef __ImportFileData__
#define __ImportFileData__

#if CP_PRAGMA_ONCE
#pragma once
#endif


#include "I3DImportData.h"


class TImportFileData : public TMCCountedObject, public I3DImportData
{
public:
	static void Create(const TMFFlavor& inFlavor, IMCFile* inFile, I3DImportData** outData)
	{
		TMCCountedCreateHelper<I3DImportData> result(outData);
		result= new TImportFileData(inFlavor, inFile);
	}
	
	//IMCUnknown
	virtual MCErr  MCCOMAPI QueryInterface	(const MCIID& riid, void** ppvObj)
	{
		QUERY_INTERFACE(I3DImportData,riid,ppvObj);
		return TMCCountedObject::QueryInterface(riid, ppvObj);
	}

	virtual uint32 MCCOMAPI AddRef			()					{ return TMCCountedObject::AddRef(); }
	virtual uint32 MCCOMAPI Release			()					{ return TMCCountedObject::Release(); }

	//I3DImportData
	virtual IDType		MCCOMAPI GetDataID		() const		{ return fFlavor.fFlavorID; }
	virtual IDType		MCCOMAPI GetDataHint	() const		{ return fFlavor.fFlavorHint; } 
	virtual IMCFile*	MCCOMAPI GetDataFile	() const 		{ return fFile; }

protected:
	TImportFileData	(const TMFFlavor& inFlavor, IMCFile* inFile) : fFlavor(inFlavor), fFile(inFile)	{}
	~TImportFileData()		{}

protected:
	TMFFlavor				fFlavor;
	TMCCountedPtr<IMCFile>	fFile;
};





#endif
