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

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

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

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

66 67 68
    bool m_firstShow;
    bool m_startInDemoMode;

69 70 71 72 73
    /**
     * 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.
     */
    int m_lowestSkill;

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