File indexing completed on 2024-05-12 04:03:07

0001 /*
0002     SPDX-FileCopyrightText: 2007-2008 Fela Winkelmolen <fela.kde@gmail.com>
0003     SPDX-FileCopyrightText: 2010 Brian Croom <brian.s.croom@gmail.com>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef MAINWINDOW_H
0009 #define MAINWINDOW_H
0010 
0011 // KF
0012 #include <KXmlGuiWindow>
0013 
0014 class GameEngine;
0015 class CanvasWidget;
0016 class KToggleAction;
0017 
0018 class MainWindow : public KXmlGuiWindow
0019 {
0020     Q_OBJECT
0021 public:
0022     explicit MainWindow(QWidget *parent = nullptr);
0023     ~MainWindow() override;
0024 
0025 private Q_SLOTS:
0026     void handleEndedGame(int score, int level, int time);
0027     void configureSettings();
0028     void showHighscores();
0029     void startNewGame();
0030     void fire();
0031     void cheatSkipLevel();
0032     void cheatAddLife();
0033     // calls the action
0034     void pauseGame();
0035     // called by the action
0036     void setGamePaused(bool paused);
0037     void viewFullScreen(bool fullScreen);
0038     void handleMousePressed();
0039 
0040 private:
0041     bool m_cheatsEnabled;
0042 
0043     void setupActions();
0044 
0045     KToggleAction *pauseAction;
0046 
0047     CanvasWidget *canvasWidget;
0048     GameEngine *gameEngine;
0049 
0050 };
0051 
0052 #endif