#ifndef TEXTBUTTONWIDGET_H
#define TEXTBUTTONWIDGET_H

#include <QGraphicsWidget>
#include <QRect>
#include <QTimeLine>

#define TEXT_BUTTON_WIDGET_WIDTH 280
#define TEXT_BUTTON_WIDGET_HEIGHT 25

class CTextButtonWidget : public QGraphicsWidget
{
     Q_OBJECT
public:
	CTextButtonWidget(QString Text, int TextButtonData = 0,int ButtonHeight = TEXT_BUTTON_WIDGET_HEIGHT,int ButtonWidth = 0,int FontSize = 0,QPixmap *ButtonImage = 0);

	QString mWidgetText;
	QString mDisplayText;
	int mTextButtonData;
	bool mIsSelected;
	QRectF mButtonsAreaWindow;
	QTimeLine *mTimeLine;
	bool mIsPressed;
	bool mScrollingRequired;
	qreal ClickTransparency;
	int mSongNameIndex;
	QPixmap *mButtonImagePtr;
	unsigned int mButtonHeight;
	unsigned int mButtonWidth;
	unsigned int mFontSize;
	QColor mBackgroundColor;
	QFont mTextFont;

	void paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
	void SetButtonPos(int x, int y);
	void PaintButtonWidget(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 );
	void SetButtonImage(QPixmap *ButtonImage);
	void SetButtonText(QString ButtonText);
	void SetBackgroundColor(QColor color);
	void CheckScrolling(void);


	QPoint mWidgetOrigin;

    virtual void mousePressEvent ( QGraphicsSceneMouseEvent * event );
	virtual void mouseReleaseEvent( QGraphicsSceneMouseEvent * event);
	void ButtonClicked(void);

	public slots:
	void TimeLineEvent(qreal value);
	void TickScrollingText();

    signals:
	void TxtButtonClicked(CTextButtonWidget *TextButtonPtr);
	void TxtButtonPressed(CTextButtonWidget *TextButtonPtr);
	void TxtButtonReleased(CTextButtonWidget *TextButtonPtr);


};

#endif // TEXTBUTTONWIDGET_H
