mainwindow.h 2.7 KB
Newer Older
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
1 2 3
/*******************************************************************
 *
 * Copyright 2006 Dmitry Suzdalev <dimsuz@gmail.com>
Denis Kuplyakov's avatar
Denis Kuplyakov committed
4
 * Copyright 2013 Denis Kuplyakov <dener.kup@gmail.com>
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
 *
 * 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
24 25 26
#ifndef KREVERSI_MAIN_WINDOW_H
#define KREVERSI_MAIN_WINDOW_H

Denis Kuplyakov's avatar
Denis Kuplyakov committed
27 28
#include <KXmlGuiWindow>
#include <preferences.h>
Denis Kuplyakov's avatar
Denis Kuplyakov committed
29 30 31 32 33 34

#include <QApplication>
#include <QListWidget>
#include <QDockWidget>

#include <KAction>
Denis Kuplyakov's avatar
Denis Kuplyakov committed
35 36
#include <KToggleAction>
#include <KSelectAction>
Denis Kuplyakov's avatar
Denis Kuplyakov committed
37

Denis Kuplyakov's avatar
Denis Kuplyakov committed
38
#include <startgamedialog.h>
39

Denis Kuplyakov's avatar
Denis Kuplyakov committed
40 41
#include <kreversigame.h>
#include <kreversiview.h>
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
42

Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
43
class KReversiGame;
44
class KReversiView;
45

Kevin Ottens's avatar
Kevin Ottens committed
46
class KReversiMainWindow : public KXmlGuiWindow
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
47
{
48
    Q_OBJECT
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
49
public:
50
    explicit KReversiMainWindow(QWidget* parent = 0,  bool startDemo = false);
51
    ~KReversiMainWindow();
52
public slots:
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
53
    void slotNewGame();
54
    void levelChanged();
55
    void slotAnimSpeedChanged(int);
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
56
    void slotUndo();
57
    void slotMoveFinished();
58
    void slotGameOver();
59
    void slotUseColoredChips(bool);
60
    void slotShowMovesHistory(bool);
61
    void slotHighscores();
62
    void slotDialogReady();
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
63
private:
64
    virtual void showEvent(QShowEvent*);
65 66 67
    void setupActionsInit();
    void setupActionsStart();
    void setupActionsGame();
68
    void loadSettings();
69
    void updateStatusBar();
70
    void updateHistory();
71 72 73 74 75
    void startDemo();
    void clearPlayers();
    void receivedGameStartInformation(GameStartInformation info);
    KReversiPlayer *m_player[2];

76
    StartGameDialog *m_startDialog;
77 78
    GameStartInformation m_nowPlayingInfo;

79

80
    KReversiView  *m_view;
81
    KReversiGame  *m_game;
82
    QDockWidget   *m_historyDock;
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
83
    QListWidget   *m_historyView;
84

85 86 87
    bool m_firstShow;
    bool m_startInDemoMode;

88 89
    KgThemeProvider *m_provider;

90 91 92 93 94 95 96
    QAction *m_undoAct;
    QAction *m_hintAct;
    KToggleAction *m_showLast;
    KToggleAction *m_showLegal;
    KToggleAction *m_showMovesAct;
    KSelectAction *m_animSpeedAct;
    KToggleAction *m_coloredChipsAct;
Dmitry Suzdalev's avatar
Dmitry Suzdalev committed
97 98
};
#endif