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

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

		Author:	Pierre-Sylvain
		Date:	7/12/2006

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

#ifndef __IExParamType__
#define __IExParamType__

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "ComTypes.h"

class TMCiostream;


MCDEFINE_GUID_H(IID_IExParamType);


// This interface should not be used directly.
// Use the TParamHolder classes.
struct IExParamType : public IMCUnknown
{
	enum EOperation
	{
		kLinearOperations	= 0x0001,	// linear interpolate and offsets
		kInvertOffset		= 0x0002,	// see InvertOffset()
	};

	// type (see PMap.h)
	virtual IDType		MCCOMAPI GetType() = 0;
	virtual uint32		MCCOMAPI GetSupportedOperations() = 0;

	// create and destory
	virtual int32		MCCOMAPI GetSize() = 0;
	virtual void		MCCOMAPI CreateParam(void* param) = 0;
	virtual void		MCCOMAPI DeleteParam(void* param) = 0;
	virtual void		MCCOMAPI Reset(void* param) = 0;

	// read/write
	virtual void		MCCOMAPI Read(void* param, TMCiostream& stream) = 0;
	virtual void		MCCOMAPI Write(const void* param, TMCiostream& stream) = 0;

	// comparison
	virtual boolean		MCCOMAPI IsEqual(void* param1, void* param2) = 0;

	// copy
	virtual void		MCCOMAPI Copy(const void* src, void* dst) = 0;

	// operations
	virtual void		MCCOMAPI LinearInterpolate(real t, const void* src1, const void* src2, void* out) = 0;
	virtual void		MCCOMAPI ComputeOffset(const void* src1, const void* src2, void* out) = 0;
	virtual void		MCCOMAPI ApplyOffset(const void* src, const void* offset, void* out) = 0;
	virtual void		MCCOMAPI InvertOffset(const void* src, void* out) = 0;
};


#endif
