Add const to methods that do not modify the object for which it is called
[bitcoinplatinum.git] / src / qt / splashscreen.h
bloba88ebb98a87400c8d3f06c74b169158564859e95
1 // Copyright (c) 2011-2016 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 #ifndef BITCOIN_QT_SPLASHSCREEN_H
6 #define BITCOIN_QT_SPLASHSCREEN_H
8 #include <functional>
9 #include <QSplashScreen>
11 class CWallet;
12 class NetworkStyle;
14 /** Class for the splashscreen with information of the running client.
16 * @note this is intentionally not a QSplashScreen. Bitcoin Core initialization
17 * can take a long time, and in that case a progress window that cannot be
18 * moved around and minimized has turned out to be frustrating to the user.
20 class SplashScreen : public QWidget
22 Q_OBJECT
24 public:
25 explicit SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle);
26 ~SplashScreen();
28 protected:
29 void paintEvent(QPaintEvent *event);
30 void closeEvent(QCloseEvent *event);
32 public Q_SLOTS:
33 /** Slot to call finish() method as it's not defined as slot */
34 void slotFinish(QWidget *mainWin);
36 /** Show message and progress */
37 void showMessage(const QString &message, int alignment, const QColor &color);
39 /** Sets the break action */
40 void setBreakAction(const std::function<void(void)> &action);
41 protected:
42 bool eventFilter(QObject * obj, QEvent * ev);
44 private:
45 /** Connect core signals to splash screen */
46 void subscribeToCoreSignals();
47 /** Disconnect core signals to splash screen */
48 void unsubscribeFromCoreSignals();
49 /** Connect wallet signals to splash screen */
50 void ConnectWallet(CWallet*);
52 QPixmap pixmap;
53 QString curMessage;
54 QColor curColor;
55 int curAlignment;
57 QList<CWallet*> connectedWallets;
59 std::function<void(void)> breakAction;
62 #endif // BITCOIN_QT_SPLASHSCREEN_H