libkdegames
kchat.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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
00063
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