File indexing completed on 2024-10-13 03:44:25

0001 /*
0002     SPDX-FileCopyrightText: 2004-2005 Andi Peredri <andi@ukr.net>
0003     SPDX-FileCopyrightText: 2007 Simon Hürlimann <simon.huerlimann@huerlisi.ch>
0004     SPDX-FileCopyrightText: 2007-2008 Fela Winkelmolen <fela.kde@gmail.com>
0005     SPDX-FileCopyrightText: 2010 Brian Croom <brian.s.croom@gmail.com>
0006     SPDX-FileCopyrightText: 2013 Ashwin Rajeev <ashwin_rajeev@hotmail.com>
0007 
0008     SPDX-License-Identifier: GPL-2.0-or-later
0009 */
0010 
0011 #ifndef MAINWINDOW_H
0012 #define MAINWINDOW_H
0013 
0014 #include <KXmlGuiWindow>
0015 
0016 #include <QList>
0017 
0018 class KGameSound;
0019 class KGameClock;
0020 class KToggleAction;
0021 class GameView;
0022 class QLabel;
0023 
0024 class MainWindow : public KXmlGuiWindow
0025 {
0026 Q_OBJECT
0027 public:
0028     explicit MainWindow(QWidget *parent=nullptr);
0029 private:
0030     enum StatusBarIndex {
0031         StatusBarIndexMoves = 0,
0032         StatusBarIndexTime = 1
0033     };
0034     QSize boardSize();
0035 Q_SIGNALS:
0036     void pause(const QVariant &paused);
0037 private Q_SLOTS:
0038     void startNewGame();
0039     void gameOver(const QVariant &msg);
0040     void rotationStarted();
0041     void pauseGame(bool paused);
0042     void updateStatusBar();
0043 
0044     void showHighscores();
0045     void configureSettings();
0046 private:
0047     void setupActions();
0048 
0049     int           m_clickCount;
0050     KGameClock   *m_gameClock;
0051 
0052     KToggleAction* m_pauseAction;
0053 
0054     GameView *m_view;
0055     KGameSound *m_soundStart;
0056     KGameSound *m_soundWin;
0057     QLabel *m_timeLabel;
0058     QLabel *m_movesLabel;
0059 };
0060 
0061 #endif // MAINWINDOW_H