2
* Copyright 2007-2008 Thomas Gallinari <tg8187@yahoo.fr>
3
* Copyright 2007-2008 Pierre-Benoit Bessse <besse@gmail.com>
5
* This program is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU General Public License as
7
* published by the Free Software Foundation; either version 2 of
8
* the License, or (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
#ifndef KAPMANMAINWINDOW_H
20
#define KAPMANMAINWINDOW_H
25
#include <KXmlGuiWindow>
26
#include <QGraphicsView>
28
static const int initLives = 3;
33
* @brief This class enables to create the main window for Kapman.
35
class KapmanMainWindow : public KXmlGuiWindow {
41
/** The GameView instance that manages the game drawing and the collisions */
44
/** The Game instance that manages the main loop and events */
47
KStatusBar* m_statusBar;
52
* Creates a new KapmanMainWindow instance.
57
* Deletes the KapmanMainWindow instance.
64
* Initializes the KapmanMainWindow for a new game.
65
* Creates a new Game instance and a new GameView instance that displays the game.
71
* @param p_gameOver true if the game was over, false if a game is running
73
void newGame(const bool p_gameOver = false);
76
* Shows the highscores dialog.
78
void showHighscores();
81
* Shows a dialog enabling to change the current level.
86
* Sets the sounds enabled / disabled.
87
* @param p_enabled if true the sounds will be enabled, otherwise they will be disabled
89
void setSoundsEnabled(bool p_enabled);
92
* Shows the settings dialog.
102
* Closes the KapmanMainWindow.
107
* Refreshes new level value on Status Bar.
108
* @param p_level is level value
110
void displayLevel( unsigned int p_level );
113
* Refreshes new score value on Status Bar.
114
* @param p_score is score value
116
void displayScore( unsigned int p_score );
119
* Refreshes new lives value on Status Bar.
120
* @param p_lives is lives value
122
void displayLives( unsigned int p_lives );
125
* Resets the status bar values altogether for convenience.
127
void resetStatusBar();