/*
 *  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.
 */

// MailAccountWidget.h: interface for the MailAccountWidget class.
//
//////////////////////////////////////////////////////////////////////

#ifndef MAILACCOUNTWIDGET_H
#define MAILACCOUNTWIDGET_H

#include <QtGui>
#include "MailConfig.h"

class MailAccountWidget : public QWidget  
{
	Q_OBJECT

public:
	void setData(MailConfig &data);
	void getData(MailConfig &data);
	MailAccountWidget(bool displayFilter = true, bool usePop3 = true, QWidget *parent = 0);
	virtual ~MailAccountWidget();

	QGroupBox *mBox;
	QLineEdit *mMail;
	QLineEdit *mUser;
	QLineEdit *mSmtpServer;
	QLineEdit *mSmtpUser;
	QLineEdit *mSmtpPass;
	QLineEdit *mReqFilter;
	QLineEdit *mPop3Server;
	QLineEdit *mPop3User;
	QLineEdit *mPop3Pass;
	QCheckBox *mOutgoingAuth;
	QCheckBox *mUseIncomming;
	QCheckBox *mUseMail;
	QLabel *mIncName;
	QLabel *mIncPass;

public slots:
	void setEmail(const QString &mail);
	void setUser(const QString &user);

protected:
	void updateMailState();
	void updateAutentState();
	void updateUseIncomingState();
	bool mUsePop3;
	
protected slots:
	void autentStateChanged(int state);
	void useIncomingStateChanged(int state);
	void useMailStateChanged(int state);
};

#endif
