SVN_SILENT made messages (.desktop file)
[kdegames.git] / kbattleship / src / simplemenu.h
bloba13f1394952c1bc6474be76a03d4fb5917af74a9
1 /*
2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 */
10 #ifndef SIMPLEMENU_H
11 #define SIMPLEMENU_H
13 #include <QObject>
15 class WelcomeScreen;
16 class Controller;
17 class SeaView;
18 class ChatWidget;
19 class Button;
20 class QTcpSocket;
21 class Entity;
22 class Protocol;
23 class KUrl;
25 class SimpleMenu : public QObject
27 Q_OBJECT
28 WelcomeScreen* m_screen;
30 Button* m_local_game_btn;
31 Button* m_server_btn;
32 Button* m_client_btn;
34 Protocol* m_protocol;
35 QString m_nickname;
37 enum State
39 READY,
40 DONE_LOCAL_GAME,
41 DONE_SERVER,
42 DONE_CLIENT,
43 DONE_GGZ_CLIENT
44 } m_state;
46 Entity* m_player1;
47 Entity* m_player2;
49 void finalize(State, const QString& nick, QTcpSocket* socket = 0);
50 public:
51 SimpleMenu(QWidget* parent, WelcomeScreen* screen);
53 void setupController(Controller* controller, Entity* old_opponent,
54 SeaView* sea, ChatWidget* chat, bool ask = false);
55 void createClient(const KUrl& url);
56 void runGGZ(int fd);
58 Entity* player(int p) { return p == 0 ? m_player1 : m_player2; }
60 static const char* iconLocal;
61 static const char* iconServer;
62 static const char* iconClient;
63 public slots:
64 void localGame();
66 void createServer();
67 void createClient();
68 signals:
69 void done();
72 #endif // SIMPLEMENU_H