2008-06-07 21:11:57 +00:00
|
|
|
/***************************************************************************
|
|
|
|
|
* Copyright (C) 2006 by FThauer FHammer *
|
|
|
|
|
* f.thauer@web.de *
|
|
|
|
|
* *
|
|
|
|
|
* This program 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 of the License, or *
|
|
|
|
|
* (at your option) any later version. *
|
|
|
|
|
* *
|
|
|
|
|
* This program 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 this program; if not, write to the *
|
|
|
|
|
* Free Software Foundation, Inc., *
|
|
|
|
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
#ifndef STARTWINDOWIMPL_H
|
|
|
|
|
#define STARTWINDOWIMPL_H
|
|
|
|
|
|
2008-06-08 21:18:29 +00:00
|
|
|
#include <boost/shared_ptr.hpp>
|
2008-06-07 21:11:57 +00:00
|
|
|
#include "ui_startwindow.h"
|
2008-06-08 21:18:29 +00:00
|
|
|
#include "game_defs.h"
|
|
|
|
|
|
|
|
|
|
class GuiInterface;
|
2008-09-02 22:04:18 +00:00
|
|
|
class GuiWrapper;
|
2008-06-08 21:18:29 +00:00
|
|
|
class Session;
|
|
|
|
|
class Game;
|
2008-06-07 21:11:57 +00:00
|
|
|
|
|
|
|
|
class ConfigFile;
|
|
|
|
|
class gameTableImpl;
|
2008-06-08 21:18:29 +00:00
|
|
|
class newGameDialogImpl;
|
|
|
|
|
class settingsDialogImpl;
|
|
|
|
|
class selectAvatarDialogImpl;
|
|
|
|
|
class aboutPokerthImpl;
|
|
|
|
|
class joinNetworkGameDialogImpl;
|
|
|
|
|
class connectToServerDialogImpl;
|
|
|
|
|
class createNetworkGameDialogImpl;
|
|
|
|
|
class startNetworkGameDialogImpl;
|
|
|
|
|
class changeHumanPlayerNameDialogImpl;
|
|
|
|
|
class gameLobbyDialogImpl;
|
|
|
|
|
class timeoutMsgBoxImpl;
|
|
|
|
|
|
2008-06-07 21:11:57 +00:00
|
|
|
|
|
|
|
|
class startWindowImpl: public QMainWindow, public Ui::startWindow {
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2008-09-02 22:04:18 +00:00
|
|
|
startWindowImpl(ConfigFile *c =0);
|
2008-06-07 21:11:57 +00:00
|
|
|
|
2008-06-08 21:18:29 +00:00
|
|
|
void setSession(boost::shared_ptr<Session> session) { mySession = session; }
|
|
|
|
|
Session &getSession() { assert(mySession.get()); return *mySession; }
|
2008-06-07 21:11:57 +00:00
|
|
|
|
2008-06-08 21:18:29 +00:00
|
|
|
signals:
|
|
|
|
|
void signalShowClientDialog();
|
|
|
|
|
|
|
|
|
|
void signalNetClientConnect(int actionID);
|
|
|
|
|
void signalNetClientGameInfo(int actionID);
|
|
|
|
|
void signalNetClientError(int errorID, int osErrorID);
|
|
|
|
|
void signalNetClientNotification(int notificationId);
|
|
|
|
|
void signalNetClientStatsUpdate(ServerStats stats);
|
|
|
|
|
void signalNetClientShowTimeoutDialog(int, unsigned);
|
|
|
|
|
void signalNetClientRemovedFromGame(int notificationId);
|
|
|
|
|
void signalNetServerError(int errorID, int osErrorID);
|
|
|
|
|
void signalNetClientSelfJoined(unsigned playerId, QString playerName, int rights);
|
|
|
|
|
void signalNetClientPlayerJoined(unsigned playerId, QString playerName, int rights);
|
|
|
|
|
void signalNetClientPlayerChanged(unsigned playerId, QString newPlayerName);
|
|
|
|
|
void signalNetClientPlayerLeft(unsigned playerId, QString playerName);
|
|
|
|
|
void signalNetClientNewGameAdmin(unsigned playerId, QString playerName);
|
|
|
|
|
void signalNetClientGameListNew(unsigned gameId);
|
|
|
|
|
void signalNetClientGameListRemove(unsigned gameId);
|
|
|
|
|
void signalNetClientGameListUpdateMode(unsigned gameId, int mode);
|
|
|
|
|
void signalNetClientGameListUpdateAdmin(unsigned gameId, unsigned adminPlayerId);
|
|
|
|
|
void signalNetClientGameListPlayerJoined(unsigned gameId, unsigned playerId);
|
|
|
|
|
void signalNetClientGameListPlayerLeft(unsigned gameId, unsigned playerId);
|
|
|
|
|
void signalNetClientGameStart(boost::shared_ptr<Game> game);
|
|
|
|
|
void signalNetClientChatMsg(QString nickName, QString msg);
|
|
|
|
|
|
|
|
|
|
void signalIrcConnect(QString server);
|
|
|
|
|
void signalIrcSelfJoined(QString nickName, QString channel);
|
|
|
|
|
void signalIrcPlayerJoined(QString nickName);
|
|
|
|
|
void signalIrcPlayerChanged(QString oldNick, QString newNick);
|
|
|
|
|
void signalIrcPlayerKicked(QString nickName, QString byWhom, QString reason);
|
|
|
|
|
void signalIrcPlayerLeft(QString nickName);
|
|
|
|
|
void signalIrcChatMessage(QString nickName, QString msg);
|
|
|
|
|
void signalIrcError(int errorCode);
|
|
|
|
|
void signalIrcServerError(int errorCode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public slots:
|
2008-09-11 15:03:46 +00:00
|
|
|
|
|
|
|
|
void callAboutPokerthDialog();
|
|
|
|
|
void callSettingsDialog();
|
|
|
|
|
void callNewGameDialog();
|
|
|
|
|
void callGameLobbyDialog();
|
|
|
|
|
void callCreateNetworkGameDialog();
|
|
|
|
|
void callJoinNetworkGameDialog();
|
|
|
|
|
void showLobbyDialog();
|
|
|
|
|
void joinGameLobby();
|
|
|
|
|
void showClientDialog();
|
|
|
|
|
void showNetworkStartDialog();
|
2008-09-13 20:40:08 +00:00
|
|
|
|
|
|
|
|
void startNewLocalGame(newGameDialogImpl* =0);
|
2008-06-08 21:18:29 +00:00
|
|
|
|
2008-09-17 21:50:51 +00:00
|
|
|
void showTimeoutDialog(int msgID, unsigned duration);
|
|
|
|
|
void hideTimeoutDialog();
|
|
|
|
|
|
|
|
|
|
void networkError(int, int);
|
|
|
|
|
void networkNotification(int);
|
|
|
|
|
|
|
|
|
|
void networkStart(boost::shared_ptr<Game> game);
|
|
|
|
|
QStringList getPlayerNicksList();
|
|
|
|
|
|
2008-06-08 21:18:29 +00:00
|
|
|
private:
|
|
|
|
|
ConfigFile *myConfig;
|
|
|
|
|
|
2008-09-04 22:21:00 +00:00
|
|
|
boost::shared_ptr<GuiInterface> myGuiInterface;
|
2008-06-08 21:18:29 +00:00
|
|
|
boost::shared_ptr<Session> mySession;
|
|
|
|
|
boost::shared_ptr<GuiInterface> myServerGuiInterface;
|
|
|
|
|
|
|
|
|
|
// Dialogs
|
2008-09-03 22:29:28 +00:00
|
|
|
aboutPokerthImpl *myAboutPokerthDialog;
|
|
|
|
|
newGameDialogImpl *myNewGameDialog;
|
|
|
|
|
settingsDialogImpl *mySettingsDialog;
|
|
|
|
|
selectAvatarDialogImpl *mySelectAvatarDialog;
|
|
|
|
|
changeHumanPlayerNameDialogImpl *myChangeHumanPlayerNameDialog;
|
|
|
|
|
joinNetworkGameDialogImpl *myJoinNetworkGameDialog;
|
|
|
|
|
connectToServerDialogImpl *myConnectToServerDialog;
|
|
|
|
|
startNetworkGameDialogImpl *myStartNetworkGameDialog;
|
|
|
|
|
createNetworkGameDialogImpl *myCreateNetworkGameDialog;
|
|
|
|
|
gameLobbyDialogImpl *myGameLobbyDialog;
|
|
|
|
|
timeoutMsgBoxImpl *myTimeoutDialog;
|
|
|
|
|
startWindowImpl *myStartWindow;
|
2008-06-08 21:18:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
friend class GuiWrapper;
|
2008-06-07 21:11:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|