File indexing completed on 2024-12-08 09:47:02

0001 // Copyright (c) 2002-2003 Rob Kaper <cap@capsi.com>
0002 //
0003 // This program is free software; you can redistribute it and/or
0004 // modify it under the terms of the GNU General Public License
0005 // version 2 as published by the Free Software Foundation.
0006 //
0007 // This program is distributed in the hope that it will be useful,
0008 // but WITHOUT ANY WARRANTY; without even the implied warranty of
0009 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0010 // General Public License for more details.
0011 //
0012 // You should have received a copy of the GNU General Public License
0013 // along with this program; see the file COPYING.  If not, write to
0014 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0015 // Boston, MA 02110-1301, USA.
0016 
0017 #ifndef ATLANTIK_SELECTGAME_WIDGET_H
0018 #define ATLANTIK_SELECTGAME_WIDGET_H
0019 
0020 #include <QWidget>
0021 
0022 #include <ui_selectgame.h>
0023 
0024 class QPushButton;
0025 class QTreeWidget;
0026 class QTreeWidgetItem;
0027 
0028 class AtlanticCore;
0029 class Game;
0030 class Player;
0031 
0032 class SelectGame : public QWidget, private Ui::SelectGame
0033 {
0034 Q_OBJECT
0035 
0036 public:
0037     SelectGame(AtlanticCore *atlanticCore, QWidget *parent);
0038 
0039 private Q_SLOTS:
0040     void connectClicked();
0041     void addGame(Game *game);
0042     void delGame(Game *game);
0043     void updateGame(Game *game);
0044     void playerChanged(Player *player);
0045     void validateConnectButton();
0046 
0047 Q_SIGNALS:
0048     void joinGame(int gameId);
0049     void watchGame(int gameId);
0050     void newGame(const QString &gameType);
0051     void leaveServer();
0052     void msgStatus(const QString &status);
0053 
0054 private:
0055     QTreeWidgetItem *findItem(Game *game);
0056 
0057     AtlanticCore *m_atlanticCore;
0058 };
0059 
0060 #endif