libkdegames Library API Documentation

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., 59 Temple Place - Suite 330,
00017     Boston, MA 02111-1307, USA.
00018 */
00019 #ifndef __KCHAT_H__
00020 #define __KCHAT_H__
00021 
00022 #include <qstring.h>
00023 
00024 #include "kchatbase.h"
00025 
00026 class KChatPrivate;
00027 
00035 class KChat : public KChatBase
00036 {
00037     Q_OBJECT
00038 public:
00045     KChat(QWidget* parent, bool twoPlayerGame = false);
00046 
00047     virtual ~KChat();
00048 
00054     virtual const QString& fromName() const;
00055 
00061     void setFromNickname(const QString& name);
00062 
00063 //  TODO:
00064 //  void setPlayerList(QIntDict<QString>);// use this for non-KGame use
00065 
00070     int addPlayer(const QString& nick);
00071 
00078     void removePlayer(const QString& nick);
00079 
00084     void removePlayer(int id);
00085 
00086 
00092     bool autoAddMessages() const;
00093 
00102     void setAutoAddMessages(bool add);
00103 
00107     const QString& player(int id) const;
00108 
00113     int fromId() const;
00114     
00115 
00116 signals:
00126     void signalSendMessage(int id, const QString& msg);
00127     
00128 protected:
00133     virtual void returnPressed(const QString&);
00134 
00138     int uniqueId();
00139 
00140 private:
00141     void init();
00142 
00143     KChatPrivate* d;
00144 };
00145 
00146 #endif
KDE Logo
This file is part of the documentation for libkdegames Library Version 3.2.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Mar 12 22:53:38 2004 by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2003