1/*
2 * Copyright 2006-2009 Parker Coates <coates@kde.org>
3 *
4 * This file is part of Killbots.
5 *
6 * Killbots is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * Killbots is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Killbots. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef KILLBOTS_MAINWINDOW_H
21#define KILLBOTS_MAINWINDOW_H
22
23class KAction;
24class KActionCollection;
25class KScoreDialog;
26#include <KDE/KXmlGuiWindow>
27
28class QSignalMapper;
29
30namespace Killbots
31{
32 class Engine;
33 class Coordinator;
34 class Scene;
35 class View;
36
37 class MainWindow : public KXmlGuiWindow
38 {
39 Q_OBJECT
40
41 public: // functions
42 explicit MainWindow( QWidget * parent = 0 );
43 virtual ~MainWindow();
44
45 private: // functions
46 void setupActions();
47 KAction * createMappedAction( int mapping, const QString & internalName, const QString & displayName, const QString & translatedShortcut, const QKeySequence & alternateShortcut, const QString & toolTip = QString(), const QString & icon = QString() );
48 void createScoreDialog();
49
50 private slots:
51 void showHighscores();
52 void configurePreferences();
53 void onGameOver( int score, int round );
54 void onSettingsChanged();
55 void onConfigDialogClosed();
56
57 private : // data members
58 Scene * m_scene;
59 Engine * m_engine;
60 View * m_view;
61 Coordinator * m_coordinator;
62 KScoreDialog * m_scoreDialog;
63 QSignalMapper * m_keyboardMapper;
64 bool m_rulesetChanged;
65 };
66
67}
68
69#endif
70
71