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

#include "TreeItem.h"

struct CRD_UT10XX_t;
class KeyFolderWidget;

class STokenKeysFolderItem: public TreeItem
{
	Q_OBJECT;
	
public:
	STokenKeysFolderItem(CRD_UT10XX_t *ut = 0, TreeItem *parent = 0);
	~STokenKeysFolderItem();
	
public slots:
	void refresh();
	
	void soLoginSlot();
	void userLoginSlot();
	void logoutSlot();
	
private slots:
	void generateKeySlot(const char *name, int id);
	void deleteKeySlot(int id);
	void generateCertReqSlot(int keyId, QString &fileName, QStringList &dn, QString &mail);
	
signals:
	void generateKeySig(const char *name, int id);
	void deleteKeySig(int id);
	void generateCertReqSig(int keyId, QString &fileName, QStringList &dn, QString &mail);
	void userLoginSig();
	void logoutSig();
	
private:
	CRD_UT10XX_t *mUt;
	KeyFolderWidget *mMainWidget;
};

#endif
