File indexing completed on 2024-04-14 03:59:18
0001 /* 0002 SPDX-FileCopyrightText: 1998 Andreas Wüst <AndreasWuest@gmx.de> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef TOPLEVEL_H 0008 #define TOPLEVEL_H 0009 0010 #include <KXmlGuiWindow> 0011 0012 class GameWidget; 0013 class KSelectAction; 0014 class QAction; 0015 class QLabel; 0016 0017 /** 0018 * This is the class AtomTopLevel. The class is used only for the program 0019 * AtomTopLevel. 0020 * 0021 * @short Basic class for AtomTopLevel 0022 * @author Andreas Wüst 0023 */ 0024 0025 class AtomTopLevel : public KXmlGuiWindow 0026 { 0027 Q_OBJECT 0028 0029 public: 0030 AtomTopLevel(); 0031 ~AtomTopLevel() override; 0032 /** 0033 * If called, katomic will allow user to switch to any 0034 * level even if he didn't solved it yet. 0035 * May enable some other "hacks" in future (if any will emerge) 0036 */ 0037 void enableHackMode(); 0038 private Q_SLOTS: 0039 void slotAnimSpeedChanged(int); 0040 void updateStatusBar(int level, int score, int highscore); 0041 void levelHasChanged(int level); 0042 void chooseLevelSet(); 0043 void changeLevelSet(const QString&); 0044 0045 private: 0046 bool queryClose() override; // reimp 0047 0048 // Creates the menubar and connects the menu-entries to the 0049 // appropriate functions 0050 void createMenu(); 0051 0052 // Get the configuration from the config-file. 0053 void loadSettings(); 0054 0055 // Whenever a level gets changed, we update the actions 0056 // "m_prevLevelAct" and "m_nextLevelAct". 0057 void updateActionsForLevel(int level); 0058 0059 GameWidget *m_gameWid; 0060 0061 QAction *m_redoAct, *m_undoAct; 0062 QAction *m_prevLevelAct, *m_nextLevelAct; 0063 KSelectAction* m_animSpeedAct; 0064 QLabel *mLevel; 0065 QLabel *mCurrentScore; 0066 QLabel *mHighScore; 0067 QLabel *mMoleculeName; 0068 }; 0069 0070 #endif