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

		IShLayerList.h

		Copyright: (c) 2008 DAZ Production All rights reserved.

		Author:	Pierre-Sylvain
		Date:	04/15/08

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

#ifndef __IShLayerList__
#define __IShLayerList__

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "IShRasterLayer.h"

class  TMCRect;
class  TMCColorRGBA8;
struct IChangeChannel;


MCDEFINE_GUID_H(IID_IShLayerList);


struct IShLayerList : public IMCUnknown
{
	// Attached informations
	virtual void				MCCOMAPI GetName(TMCString& name) const = 0;
	virtual void				MCCOMAPI SetName(const TMCString& name) = 0;

	// Layers
	virtual int32				MCCOMAPI GetLayerCount() const = 0;
	virtual IShRasterLayer*		MCCOMAPI GetLayer(int32 index) const = 0;
	virtual int32				MCCOMAPI GetLayerIndex(IShRasterLayer* layer) const = 0;
	virtual void				MCCOMAPI RemoveLayer(int32 layerIndex) = 0;
	virtual void				MCCOMAPI InsertLayer(IShRasterLayer* layer, int32 insertIndex=-1) = 0;
	virtual void				MCCOMAPI RemoveAllLayers() = 0;

	// Bounds
	virtual void				MCCOMAPI GetBounds(TMCRect& out_bounds) = 0;
	virtual void				MCCOMAPI SetBounds(const TMCRect& in_bounds) = 0;

	// Changes
	virtual MCCOMErr			MCCOMAPI GetContentChangeChannel(IChangeChannel** changeChannel) = 0;
	virtual MCCOMErr			MCCOMAPI GetPropertyChangeChannel(IChangeChannel** changeChannel) = 0;
	virtual void				MCCOMAPI InvalidateRect(const TMCRect& rect) = 0;

	// Flattened dynamic layer
	virtual MCCOMErr			MCCOMAPI GetFlattenedRasterLayer(IShRasterLayer** outLayer) = 0;

	// Layer merging functions
	typedef void (*ApplyLayerFunction)(TMCColorRGBA8& out, const TMCColorRGBA8& layerColor, real32 opacity);
	virtual ApplyLayerFunction	MCCOMAPI GetLayerApplyFunction(IShRasterLayer::ELayerMode mode, boolean topLayer) = 0;
};


#endif
