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
00036 class KDEGAMES_EXPORT KChat : public KChatBase
00037 {
00038 Q_OBJECT
00039 public:
00046 explicit KChat(QWidget* parent, bool twoPlayerGame = false);
00047
00048 KChat(QWidget* parent, KChatBaseModel* model=0,
00049 KChatBaseItemDelegate* delegate=0,
00050 bool noComboBox = false);
00051
00052 virtual ~KChat();
00053
00059 virtual QString fromName() const;
00060
00066 void setFromNickname(const QString& name);
00067
00068
00069
00070
00075 int addPlayer(const QString& nick);
00076
00083 void removePlayer(const QString& nick);
00084
00089 void removePlayer(int id);
00090
00091
00097 bool autoAddMessages() const;
00098
00107 void setAutoAddMessages(bool add);
00108
00112 QString player(int id) const;
00113
00118 int fromId() const;
00119
00120
00121 Q_SIGNALS:
00131 void signalSendMessage(int id, const QString& msg);
00132
00133 protected:
00138 virtual void returnPressed(const QString&);
00139
00143 int uniqueId();
00144
00145 private:
00146 void init();
00147
00148 KChatPrivate* const d;
00149 };
00150
00151 #endif