/*******************************************************************************
*                                                                              *
* Société de Transports de Montréal.                                    	   *
* 2012                                                                         *
*                                                                              *
* Projet Zones Tests                                                           *
*                                                                              *
*                                                                              *
*                                                                              *
*******************************************************************************/
/*
	Description:
	Description du fichier si nécessaire.
	
*/

/* ************************************************************************** */
/* Revision:
### YYYMMDD JFM
	Verision d'origine.
	
### YYYYMMDD Description du besoin ou du bug
	Description du changement.
 */

/* ************************************************************************** */
#include "GlobalDefine.h"
#include <QGraphicsWidget>
#include <QString>



#ifndef CDVITEM_H
#define CDVITEM_H


class CCDV;

class CCDVItem : public QGraphicsWidget
{
	Q_OBJECT

public:
    CCDVItem(CCDV *CDVPtr,QGraphicsItem *Parent = 0);
	~CCDVItem();

	virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
	unsigned int SetParameters(QString Label/*, unsigned int posx, unsigned int posy*/);
	virtual unsigned int SetState(unsigned int State);
	unsigned int UpdateState();

	CCDV *GetCDV();

protected:
	virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent * event);
	virtual void mousePressEvent ( QGraphicsSceneMouseEvent * event );

	QString mCDVLabel;
	unsigned int mCDVState;
	QBrush *mCDVFreeBrush, *mCDVITICommandedBrush, *mCDVOccupiedBrush,*mCurBrush;

	CCDV *mCDVPtr;	//Pointer to the CDV object

signals:
	void CDVRightClicked(CCDVItem*);
};

#endif // CDVITEM_H
