File indexing completed on 2022-10-04 14:27:23

0001 /*
0002     SPDX-FileCopyrightText: 2008-2010 Stefan Majewsky <majewsky@gmx.net>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef KDIAMOND_MAINWINDOW_H
0008 #define KDIAMOND_MAINWINDOW_H
0009 
0010 class Game;
0011 #include "game-state.h"
0012 
0013 class QAction;
0014 class KActionMenu;
0015 class KGameRenderer;
0016 
0017 #include <KXmlGuiWindow>
0018 #include <KgThemeSelector>
0019 
0020 namespace KDiamond
0021 {
0022 class InfoBar;
0023 class View;
0024 }
0025 
0026 class MainWindow : public KXmlGuiWindow
0027 {
0028     Q_OBJECT
0029 public:
0030     explicit MainWindow(QWidget *parent = nullptr);
0031     ~MainWindow() override;
0032 public Q_SLOTS:
0033     void startGame(KDiamond::Mode mode);
0034     void startGameDispatcher();
0035     void stateChange(KDiamond::State state);
0036     void gameIsOver();
0037     void showHighscores();
0038     void showPreferences();
0039 
0040     void configureNotifications();
0041 Q_SIGNALS:
0042     void pause(bool paused);
0043 protected Q_SLOTS:
0044     void pausedAction(bool paused);
0045 private:
0046     KDiamond::GameState *m_gameState;
0047     Game *m_game;
0048     KDiamond::View *m_view;
0049 
0050     KDiamond::InfoBar *m_infoBar;
0051 
0052     KActionMenu *m_newAct;
0053     QAction *m_newTimedAct;
0054     QAction *m_newUntimedAct;
0055     QAction *m_pauseAct;
0056     QAction *m_hintAct;
0057     KGameRenderer *m_renderer;
0058     KgThemeSelector m_selector;
0059 };
0060 
0061 #endif //KDIAMOND_MAINWINDOW_H