File indexing completed on 2024-05-19 04:04:54
0001 /* 0002 This file is part of the game 'KJumpingCube' 0003 0004 SPDX-FileCopyrightText: 1998-2000 Matthias Kiefer <matthias.kiefer@gmx.de> 0005 0006 SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #ifndef KJUMPINGCUBE_H 0010 #define KJUMPINGCUBE_H 0011 0012 #include <QLabel> 0013 0014 #include <KXmlGuiWindow> 0015 #include <game.h> 0016 0017 class QAction; 0018 class KCubeBoxWidget; 0019 class QPushButton; 0020 0021 /** 0022 * This class serves as the main window for KJumpingCube. It handles the 0023 * menus, toolbars, and status bars. 0024 * 0025 * @short Main window class 0026 * @author Matthias Kiefer <matthias.kiefer@gmx.de> 0027 * @version 0.7.2 0028 */ 0029 class KJumpingCube : public KXmlGuiWindow { 0030 Q_OBJECT 0031 0032 public: 0033 /** Default Constructor */ 0034 KJumpingCube(); 0035 0036 public Q_SLOTS: 0037 void setAction (const Action a, const bool onOff); 0038 0039 protected: 0040 /// To make sure all activity ceases before closing. 0041 bool queryClose() override; 0042 0043 private: 0044 Game * m_game; 0045 KCubeBoxWidget * m_view = nullptr; 0046 QLabel *currentPlayer = nullptr; 0047 QAction *undoAction = nullptr; 0048 QAction *redoAction = nullptr; 0049 QAction *stopAction = nullptr; 0050 QAction *hintAction = nullptr; 0051 0052 void initKAction(); 0053 0054 QPushButton * actionButton = nullptr; 0055 QString buttonLook; 0056 0057 private Q_SLOTS: 0058 void changePlayerColor (int newPlayer); 0059 void changeButton (bool enabled, bool stop = false, 0060 const QString & caption = QString()); 0061 void statusMessage (const QString & message, bool timed); 0062 }; 0063 0064 #endif // KJUMPINGCUBE_H 0065