/*******************************************************************************
*                                                                              *
* Société de Transports de Montréal.                                    	   *
* 2012 - 2013                                                                        *
*                                                                              *
* 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.
 */

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

#ifndef PASSWORDPROMPT_H
#define PASSWORDPROMPT_H

#include <QGraphicsWidget>
#include "TextButtonWidget.h"
#include <QLineEdit>
#include "GlobalDefine.h"

class CPasswordPrompt : public QGraphicsWidget
{
	Q_OBJECT
public:
	CPasswordPrompt(QGraphicsItem *Parent);

	void RequestPassword();

	virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
	virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
	virtual void keyPressEvent(QKeyEvent *event);

private:
	CTextButtonWidget *mAcceptBtn, *mCancelBtn;
	QLineEdit *mLineEditWidget;
    QString mPassword;

    bool LoadPasswordFile();


signals:
	void PasswordValid();
	void Canceled();

public slots:
	void ButtonPressed(CTextButtonWidget*);


};

#endif // PASSWORDPROMPT_H
