/* # 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