#ifndef _KVI_SPLASH_H_
#define _KVI_SPLASH_H_
//
//   File : kvi_splash.h
//   Creation date : Wed Aug 8 2001 17:45:12 CEST by Szymon Stefanek
//
//   This file is part of the KVirc irc client distribution
//   Copyright (C) 2001 Szymon Stefanek (stefanek@tin.it)
//
//   This program is FREE software. You can redistribute it and/or
//   modify it under the terms of the GNU General Public License
//   as published by the Free Software Foundation; either version 2
//   of the License, or (at your opinion) any later version.
//
//   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.
//
//   You should have received a copy of the GNU General Public License
//   along with this program. If not, write to the Free Software Foundation,
//   Inc. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//

#include "kvi_settings.h"


#include <qframe.h>

#ifdef COMPILE_SPLASH_SCREEN

	#include <qprogressbar.h>
	#include <qlabel.h>
	#include <qtimer.h>
	#include <qdatetime.h>

#endif

class KVIRC_API KviSplashScreen : public QFrame
{
	Q_OBJECT
public:
	KviSplashScreen();
	~KviSplashScreen();
private:
#ifdef COMPILE_SPLASH_SCREEN
	QProgressBar   * m_pProgress;
	QLabel         * m_pLabel;
	QLabel         * m_pPixLabel;
	QTimer         * m_pTimer;
	QTime            m_creationTime;
protected:
	virtual void showEvent(QShowEvent * e);
	virtual bool eventFilter(QObject * o,QEvent *e);
public:
	void setProgress(int progress);
	void setText(const char *text);
	void die();
#endif
protected slots:
	void suicide();
};

#ifdef COMPILE_SPLASH_SCREEN
	extern KVIRC_API KviSplashScreen * g_pSplashScreen;

	#define KVI_SPLASH_SET_PROGRESS(__val) g_pSplashScreen->setProgress(__val);
	#define KVI_SPLASH_SET_TEXT(__txt) g_pSplashScreen->setText(__txt);

#else

	#define KVI_SPLASH_SET_PROGRESS(__val)
	#define KVI_SPLASH_SET_TEXT(__val)

#endif // !COMPILE_SPLASH_SCREEN

#endif //_KVI_SPLASH_H_
