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

#include <QtGui>


class QLineEditFiltered : public QLineEdit
{
	Q_OBJECT
	
public:
	QLineEditFiltered(QWidget *parent = 0);
	
protected slots:
	void textCheck(const QString &name);
	
protected:
	QString mCorrectText;
	
};


class GenCertReqWidget: public QWidget
{
	Q_OBJECT;
	
public:
	GenCertReqWidget(QWidget *parent = 0);
	
	QString subject();
	bool isReady();
	
private:
	QLineEdit *mCountryCode;
	QLineEditFiltered *mStateOrProvinceName;
	QLineEditFiltered *mLocalityName;
	QLineEditFiltered *mOrganizationName;
	QLineEditFiltered *mOrganizationalUnitName;
	QLineEditFiltered *mCommonName;
	QLineEdit *mEmailAddress;
	QPushButton *mGenerate;
};

#endif
