/*
 *  Copyright (C) 2007-2008 CMM Sigma Andrzej Chmielowiec <cmmsigma@cmmsigma.eu>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 3
 *  as published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 */

#ifndef GEN_INFO_WIDGET_H
#define GEN_INFO_WIDGET_H

#include <QtGui>

struct CRD_UT10XX_t;

class GenInfoWidget: public QStackedWidget
{
	Q_OBJECT;
	
public:
	GenInfoWidget(QWidget *parent = 0);
	~GenInfoWidget();
	
public slots:
	void setInfo(const CRD_UT10XX_t *ut);
	
private slots:
	void confSlot();
	void unLockSlot();
	
signals:
	void confSig(const char *name, int soPinLim, const char *soPin, int userPinLim, 
		const char *userPin, bool upcna);
	void unLockSig(const char *soPin);
	
private:
	void clearInputs();
	void clearFields();
	
private:
	QByteArray mName;
	int mSoPinLim;
	QByteArray mSoPinBuf;
	int mUserPinLim;
	QByteArray mUserPinBuf;
	bool mUpcna;
	
	QWidget *mConfWidget;
	QLabel *mConfTechInfo;
	QLabel *mConfInfo;
	
	QWidget *mNotConfWidget;
	QLabel *mNotConfTechInfo;
	QLabel *mNotConfInfo;
	QLineEdit *mTokenName;
	QSpinBox *mSoPinLimit;
	QSpinBox *mUserPinLimit;
	QLineEdit *mSoPin;
	QLineEdit *mSoPinCheck;
	QLineEdit *mUserPin;
	QLineEdit *mUserPinCheck;
	QPushButton *mConfigure;
	
	QWidget *mLockWidget;
	QLabel *mLockTechInfo;
	QLabel *mLockInfo;
	QLineEdit *mLockSoPin;
	QPushButton *mUnLock;
};

#endif
