Connect more signals on the server side.
[GoMoku3D.git] / src / gui / MainWindow.h
blobca5a6b970f9130e3328937d1f8b5b158e82c48eb
1 /********************************************************************
3 * Copyright (C) 2008 Davide Pesavento
5 * This file is part of GoMoku3D.
7 * GoMoku3D is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * GoMoku3D is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with GoMoku3D. If not, see <http://www.gnu.org/licenses/>.
20 *******************************************************************/
22 #ifndef MAINWINDOW_H
23 #define MAINWINDOW_H
25 #include <QMainWindow>
26 #include <QModelIndex>
27 #include <QList>
28 #include <QTableView>
29 #include <QDockWidget>
31 #include "Move.h"
32 #include "PlayerInfo.h"
33 #include "ui_MainWindow.h"
34 #include "Player.h"
36 class GameLoop;
37 class Network;
38 class SettingsManager;
39 class Suggester;
40 class RenderWidget;
41 class ChatWidget;
42 class TimerWidget;
43 class HistoryModel;
44 class PlayersWidget;
46 class MainWindow : public QMainWindow, private Ui_MainWindow
48 Q_OBJECT
50 friend class OnlineDialog;
51 friend class ServerSettingsDialog;
53 public:
54 MainWindow();
55 ~MainWindow();
56 QModelIndex actualViewIndex() const;
57 bool isOnlineGame() const;
59 public slots:
60 //void loadGame();
61 void saveGame();
62 void turn(int playerId);
63 void drawMove(Move move);
64 void undoMoves(QModelIndex index);
65 void showPastGameStatus(QModelIndex index);
66 void newStandAloneGame();
67 void newOnlineGame();
68 void newServerGame();
69 void playerWin(int playerId);
70 void playersDraw(QList<int> playersIds);
71 void suggestMove();
72 void undoTurn();
74 private slots:
75 void showPreferences();
76 void showLastMove();
78 private:
79 GameLoop *_loop;
80 Network *_net;
81 SettingsManager *_settings;
82 QList<PlayerInfo> _playersInfo;
83 Suggester *_suggester;
84 RenderWidget *_render;
85 ChatWidget *_chat;
86 HistoryModel *_history;
87 QTableView *_historyView;
88 TimerWidget *_timer;
89 PlayersWidget *_playersWidget;
90 QModelIndex _actualViewIndex;
91 int _actualPlayerIndex;
92 bool _isStandAloneGame;
93 bool _isOnlineGame;
94 bool _isServerGame;
95 bool _isDedicatedServer;
97 bool askUserConfirmation();
98 void disableOnEndGame();
99 void resetOnNewGame();
100 void connectAISkillSlider(QList<Player*> players);
102 signals:
103 void forceMove();
106 #endif