1 /*****************************************************************************
2  * PokerTH - The open source texas holdem engine                             *
3  * Copyright (C) 2006-2012 Felix Hammer, Florian Thauer, Lothar May          *
4  *                                                                           *
5  * This program is free software: you can redistribute it and/or modify      *
6  * it under the terms of the GNU Affero General Public License as            *
7  * published by the Free Software Foundation, either version 3 of the        *
8  * License, or (at your option) any later version.                           *
9  *                                                                           *
10  * This program is distributed in the hope that it will be useful,           *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             *
13  * GNU Affero General Public License for more details.                       *
14  *                                                                           *
15  * You should have received a copy of the GNU Affero General Public License  *
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.     *
17  *                                                                           *
18  *                                                                           *
19  * Additional permission under GNU AGPL version 3 section 7                  *
20  *                                                                           *
21  * If you modify this program, or any covered work, by linking or            *
22  * combining it with the OpenSSL project's OpenSSL library (or a             *
23  * modified version of that library), containing parts covered by the        *
24  * terms of the OpenSSL or SSLeay licenses, the authors of PokerTH           *
25  * (Felix Hammer, Florian Thauer, Lothar May) grant you additional           *
26  * permission to convey the resulting work.                                  *
27  * Corresponding Source for a non-source form of such a combination          *
28  * shall include the source code for the parts of OpenSSL used as well       *
29  * as that of the covered work.                                              *
30  *****************************************************************************/
31 #ifndef GUIINTERFACE_H
32 #define GUIINTERFACE_H
33 
34 #include <net/clientcallback.h>
35 #include <net/servercallback.h>
36 #include <net/irccallback.h>
37 #include <game_defs.h>
38 #include <string>
39 #include <boost/shared_ptr.hpp>
40 
41 class guiLog;
42 class Session;
43 class gameTableImpl;
44 
45 class GuiInterface : public ClientCallback, public ServerCallback, public IrcCallback
46 {
47 public:
48 	virtual ~GuiInterface();
49 
50 	virtual void initGui(int speed) =0;
51 
52 	virtual boost::shared_ptr<Session> getSession() =0;
53 	virtual void setSession(boost::shared_ptr<Session> session) =0;
54 
55 	virtual gameTableImpl *getMyW() const=0;
56 	virtual guiLog* getMyGuiLog() const=0;
57 
58 
59 	//refresh-Funktionen
60 	virtual void refreshSet() const=0;
61 	virtual void refreshCash() const=0;
62 	virtual void refreshAction(int =-1, int =-1) const=0;
63 	virtual void refreshChangePlayer() const=0;
64 	virtual void refreshPot() const=0;
65 	virtual void refreshGroupbox(int =-1, int =-1) const=0;
66 	virtual void refreshAll() const=0;
67 	virtual void refreshPlayerName() const=0;
68 	virtual void refreshButton() const =0;
69 	virtual void refreshGameLabels(GameState state) const=0;
70 
71 	virtual void setPlayerAvatar(int myUniqueID, const std::string &myAvatar) const=0;
72 	virtual void waitForGuiUpdateDone() const=0;
73 
74 	// Karten-Funktionen
75 	virtual void dealBeRoCards(int) =0;
76 	virtual void dealHoleCards()=0;
77 	virtual void dealFlopCards()=0;
78 	virtual void dealTurnCard()=0;
79 	virtual void dealRiverCard()=0;
80 
81 	virtual void nextPlayerAnimation()=0;
82 
83 	virtual void beRoAnimation2(int)=0;
84 
85 	virtual void preflopAnimation1()=0;
86 	virtual void preflopAnimation2()=0;
87 
88 	virtual void flopAnimation1()=0;
89 	virtual void flopAnimation2()=0;
90 
91 	virtual void turnAnimation1()=0;
92 	virtual void turnAnimation2()=0;
93 
94 	virtual void riverAnimation1()=0;
95 	virtual void riverAnimation2()=0;
96 
97 	virtual void postRiverAnimation1()=0;
98 	virtual void postRiverRunAnimation1()=0;
99 	virtual void flipHolecardsAllIn()=0;
100 
101 	virtual void nextRoundCleanGui()=0;
102 	virtual void meInAction()=0;
103 	virtual void updateMyButtonsState()=0;
104 	virtual void disableMyButtons()=0;
105 	virtual void startTimeoutAnimation(int playerNum, int timeoutSec) =0;
106 	virtual void stopTimeoutAnimation(int playerNum) =0;
107 
108 	virtual void startVoteOnKick(unsigned playerId, unsigned voteStarterPlayerId, int timeoutSec, int numVotesNeededToKick) =0;
109 	virtual void changeVoteOnKickButtonsState(bool showHide) =0;
110 	virtual void refreshVotesMonitor(int currentVotes, int numVotesNeededToKick) =0;
111 	virtual void endVoteOnKick() =0;
112 
113 	//log.cpp
114 	virtual void logPlayerActionMsg(std::string playName, int action, int setValue) =0;
115 	virtual void logNewGameHandMsg(int gameID, int HandID) =0;
116 	virtual	void logPlayerWinsMsg(std::string playerName, int pot, bool main) = 0;
117 	virtual	void logPlayerSitsOut(std::string playerName) = 0;
118 	virtual void logNewBlindsSetsMsg(int sbSet, int bbSet, std::string sbName, std::string bbName) =0;
119 	virtual void logDealBoardCardsMsg(int roundID, int card1, int card2, int card3, int card4 = -1, int card5 = -1) = 0;
120 	virtual void logFlipHoleCardsMsg(std::string playerName, int card1, int card2, int cardsValueInt = -1, std::string showHas = "shows") = 0;
121 	virtual void logPlayerWinGame(std::string playerName, int gameID) =0;
122 	virtual void flushLogAtGame(int gameID) =0;
123 	virtual void flushLogAtHand() =0;
124 
125 
126 };
127 
128 #endif
129