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

#include "TreeItem.h"

struct CRD_UT10XX_t;
class GenCertReqWidget;

class STokenKeyItem: public TreeItem
{
	Q_OBJECT;
	
public:
	STokenKeyItem(int keyId, CRD_UT10XX_t *ut = 0, TreeItem *parent = 0);
	~STokenKeyItem();
	
	int id();
	
public slots:
	void refresh();
	
	void userLoginSlot();
	void logoutSlot();
	
private slots:
	void generateCertReqSlot(QString &fileName, QStringList &dn, QString &mail);
	
signals:
	void generateCertReqSig(int keyId, QString &fileName, QStringList &dn, QString &mail);
	
private:
	CRD_UT10XX_t *mUt;
	int mId;
	
	QTabWidget *mMainTabWidget;
	
	GenCertReqWidget *mGenCertReqWidget;
};

#endif
