1 | /* |
2 | * Copyright (c) 2010 Ni Hui <shuizhuyuanluo@126.com> |
3 | * |
4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License as published by |
6 | * the Free Software Foundation; either version 2 of the License, or |
7 | * (at your option) any later version. |
8 | |
9 | * This program is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. |
13 | |
14 | * You should have received a copy of the GNU General Public License |
15 | * along with this program; if not, write to the Free Software |
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | */ |
18 | |
19 | #ifndef MAINWINDOW_H |
20 | #define MAINWINDOW_H |
21 | |
22 | #include <KXmlGuiWindow> |
23 | |
24 | class KAction; |
25 | class KGameClock; |
26 | class GameScene; |
27 | class MainWindow : public KXmlGuiWindow |
28 | { |
29 | Q_OBJECT |
30 | public: |
31 | explicit MainWindow( bool KSameMode = false, QWidget* parent = 0 ); |
32 | ~MainWindow(); |
33 | private Q_SLOTS: |
34 | void configureNotifications(); |
35 | void configureSettings(); |
36 | void loadSettings(); |
37 | void newGame( int gameId = qrand() ); |
38 | void newNumGame(); |
39 | void pauseGame( bool isPaused ); |
40 | void restartGame(); |
41 | void loadGame(); |
42 | void saveGame(); |
43 | void changeMarkedCount( int markedCount ); |
44 | void changeScore( int remainCount ); |
45 | void changeRemainCount( int remainCount ); |
46 | void changeTime( const QString& newTime ); |
47 | void showHighscores(); |
48 | void onGameOver( int remainCount ); |
49 | private: |
50 | bool confirmAbort(); |
51 | void setupActions(); |
52 | void setupDifficulties(); |
53 | bool m_KSameMode; |
54 | GameScene* m_scene; |
55 | /** Klickety mode only */ |
56 | KGameClock* m_gameClock; |
57 | /** KSame mode only */ |
58 | int m_gameScore, m_lastRemainCount; |
59 | KAction* m_pauseAction; |
60 | }; |
61 | |
62 | #endif // MAINWINDOW_H |
63 | |