summaryrefslogtreecommitdiffstats
path: root/kbattleship/kbattleship/konnectionhandling.h
diff options
context:
space:
mode:
Diffstat (limited to 'kbattleship/kbattleship/konnectionhandling.h')
-rw-r--r--kbattleship/kbattleship/konnectionhandling.h73
1 files changed, 73 insertions, 0 deletions
diff --git a/kbattleship/kbattleship/konnectionhandling.h b/kbattleship/kbattleship/konnectionhandling.h
new file mode 100644
index 00000000..baa823df
--- /dev/null
+++ b/kbattleship/kbattleship/konnectionhandling.h
@@ -0,0 +1,73 @@
+/***************************************************************************
+ konnectionhandling.h
+ -----------------
+ Developers: (c) 2000-2001 Nikolas Zimmermann <wildfox@kde.org>
+ (c) 2000-2001 Daniel Molkentin <molkentin@kde.org>
+
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KONNECTIONHANDLING_H
+#define KONNECTIONHANDLING_H
+
+#include <klocale.h>
+#include <kmessagebox.h>
+
+#include <qobject.h>
+
+#include "kbattleshipclient.h"
+#include "kbattleshipserver.h"
+#include "kmessage.h"
+
+class KonnectionHandling : public QObject
+{
+ Q_OBJECT
+public:
+ enum{SERVER, CLIENT};
+ KonnectionHandling(QWidget *parent, KBattleshipServer *server);
+ KonnectionHandling(QWidget *parent, KBattleshipClient *client);
+
+ int type() { return m_type; }
+
+ void updateInternal(KBattleshipServer *server);
+ void updateInternal(KBattleshipClient *client);
+
+public slots:
+ void slotNewMessage(KMessage *msg);
+ void slotMessageSent(KMessage *msg);
+ void slotNewClient();
+ void slotLostClient();
+ void slotLostServer();
+ void slotSocketError(int error);
+
+signals:
+ void sigStatusBar(const QString &);
+ void sigEnemyNickname(const QString &);
+ void sigEnemyFieldData(int, int, int, int, int, int, int, bool);
+ void sigClientInformation(const QString &, const QString &, const QString &, const QString &);
+ void sigSendNickname();
+ void sigSendFieldState(int, int);
+ void sigPlaceShips(bool);
+ void sigShootable(bool);
+ void sigClientLost();
+ void sigServerLost();
+ void sigReplay();
+ void sigLost(KMessage *);
+ void sigAbortNetworkGame();
+ void sigChatMessage(const QString &, const QString &, bool);
+
+private:
+ KBattleshipServer *m_kbserver;
+ KBattleshipClient *m_kbclient;
+ int m_type;
+};
+
+#endif