diff options
| author | Sebastian | 2010-05-12 19:42:27 +0200 |
|---|---|---|
| committer | Sebastian | 2010-05-12 19:42:27 +0200 |
| commit | ce3329047d378a14006ce74ec273ac59e3375303 (patch) | |
| tree | 782430f270b4c7aca1b35d5b7813518e3797c555 /src/core/pvsChatClient.h | |
| download | pvs-ce3329047d378a14006ce74ec273ac59e3375303.tar.gz pvs-ce3329047d378a14006ce74ec273ac59e3375303.tar.xz pvs-ce3329047d378a14006ce74ec273ac59e3375303.zip | |
initial import of latest svn version
Diffstat (limited to 'src/core/pvsChatClient.h')
| -rw-r--r-- | src/core/pvsChatClient.h | 71 |
1 files changed, 71 insertions, 0 deletions
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 <iostream> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sstream> +#include <fstream> +#include <QStringList> +#include <QHash> +#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<PVSChatMsg>& getChatMsgHandler() + { + return _chatMessageDispatcher; + }; + EventDispatcher<PVSChatMsg>& getChatCommandHandler() + { + return _chatCommandDispatcher; + }; + +private: + + QString _source; + bool _registered; + QStringList _clients; + QHash<QString, QString> _clientsData; + PVSServerConnection *_chatServerConnection; + EventDispatcher<PVSChatMsg> _chatMessageDispatcher; + EventDispatcher<PVSChatMsg> _chatCommandDispatcher; +}; +#endif |
