File indexing completed on 2024-04-28 04:02:03

0001 /*
0002     SPDX-FileCopyrightText: 2000-2005 Stefan Schimanski <1Stein@gmx.de>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KBOUNCE_MAINWINDOW_H
0008 #define KBOUNCE_MAINWINDOW_H
0009 
0010 #include <KXmlGuiWindow>
0011 
0012 #include <QLabel>
0013 #include <QPointer>
0014 
0015 #include "gamewidget.h"
0016 
0017 class QAction;
0018 class QStatusBar;
0019 class KToggleAction;
0020 
0021 
0022 class KBounceMainWindow : public KXmlGuiWindow
0023 {
0024     Q_OBJECT
0025     public:
0026         KBounceMainWindow();
0027         ~KBounceMainWindow() override;
0028 
0029     protected Q_SLOTS:
0030         void newGame();
0031         void pauseGame();
0032         void closeGame();
0033         void gameOverNow();
0034         void configureSettings();
0035         void readSettings();
0036         void settingsChanged();
0037         void setSounds( bool val );
0038         void showHighscore();
0039         void displayLevel( int level );
0040         void displayScore( int score );
0041         void displayFilled( int filled );
0042         void displayLives( int lives );
0043         void displayTime( int time );
0044         void gameStateChanged( KBounceGameWidget::State state );
0045     protected:
0046         void initXMLUI();
0047         void highscore();
0048 
0049         void focusOutEvent( QFocusEvent * ) override;
0050         void focusInEvent ( QFocusEvent * ) override;
0051 
0052         KBounceGameWidget* m_gameWidget;
0053 
0054         QStatusBar* m_statusBar;
0055 
0056         KToggleAction *m_pauseAction, *m_backgroundShowAction, *m_soundAction;
0057         QAction *m_newAction;
0058 
0059         QPointer<QLabel> levelLabel = new QLabel;
0060         QPointer<QLabel> scoreLabel = new QLabel;
0061         QPointer<QLabel> filledLabel = new QLabel;
0062         QPointer<QLabel> livesLabel = new QLabel;
0063         QPointer<QLabel> timeLabel = new QLabel;
0064 };
0065 
0066 #endif // KBOUNCE_MAINWINDOW_H