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

#include <QtGui>

struct CRD_UT10XX_key_info_t;

class KeyFolderOptionsWidget: public QGroupBox
{
Q_OBJECT;
	
public:
	KeyFolderOptionsWidget(int id = 0, QWidget *parent = 0);
	
public slots:
	void setInfo(CRD_UT10XX_key_info_t *info);
	void enable();
	void disable();
	
private slots:
	void generateKeySlot();
	void deleteKeySlot();
	
signals:
	void generateKeySig(const char *name, int id);
	void deleteKeySig(int id);
	
private:
	int mId;
	QByteArray mName;
	bool mGenerated;
	
	QLineEdit *mNameLineEdit;
	QPushButton *mGenButton;
	QPushButton *mDelButton;
};


class KeyFolderWidget: public QWidget
{
	Q_OBJECT;
	
public:
	KeyFolderWidget(QWidget *parent = 0);
	
public slots:
	void setInfo(CRD_UT10XX_key_info_t *keyInfoList);
	void enable();
	void disable();
	
private slots:
	void generateKeySlot(const char *name, int id);
	void deleteKeySlot(int id);
	
signals:
	void generateKeySig(const char *name, int id);
	void deleteKeySig(int id);
	
private:
	QGridLayout *mLayout;
	KeyFolderOptionsWidget *mKeyWidget[4];
};

#endif
