1 | /******************************************************************* |
2 | * |
3 | * Copyright 2006 Dmitry Suzdalev <dimsuz@gmail.com> |
4 | * Copyright 2013 Denis Kuplyakov <dener.kup@gmail.com> |
5 | * |
6 | * This file is part of the KDE project "KReversi" |
7 | * |
8 | * KReversi is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 2, or (at your option) |
11 | * any later version. |
12 | * |
13 | * KReversi is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * GNU General Public License for more details. |
17 | * |
18 | * You should have received a copy of the GNU General Public License |
19 | * along with KReversi; see the file COPYING. If not, write to |
20 | * the Free Software Foundation, 51 Franklin Street, Fifth Floor, |
21 | * Boston, MA 02110-1301, USA. |
22 | * |
23 | ********************************************************************/ |
24 | #ifndef KREVERSI_MAIN_WINDOW_H |
25 | #define KREVERSI_MAIN_WINDOW_H |
26 | |
27 | #include <KXmlGuiWindow> |
28 | #include <preferences.h> |
29 | |
30 | #include <QApplication> |
31 | #include <QListWidget> |
32 | #include <QDockWidget> |
33 | |
34 | #include <KAction> |
35 | #include <KToggleAction> |
36 | #include <KSelectAction> |
37 | |
38 | #include <startgamedialog.h> |
39 | |
40 | #include <kreversigame.h> |
41 | #include <kreversiview.h> |
42 | |
43 | class KReversiGame; |
44 | class KReversiView; |
45 | |
46 | class KReversiMainWindow : public KXmlGuiWindow |
47 | { |
48 | Q_OBJECT |
49 | public: |
50 | explicit KReversiMainWindow(QWidget* parent = 0, bool startDemo = false); |
51 | ~KReversiMainWindow(); |
52 | public slots: |
53 | void slotNewGame(); |
54 | void levelChanged(); |
55 | void slotAnimSpeedChanged(int); |
56 | void slotUndo(); |
57 | void slotMoveFinished(); |
58 | void slotGameOver(); |
59 | void slotUseColoredChips(bool); |
60 | void slotShowMovesHistory(bool); |
61 | void slotHighscores(); |
62 | void slotDialogReady(); |
63 | private: |
64 | virtual void showEvent(QShowEvent*); |
65 | void setupActionsInit(); |
66 | void setupActionsStart(); |
67 | void setupActionsGame(); |
68 | void loadSettings(); |
69 | void updateStatusBar(); |
70 | void updateHistory(); |
71 | void startDemo(); |
72 | void clearPlayers(); |
73 | void receivedGameStartInformation(GameStartInformation info); |
74 | KReversiPlayer *m_player[2]; |
75 | |
76 | StartGameDialog *m_startDialog; |
77 | GameStartInformation m_nowPlayingInfo; |
78 | |
79 | |
80 | KReversiView *m_view; |
81 | KReversiGame *m_game; |
82 | QDockWidget *m_historyDock; |
83 | QListWidget *m_historyView; |
84 | |
85 | bool m_firstShow; |
86 | bool m_startInDemoMode; |
87 | |
88 | KgThemeProvider *m_provider; |
89 | |
90 | QAction *m_undoAct; |
91 | QAction *m_hintAct; |
92 | KToggleAction *m_showLast; |
93 | KToggleAction *m_showLegal; |
94 | KToggleAction *m_showMovesAct; |
95 | KSelectAction *m_animSpeedAct; |
96 | KToggleAction *m_coloredChipsAct; |
97 | }; |
98 | #endif |
99 | |