kchat.h
00001 /* 00002 This file is part of the KDE games library 00003 Copyright (C) 2001 Andreas Beckermann (b_mann@gmx.de) 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 #ifndef __KCHAT_H__ 00020 #define __KCHAT_H__ 00021 00022 #include <tqstring.h> 00023 00024 #include "kchatbase.h" 00025 #include <kdemacros.h> 00026 00027 class KChatPrivate; 00028 00036 class KDE_EXPORT KChat : public KChatBase 00037 { 00038 Q_OBJECT 00039 TQ_OBJECT 00040 public: 00047 KChat(TQWidget* parent, bool twoPlayerGame = false); 00048 00049 virtual ~KChat(); 00050 00056 virtual const TQString& fromName() const; 00057 00063 void setFromNickname(const TQString& name); 00064 00065 // TODO: 00066 // void setPlayerList(TQIntDict<TQString>);// use this for non-KGame use 00067 00072 int addPlayer(const TQString& nick); 00073 00080 void removePlayer(const TQString& nick); 00081 00086 void removePlayer(int id); 00087 00088 00094 bool autoAddMessages() const; 00095 00104 void setAutoAddMessages(bool add); 00105 00109 const TQString& player(int id) const; 00110 00115 int fromId() const; 00116 00117 00118 signals: 00128 void signalSendMessage(int id, const TQString& msg); 00129 00130 protected: 00135 virtual void returnPressed(const TQString&); 00136 00140 int uniqueId(); 00141 00142 private: 00143 void init(); 00144 00145 KChatPrivate* d; 00146 }; 00147 00148 #endif