/*
 *  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 ADMIN_WIDGET_H
#define ADMIN_WIDGET_H

#include <QtGui>

class AdminWidget: public QWidget
{
	Q_OBJECT;
	
public:
	AdminWidget(QWidget *parent = 0);
	~AdminWidget();
	
public slots:
	void enableSoMenu();
	void enableUserMenu();
	void disableMenu();
	
private slots:
	void userPinChangeSlot();
	void soPinChangeSlot();
	void eraseSlot();
	
signals:
	void userPinChangeSig(const char *newPin);
	void soPinChangeSig(const char *newPin);
	void eraseSig();
	
private:
	void clearInputs();
	void clearFields();
	
private:
	QByteArray mNewSoPinBuf;
	QByteArray mNewUserPinBuf;
	
	QGridLayout *mLayout;
	
	QGroupBox *mUserPinChangeBox;
	QLineEdit *mNewUserPin;
	QLineEdit *mNewUserPinCheck;
	QPushButton *mUserPinChange;
	QGroupBox *mSoPinChangeBox;
	QLineEdit *mNewSoPin;
	QLineEdit *mNewSoPinCheck;
	QPushButton *mSoPinChange;
	QGroupBox *mEraseBox;
	QPushButton *mErase;
};

#endif
