File indexing completed on 2024-11-03 06:54:05

0001 /*
0002     This file is part of Killbots.
0003 
0004     SPDX-FileCopyrightText: 2006-2009 Parker Coates <coates@kde.org>
0005 
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 #ifndef KILLBOTS_MAINWINDOW_H
0010 #define KILLBOTS_MAINWINDOW_H
0011 
0012 class QAction;
0013 class KGameHighScoreDialog;
0014 #include <KXmlGuiWindow>
0015 
0016 namespace Killbots
0017 {
0018 class Engine;
0019 class Coordinator;
0020 class Scene;
0021 class View;
0022 
0023 class MainWindow : public KXmlGuiWindow
0024 {
0025     Q_OBJECT
0026 
0027 public: // functions
0028     explicit MainWindow(QWidget *parent = nullptr);
0029     ~MainWindow() override;
0030 
0031 private: // functions
0032     void setupActions();
0033     QAction *createMappedAction(int mapping, const QString &internalName, const QString &displayName, const QString &translatedShortcut, const int alternateShortcut, const QString &toolTip = QString(), const QString &icon = QString());
0034     void createScoreDialog();
0035 
0036 private Q_SLOTS:
0037     void showHighscores();
0038     void configurePreferences();
0039     void onGameOver(int score, int round);
0040     void onSettingsChanged();
0041     void onConfigDialogClosed();
0042 
0043 private : // data members
0044     Scene *m_scene;
0045     Engine *m_engine;
0046     View *m_view;
0047     Coordinator *m_coordinator;
0048     KGameHighScoreDialog *m_scoreDialog;
0049     bool m_rulesetChanged;
0050 };
0051 
0052 }
0053 
0054 #endif
0055