#ifndef _COBJECTROLLOVER_H_
#define _COBJECTROLLOVER_H_

#include "CObjectBase.h"
#include "../x/Objstr.h"

#define ROL_MASK	(1<<(LAST_OBJ_FLAG+1))
#define ROL_DISABLE (1<<(LAST_OBJ_FLAG+2))
#define ROL_CLICK   (1<<(LAST_OBJ_FLAG+3))

class CObjectRollOver:public CObjectBase
{
protected:
	int		     ROBstate;

	// renvoie l'index de la bitmap suivant l'etat du bouton
	int GetIndexBitmap();
	int GetIndexMask();
	int ResizeCompLayer(char *,int,int,int);

public:
	CObjectRollOver(container *,Layer *,int,int,int,int,int,int,int);
	virtual ~CObjectRollOver();

	virtual int IsMouseOnObject(int,int,int);
	int CursorMove(int,int,int,int,int);
	int CursorMoveIn(int,int,int,int,int);
	int CursorMoveInWithBtnPushed(int,int,int,int,int);
	int CursorMoveOut(int,int,int,int,int);
	int CursorMoveOutWithBtnPushed(int,int,int,int,int);
	int CursorMoveOutsideWithBtnPushed(int,int,int,int,int);
	int ClickIn(int,int,int,int,int,int);
	virtual int UnClickIn(int,int,int,int,int,int);
	int ClickOut(int,int,int,int,int,int);
	int UnClickOut(int,int,int,int,int,int);
	int DblClickIn(int,int,int,int,int,int);
	int MouseWheel(int,int,int,int,int,int);
	int KeyUp(UINT,int,UINT,int);
	int KeyDown(UINT,int,int,UINT,int);
	int SetFocus(int,int,int);
	int KillFocus(int,int);

	int Timer(int);

	virtual Layer *GetLayer(mmachine m,int p_tab);
	virtual Layer *GetLayerPart(mmachine m,Rect2D *area2redraw,int p_tab);
	virtual int DestroyAllLayers();
	virtual int ResizeLayer(int,int,int);
};

/* fonctions Scol */
int _CRcompRollOver(mmachine);
int _DScompRollOver(mmachine);
int _CONVERTcompRollOverToObjNode(mmachine);
int _CBcompRollOverCursorMoveIn(mmachine);
int _CBcompRollOverCursorMoveOut(mmachine);
int _CBcompRollOverClick(mmachine);
int _CBcompRollOverResizeResource(mmachine);
int _CBcompRollOverResize(mmachine);

#endif