Files
pokerth/src/gui/qt/startwindow/startwindowimpl.h
T

188 lines
6.7 KiB
C++
Raw Normal View History

/*****************************************************************************
* PokerTH - The open source texas holdem engine *
* Copyright (C) 2006-2011 Felix Hammer, Florian Thauer, Lothar May *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Affero General Public License as *
* published by the Free Software Foundation, either version 3 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 Affero General Public License for more details. *
* *
* You should have received a copy of the GNU Affero General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
2011-07-03 19:45:08 +00:00
*****************************************************************************/
#ifndef STARTWINDOWIMPL_H
2008-06-07 21:11:57 +00:00
#define STARTWINDOWIMPL_H
2008-06-08 21:18:29 +00:00
#include <boost/shared_ptr.hpp>
2009-09-27 21:46:44 +00:00
#include <assert.h>
#ifdef GUI_800x480
#include "ui_startwindow_800x480.h"
#else
2008-06-07 21:11:57 +00:00
#include "ui_startwindow.h"
#endif
2008-06-08 21:18:29 +00:00
#include "game_defs.h"
2011-02-09 16:25:05 +00:00
#include <QMessageBox>
2008-06-08 21:18:29 +00:00
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;
2009-04-05 12:32:16 +00:00
class serverListDialogImpl;
2009-08-27 10:19:11 +00:00
class internetGameLoginDialogImpl;
class guiLog;
class Log;
2008-06-07 21:11:57 +00:00
class startWindowImpl: public QMainWindow, public Ui::startWindow
{
2011-10-20 14:13:25 +00:00
Q_OBJECT
2008-06-07 21:11:57 +00:00
public:
startWindowImpl(ConfigFile *c, Log *l);
2011-10-20 14:13:25 +00:00
~startWindowImpl();
2008-06-07 21:11:57 +00:00
2011-10-20 14:13:25 +00:00
void setSession(boost::shared_ptr<Session> session) {
mySession = session;
}
boost::shared_ptr<Session> getSession() {
assert(mySession.get());
return mySession;
}
boost::shared_ptr< GuiInterface > getMyServerGuiInterface() const {
return myServerGuiInterface;
}
connectToServerDialogImpl* getMyConnectToServerDialog() const {
return myConnectToServerDialog;
}
2010-03-30 12:25:30 +00:00
void setGuiLog(guiLog* l) {
myGuiLog = l;
}
2011-10-20 14:13:25 +00:00
// void keyPressEvent( QKeyEvent *);
bool eventFilter(QObject *obj, QEvent *event);
signals:
2011-10-20 14:13:25 +00:00
void signalShowClientDialog();
2008-06-08 21:18:29 +00:00
2011-10-20 14:13:25 +00:00
void signalNetClientConnect(int actionID);
void signalNetClientServerListShow();
void signalNetClientServerListClear();
void signalNetClientServerListAdd(unsigned serverId);
void signalNetClientLoginShow();
void signalNetClientRejoinPossible(unsigned gameId);
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, bool isGameAdmin);
void signalNetClientPlayerJoined(unsigned playerId, QString playerName, bool isGameAdmin);
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 signalNetClientGameChatMsg(QString nickName, QString msg);
void signalNetClientLobbyChatMsg(QString nickName, QString msg);
void signalNetClientPrivateChatMsg(QString nickName, QString msg);
void signalNetClientMsgBox(QString msg);
void signalNetClientMsgBox(unsigned msgId);
2008-06-08 21:18:29 +00:00
2011-10-20 14:13:25 +00:00
void signalLobbyPlayerJoined(unsigned playerId, QString nickName);
void signalLobbyPlayerKicked(QString nickName, QString byWhom, QString reason);
void signalLobbyPlayerLeft(unsigned playerId);
2010-03-30 12:25:30 +00:00
2011-10-20 14:13:25 +00:00
void signalSelfGameInvitation(unsigned gameId, unsigned playerIdFrom);
void signalPlayerGameInvitation(unsigned gameId, unsigned playerIdWho, unsigned playerIdFrom);
void signalRejectedGameInvitation(unsigned gameId, unsigned playerIdWho, DenyGameInvitationReason reason);
2010-03-29 13:08:59 +00:00
public slots:
2011-10-20 14:13:25 +00:00
void callAboutPokerthDialog();
void callSettingsDialog(bool);
void callSettingsDialogFromStartwindow();
2011-10-20 14:13:25 +00:00
void callNewGameDialog();
void callGameLobbyDialog();
void callCreateNetworkGameDialog();
void callJoinNetworkGameDialog();
void showLobbyDialog();
void callInternetGameLoginDialog();
void callRejoinPossibleDialog(unsigned);
void joinGameLobby();
void showClientDialog();
void showNetworkStartDialog();
2011-10-20 14:13:25 +00:00
void startNewLocalGame(newGameDialogImpl* =0);
2008-06-08 21:18:29 +00:00
2011-10-20 14:13:25 +00:00
void showTimeoutDialog(int msgID, unsigned duration);
void hideTimeoutDialog();
2011-10-20 14:13:25 +00:00
void networkError(int, int);
void networkNotification(int);
void networkMessage(QString);
void networkMessage(unsigned);
2010-03-30 12:25:30 +00:00
2011-10-20 14:13:25 +00:00
void networkStart(boost::shared_ptr<Game> game);
QStringList getPlayerNicksList();
2011-10-20 14:13:25 +00:00
QString checkForFirstStartAfterUpdated();
2008-06-08 21:18:29 +00:00
private:
2011-10-20 14:13:25 +00:00
ConfigFile *myConfig;
guiLog *myGuiLog;
Log *myLog;
2008-06-08 21:18:29 +00:00
2011-10-20 14:13:25 +00:00
boost::shared_ptr<GuiInterface> myGuiInterface;
boost::shared_ptr<Session> mySession;
boost::shared_ptr<GuiInterface> myServerGuiInterface;
2008-06-08 21:18:29 +00:00
2011-10-20 14:13:25 +00:00
// Dialogs
aboutPokerthImpl *myAboutPokerthDialog;
newGameDialogImpl *myNewGameDialog;
settingsDialogImpl *mySettingsDialog;
selectAvatarDialogImpl *mySelectAvatarDialog;
joinNetworkGameDialogImpl *myJoinNetworkGameDialog;
connectToServerDialogImpl *myConnectToServerDialog;
startNetworkGameDialogImpl *myStartNetworkGameDialog;
createNetworkGameDialogImpl *myCreateNetworkGameDialog;
gameLobbyDialogImpl *myGameLobbyDialog;
timeoutMsgBoxImpl *myTimeoutDialog;
startWindowImpl *myStartWindow;
serverListDialogImpl *myServerListDialog;
internetGameLoginDialogImpl *myInternetGameLoginDialog;
2010-03-30 12:25:30 +00:00
2011-10-20 14:13:25 +00:00
QMessageBox msgBoxOutdatedVersion;
bool msgBoxOutdatedVersionActive;
2010-08-15 20:11:31 +00:00
2011-10-20 14:13:25 +00:00
friend class GuiWrapper;
2008-06-07 21:11:57 +00:00
};
#endif