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

#include <QDialog>

class QGroupBox;
class QPushButton;
class QLineEdit;
class QListWidget;

class VpnNewWindow: public QDialog
{
	Q_OBJECT;
	
public:
	VpnNewWindow(QWidget *parent = 0);
	
private slots:
	void templateBrowseSlot();
	void caCertBrowseSlot();
	void userCertBrowseSlot();
	void sTokenKeyBrowseSlot();
	void saveSlot();

#ifndef STOKEN_SOFT
	void templateImportSlot();
	void caCertImportSlot();
	void userCertImportSlot();
#endif
	
private:
	QString newConfName();
	
	QWidget *createBaseTab();
	QGroupBox *createNameBox();
	QGroupBox *createNetDetailsBox();
	QGroupBox *createCertsKeyBox();
	
	QString mConfName;
	QLineEdit *mSTokenVpnName;
	QLineEdit *mTemplateFileName;
	QByteArray mTemplateData;
	QPushButton *mTemplateBrowse;
	
	QLineEdit *mRemoteVpnServer;
	
	QLineEdit *mCaCert;
	QString mCaCertFileName;
	QByteArray mCaCertData;
	QPushButton *mCaCertBrowse;
	QLineEdit *mUserCert;
	QString mUserCertFileName;
	QByteArray mUserCertData;
	QPushButton *mUserCertBrowse;
	
	QLineEdit *mKey;
	QPushButton *mKeyBrowse;
	
	QPushButton *mCancel;
	QPushButton *mSave;

#ifndef STOKEN_SOFT
	QPushButton *mTemplateImport;
	QPushButton *mCaCertImport;
	QPushButton *mUserCertImport;
#endif	
};

#endif
