kchat.h

Go to the documentation of this file.
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 "kchatbase.h"
00023 #include <libkdegames_export.h>
00024 
00025 class KChatPrivate;
00026 
00034 class KDEGAMES_EXPORT KChat : public KChatBase
00035 {
00036         Q_OBJECT
00037 public:
00044         explicit KChat(QWidget* parent, bool twoPlayerGame = false);
00045 
00046         virtual ~KChat();
00047 
00053         virtual QString fromName() const;
00054 
00060         void setFromNickname(const QString& name);
00061 
00062 //      TODO:
00063 //      void setPlayerList(QIntDict<QString>);// use this for non-KGame use
00064 
00069         int addPlayer(const QString& nick);
00070 
00077         void removePlayer(const QString& nick);
00078 
00083         void removePlayer(int id);
00084 
00085 
00091         bool autoAddMessages() const;
00092 
00101         void setAutoAddMessages(bool add);
00102 
00106         QString player(int id) const;
00107 
00112         int fromId() const;
00113         
00114 
00115 Q_SIGNALS:
00125         void signalSendMessage(int id, const QString& msg);
00126         
00127 protected:
00132         virtual void returnPressed(const QString&);
00133 
00137         int uniqueId();
00138 
00139 private:
00140         void init();
00141 
00142         KChatPrivate* const d;
00143 };
00144 
00145 #endif

Generated on Sun Mar 16 08:02:52 2008 for Libkdegames by  doxygen 1.5.3