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

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

#ifndef RECEIVE_MAIL_DIALOG_H
#define RECEIVE_MAIL_DIALOG_H

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

class ReceiveMailDialog : public QDialog  
{
	Q_OBJECT

public:
	ReceiveMailDialog(const MailConfig &config, const QString &receivedPath,
		QWidget *parent = 0, Qt::WindowFlags f = 0);
	QList<AttachmentItem> &getRequestFiles();
	virtual ~ReceiveMailDialog();

protected:
	QtPop3 *mPop3;
	QPushButton *mBreak;
	QLabel *mLabel;
	QProgressBar *mProgress;
	QString mReqFilter;
	QList<AttachmentItem> mRequestFiles;
	void displayMessage(bool received);
	void processMessage(const MessageItem &msg);

public slots:
	void pop3ErrorOccured(const QString &error);
	void pop3NoNewMessages();
	void pop3MessageReceived(const MessageItem &msg);
	void pop3NewMessagesCount(const int &count);
	void pop3NewMessages(const QStringList &);
};

#endif
