1 /*************************************************************************
2                Splash.h  -  splash screen for Kwave
3                              -------------------
4     begin                : Tue Jun 24 2003
5     copyright            : Copyright (C) 2003 Gilles CAULIER
6     email                : Gilles CAULIER <caulier.gilles@free.fr>
7  ***************************************************************************/
8 
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17 
18 #ifndef KWAVE_SPLASH_H
19 #define KWAVE_SPLASH_H
20 
21 #include <QFrame>
22 #include <QFont>
23 #include <QObject>
24 #include <QPixmap>
25 #include <QPointer>
26 #include <QString>
27 #include <QTimer>
28 
29 class QMouseEvent;
30 class QPaintEvent;
31 
32 namespace Kwave
33 {
34     class Splash: public QFrame
35     {
36     Q_OBJECT
37 
38     public:
39 	/**
40 	 * Constructor
41 	 * @param PNGFile name of a file to be shown as splashscreen,
42 	 *        should be found in one of the "appdata" directories.
43 	 */
44 	explicit Splash(const QString &PNGFile);
45 
46 	/** Destructor */
47         virtual ~Splash() Q_DECL_OVERRIDE;
48 
49 	/** wrapper for QSplashScreen::showMessage with only one parameter */
50 	static void showMessage(const QString &message);
51 
52 	/** handles the painting of this splash screen */
53         virtual void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE;
54 
55 	/** hides the splash screen on mouse click */
56         virtual void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE;
57 
58 	/** should be called when the splashscreen is no longer needed */
59 	void done();
60 
61     private:
62 
63 	/** font to use for the status text and version number */
64 	QFont m_font;
65 
66 	/** pixmap with the Kwave logo */
67 	QPixmap m_pixmap;
68 
69 	/** last status message */
70 	QString  m_message;
71 
72 	/** static instance */
73 	static QPointer<Kwave::Splash> m_splash;
74     };
75 }
76 
77 #endif /* KWAVE_SPLASH_H */
78 
79 //***************************************************************************
80 //***************************************************************************
81