| 1 | /*************************************************************************** |
| 2 | * Copyright (C) 2009 by The qGo Project * |
| 3 | * * |
| 4 | * This file is part of qGo. * |
| 5 | * * |
| 6 | * qGo is free software: you can redistribute it and/or modify * |
| 7 | * it under the terms of the GNU General Public License as published by * |
| 8 | * the Free Software Foundation; either version 2 of the License, or * |
| 9 | * (at your option) any later version. * |
| 10 | * * |
| 11 | * This program is distributed in the hope that it will be useful, * |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 14 | * GNU General Public License for more details. * |
| 15 | * * |
| 16 | * You should have received a copy of the GNU General Public License * |
| 17 | * along with this program; if not, see <http://www.gnu.org/licenses/> * |
| 18 | * or write to the Free Software Foundation, Inc., * |
| 19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
| 20 | ***************************************************************************/ |
| 21 | |
| 22 | |
| 23 | #ifndef ROOM_H |
| 24 | #define ROOM_Hcxx . . $ `src/network/room.h:24:9`! |
| 25 | |
| 26 | #include <QObject> |
| 27 | #include <QString> |
| 28 | #include <QTableView> |
| 29 | |
| 30 | class NetworkConnectioncxx . . $ NetworkConnection#; |
| 31 | class BoardDispatchcxx . . $ BoardDispatch#; |
| 32 | class PlayerListingcxx . . $ PlayerListing#; |
| 33 | class GameListingcxx . . $ GameListing#; |
| 34 | class FilteredViewcxx . . $ FilteredView#; |
| 35 | class PlayerListModelcxx . . $ PlayerListModel#; |
| 36 | class GamesListModelcxx . . $ GamesListModel#; |
| 37 | class Talkcxx . . $ Talk#; |
| 38 | |
| 39 | /* The main purpose of this class is to manage player and game listings. |
| 40 | * Listings must be created and retrieved using get...() methods of this class. |
| 41 | * After modification of a listing, the corresponding recv...() method should be called |
| 42 | * (this can be done asynchronously using Qt's signal/slot mechanism). |
| 43 | * In the current implementation listings are never removed, so other objects may rely |
| 44 | * on pointers to listings remaining valid (until the connection is destroyed). */ |
| 45 | |
| 46 | class Roomcxx . . $ Room# : public QObjectcxx . . $ QObject# |
| 47 | { |
| 48 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 49 | |
| 50 | public: |
| 51 | Roomcxx . . $ Room#Room(bdf7e61fb2b15626).(NetworkConnectioncxx . . $ NetworkConnection# * c); |
| 52 | void setConnectioncxx . . $ Room#setConnection(bdf7e61fb2b15626).(NetworkConnectioncxx . . $ NetworkConnection# * c); |
| 53 | virtual ~cxx . . $ Room#`~Room`(ced63f7c635d850d).Roomcxx . . $ Room#(); |
| 54 | void onErrorcxx . . $ Room#onError(49f6e7a06ebc5aa8).(void); |
| 55 | void recvTogglecxx . . $ Room#recvToggle(918ebd27a9ddbad3).(int type, bool val); |
| 56 | |
| 57 | // These functions create a listing if it does not exist |
| 58 | PlayerListingcxx . . $ PlayerListing# * getPlayerListingcxx . . $ Room#getPlayerListing(d3f53ac2de9f0b45).(const QStringcxx . . $ QString# & name); |
| 59 | PlayerListingcxx . . $ PlayerListing# * getPlayerListingcxx . . $ Room#getPlayerListing(ad2afa9294843726).(const unsigned int id); |
| 60 | PlayerListingcxx . . $ PlayerListing# * getPlayerListingByNotNicknamecxx . . $ Room#getPlayerListingByNotNickname(d3f53ac2de9f0b45).(const QStringcxx . . $ QString# & notnickname); |
| 61 | GameListingcxx . . $ GameListing# * getGameListingcxx . . $ Room#getGameListing(d402167d8f57cf00).(unsigned int key); |
| 62 | |
| 63 | BoardDispatchcxx . . $ BoardDispatch# * getNewBoardDispatchcxx . . $ Room#getNewBoardDispatch(f34f0704202202).(unsigned int key); |
| 64 | |
| 65 | // This function creates a Talk if it does not exist |
| 66 | Talkcxx . . $ Talk# * getTalkcxx . . $ Room#getTalk(e709c6e389e35213).(PlayerListingcxx . . $ PlayerListing# *opponent); |
| 67 | // This function returns NULL if no Talk exists |
| 68 | Talkcxx . . $ Talk# * getIfTalkcxx . . $ Room#getIfTalk(b72f705c6951e6b6).(const PlayerListingcxx . . $ PlayerListing# *opponent); |
| 69 | void closeTalkcxx . . $ Room#closeTalk(cac334474c82cf3a).(const PlayerListingcxx . . $ PlayerListing# *opponent); |
| 70 | |
| 71 | void slot_refreshGamescxx . . $ Room#slot_refreshGames(49f6e7a06ebc5aa8).(void); |
| 72 | void slot_refreshPlayerscxx . . $ Room#slot_refreshPlayers(49f6e7a06ebc5aa8).(void); |
| 73 | void recvPlayerListingcxx . . $ Room#recvPlayerListing(122195e397f39e1b).(PlayerListingcxx . . $ PlayerListing# *g); |
| 74 | void recvGameListingcxx . . $ Room#recvGameListing(9a447f3b9a8a5041).(GameListingcxx . . $ GameListing# *g); |
| 75 | protected: |
| 76 | unsigned int playerscxx . . $ Room#players.; |
| 77 | unsigned int gamescxx . . $ Room#games.; |
| 78 | private: |
| 79 | PlayerListModelcxx . . $ PlayerListModel# * playerListModelcxx . . $ Room#playerListModel.; |
| 80 | GamesListModelcxx . . $ GamesListModel# * gamesListModelcxx . . $ Room#gamesListModel.; |
| 81 | |
| 82 | QTableViewcxx . . $ QTableView# * playerViewcxx . . $ Room#playerView., * gamesViewcxx . . $ Room#gamesView.; |
| 83 | NetworkConnectioncxx . . $ NetworkConnection# * connectioncxx . . $ Room#connection.; |
| 84 | QModelIndexcxx . . $ QModelIndex# popup_itemcxx . . $ Room#popup_item.; |
| 85 | |
| 86 | GameListingcxx . . $ GameListing# * popup_gamelistingcxx . . $ Room#popup_gamelisting.; |
| 87 | PlayerListingcxx . . $ PlayerListing# * popup_playerlistingcxx . . $ Room#popup_playerlisting.; |
| 88 | |
| 89 | QActioncxx . . $ QAction# *statsActcxx . . $ Room#statsAct., *matchActcxx . . $ Room#matchAct., *talkActcxx . . $ Room#talkAct., *removeFriendActcxx . . $ Room#removeFriendAct., *addFriendActcxx . . $ Room#addFriendAct., *removeWatchActcxx . . $ Room#removeWatchAct., *addWatchActcxx . . $ Room#addWatchAct., *blockActcxx . . $ Room#blockAct.; |
| 90 | QActioncxx . . $ QAction# *joinObserveActcxx . . $ Room#joinObserveAct., *observeOutsideActcxx . . $ Room#observeOutsideAct.; |
| 91 | |
| 92 | QMapcxx . . $ QMap# <const PlayerListingcxx . . $ PlayerListing# *, Talkcxx . . $ Talk# *> talkMapcxx . . $ Room#talkMap.; |
| 93 | |
| 94 | // These functions expect QModelIndex from the proxy models |
| 95 | void slot_playerOpenTalkcxx . . $ Room#slot_playerOpenTalk(87a6de385263c395).(const QModelIndexcxx . . $ QModelIndex# &); |
| 96 | void slot_gamesDoubleClickedcxx . . $ Room#slot_gamesDoubleClicked(87a6de385263c395).(const QModelIndexcxx . . $ QModelIndex# &); |
| 97 | void slot_showPopupcxx . . $ Room#slot_showPopup(4f9e9534be445c03).(const QPointcxx . . $ QPoint# & iPoint); |
| 98 | void slot_showGamesPopupcxx . . $ Room#slot_showGamesPopup(4f9e9534be445c03).(const QPointcxx . . $ QPoint# & iPoint); |
| 99 | private: |
| 100 | void openTalkcxx . . $ Room#openTalk(122195e397f39e1b).(PlayerListingcxx . . $ PlayerListing# * listing); |
| 101 | }; |
| 102 | |
| 103 | #endif //ROOM_H |