1 | /* toplevel.h |
2 | |
3 | Copyright (C) 1998 Andreas Wüst (AndreasWuest@gmx.de) |
4 | |
5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. |
9 | |
10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. |
14 | |
15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
18 | |
19 | */ |
20 | |
21 | #ifndef TOPLEVEL_H |
22 | #define TOPLEVEL_H |
23 | |
24 | class GameWidget; |
25 | class KSelectAction; |
26 | class QAction; |
27 | class KAction; |
28 | |
29 | #include <kxmlguiwindow.h> |
30 | |
31 | /** |
32 | * This is the class AtomTopLevel. The class is used only for the program |
33 | * AtomTopLevel. |
34 | * |
35 | * @short Basic class for AtomTopLevel |
36 | * @author Andreas Wüst |
37 | */ |
38 | |
39 | class AtomTopLevel : public KXmlGuiWindow |
40 | { |
41 | Q_OBJECT |
42 | |
43 | public: |
44 | AtomTopLevel(); |
45 | ~AtomTopLevel(); |
46 | /** |
47 | * If called, katomic will allow user to switch to any |
48 | * level even if he didn't solved it yet. |
49 | * May enable some other "hacks" in future (if any will emerge) |
50 | */ |
51 | void enableHackMode(); |
52 | private slots: |
53 | void slotAnimSpeedChanged(int); |
54 | void updateStatusBar(int level, int score, int highscore); |
55 | void levelHasChanged(int level); |
56 | void chooseLevelSet(); |
57 | void changeLevelSet(const QString&); |
58 | |
59 | private: |
60 | virtual bool queryClose(); // reimp |
61 | |
62 | // Creates the menubar and connects the menu-entries to the |
63 | // appropriate functions |
64 | void (); |
65 | |
66 | // Get the configuration from the config-file. |
67 | void loadSettings(); |
68 | |
69 | // Whenever a level gets changed, we update the actions |
70 | // "m_prevLevelAct" and "m_nextLevelAct". |
71 | void updateActionsForLevel(int level); |
72 | |
73 | GameWidget *m_gameWid; |
74 | |
75 | QAction *m_redoAct, *m_undoAct; |
76 | KAction *m_prevLevelAct, *m_nextLevelAct; |
77 | KSelectAction* m_animSpeedAct; |
78 | }; |
79 | |
80 | #endif |
81 | |