21 #ifndef __KGAMECHAT_H__ 22 #define __KGAMECHAT_H__ 26 #include "kchatbase.h" 27 #include <tdemacros.h> 32 class KGameChatPrivate;
82 void setFromPlayer(
KPlayer* player);
93 void setKGame(
KGame* g);
101 int messageId()
const;
112 void setMessageId(
int msgid);
118 virtual const TQString&
fromName()
const;
123 virtual void addMessage(
int fromId,
const TQString& text);
125 void slotReceiveMessage(
int,
const TQByteArray&, TQ_UINT32 receiver, TQ_UINT32 sender);
133 bool isSendToAllMessage(
int id)
const;
144 bool isToGroupMessage(
int id)
const;
159 bool isToPlayerMessage(
int id)
const;
170 int playerId(
int id)
const;
177 int sendingId(
int playerId)
const;
183 bool hasPlayer(
int id)
const;
191 virtual TQString sendToPlayerEntry(
const TQString& name)
const;
200 void slotUnsetKGame();
205 void slotRemovePlayer(
KPlayer*);
212 void slotReceivePrivateMessage(
int msgid,
const TQByteArray& buffer, TQ_UINT32 sender,
KPlayer* me);
218 void init(
KGame* g,
int msgid);
virtual void returnPressed(const TQString &text)=0
This is called whenever the user pushed return ie wants to send a message.
The base class for chat widgets.
virtual const TQString & fromName() const =0
virtual void addMessage(const TQString &fromName, const TQString &text)
Add a text in the listbox.
Base class for a game player.
Base class of KGameProperty.
The main KDE game object.
A Chat widget for KGame-based games.