From ce3329047d378a14006ce74ec273ac59e3375303 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 12 May 2010 19:42:27 +0200 Subject: initial import of latest svn version --- src/core/pvsChatClient.h | 71 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 src/core/pvsChatClient.h (limited to 'src/core/pvsChatClient.h') diff --git a/src/core/pvsChatClient.h b/src/core/pvsChatClient.h new file mode 100644 index 0000000..2cb5d9f --- /dev/null +++ b/src/core/pvsChatClient.h @@ -0,0 +1,71 @@ +/* +# Copyright (c) 2009 - OpenSLX Project, Computer Center University of Freiburg +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your suggestions, praise, or complaints to feedback@openslx.org +# +# General information about OpenSLX can be found at http://openslx.org/ +*/ + +// pvsChatClient.h + +#ifndef PVSCHATCLIENT_H_ +#define PVSCHATCLIENT_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "src/net/pvsMsg.h" +#include "src/core/pvsChatMsg.h" +#include "src/net/pvsServerConnection.h" +#include "src/util/consoleLogger.h" +#include "src/util/util.h" + +class PVS; // forward declaration. + +class PVSChatClient +{ + +public: + + PVSChatClient(); + ~PVSChatClient(); + void setServerConnection(PVSServerConnection* sc); + void setSource(QString name); + QString getSource(); + QStringList getClients(); + QString getIPFromUsername(QString username); + void addClient(QString name, QString ip); + void removeClient(QString name); + void clearClients(); + void send(QString tar, QString msg); + void receive(PVSMsg recv); + bool isRegistered(); + EventDispatcher& getChatMsgHandler() + { + return _chatMessageDispatcher; + }; + EventDispatcher& getChatCommandHandler() + { + return _chatCommandDispatcher; + }; + +private: + + QString _source; + bool _registered; + QStringList _clients; + QHash _clientsData; + PVSServerConnection *_chatServerConnection; + EventDispatcher _chatMessageDispatcher; + EventDispatcher _chatCommandDispatcher; +}; +#endif -- cgit v1.2.3-55-g7522