mainwindow.h 2.32 KB
Newer Older
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/*******************************************************************
 *
 * Copyright 2006 Dmitry Suzdalev <dimsuz@gmail.com>
 *
 * This file is part of the KDE project "KReversi"
 *
 * KReversi is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * KReversi is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with KReversi; see the file COPYING.  If not, write to
 * the Free Software Foundation, 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 *
 ********************************************************************/
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
23 24 25
#ifndef KREVERSI_MAIN_WINDOW_H
#define KREVERSI_MAIN_WINDOW_H

Kevin Ottens's avatar
Kevin Ottens committed
26
#include <kxmlguiwindow.h>
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
27

Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
28
class KReversiGame;
29
class KReversiView;
30
class QAction;
Laurent Montel's avatar
Laurent Montel committed
31
class KAction;
32
class KSelectAction;
33
class KToggleAction;
34 35
class QListWidget;
class QLabel;
36

Kevin Ottens's avatar
Kevin Ottens committed
37
class KReversiMainWindow : public KXmlGuiWindow
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
38
{
39
    Q_OBJECT
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
40
public:
41
    explicit KReversiMainWindow(QWidget* parent = 0,  bool startDemo = false);
42
public slots:
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
43
    void slotNewGame();
44
    void levelChanged();
45
    void slotAnimSpeedChanged(int);
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
46
    void slotUndo();
47
    void slotMoveFinished();
48
    void slotGameOver();
49
    void slotToggleDemoMode();
50
    void slotUseColoredChips(bool);
51
    void slotShowMovesHistory(bool);
52
    void slotHighscores();
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
53
private:
54
    virtual void showEvent(QShowEvent*);
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
55
    void setupActions();
56
    void loadSettings();
57 58
    QString opponentName() const;
    void updateScores();
59

60
    KReversiView  *m_view;
61
    KReversiGame  *m_game;
62
    QDockWidget   *m_historyDock;
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
63
    QListWidget   *m_historyView;
64

65 66 67
    bool m_firstShow;
    bool m_startInDemoMode;

68
    /**
69 70 71
     * Used for the high scores: if the player changes the difficulty level
     * during a running game, we'll keep the lowest computer skill corresponding
     * to the levels chosen.
72 73 74
     */
    int m_lowestSkill;

75 76 77
    QAction* m_undoAct;
    QAction* m_hintAct;
    QAction* m_demoAct;
78
    KSelectAction* m_animSpeedAct;
79
    KToggleAction* m_coloredChipsAct;
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
80 81
};
#endif