KChat Class Reference
A chat widget for non-KGame games. More...
#include <kchat.h>
Inheritance diagram for KChat:


Signals | |
void | signalSendMessage (int id, const QString &msg) |
Public Member Functions | |
KChat (QWidget *parent, bool twoPlayerGame=false) | |
virtual | ~KChat () |
virtual const QString & | fromName () const |
void | setFromNickname (const QString &name) |
int | addPlayer (const QString &nick) |
void | removePlayer (const QString &nick) |
void | removePlayer (int id) |
bool | autoAddMessages () const |
void | setAutoAddMessages (bool add) |
const QString & | player (int id) const |
int | fromId () const |
Protected Member Functions | |
virtual void | returnPressed (const QString &) |
int | uniqueId () |
Detailed Description
A chat widget for non-KGame games.Docu is TODO
- Author:
- Andreas Beckermann <b_mann@gmx.de>
Definition at line 36 of file kchat.h.
Constructor & Destructor Documentation
|
|
Member Function Documentation
|
Equivalent to player(fromId()).
Implements KChatBase. |
|
This sets the name that will be shown on all chat widgets if this widget sends a message. See signalSendMessage
Definition at line 59 of file kchat.cpp. References addPlayer(). |
|
Adds a player nickname.
Definition at line 92 of file kchat.cpp. References uniqueId(). Referenced by setFromNickname(). |
|
Removes all players with this nickname. Better don't use this as it will remove *all* players with this nickname. Save the id instead and call removePlayer(id)
|
|
Removes the player with this id, as returned by addPlayer.
|
|
Definition at line 65 of file kchat.cpp. Referenced by returnPressed(). |
|
Usually the messages which will be sent from here (see signalSendMessage) are added autmatically to this widget. But under some circumstances that would be very unhandy. So you can deactivate this behaviour here and call KChatBase::addMessage yourself
|
|
Definition at line 71 of file kchat.cpp. Referenced by fromName(), and returnPressed(). |
|
Definition at line 69 of file kchat.cpp. Referenced by fromName(), and returnPressed(). |
|
This signal is emitted when the player wants to send a message. The message is added automatically using KChatBase::addMessage if autoAddMessages is enabled.
Referenced by returnPressed(). |
|
This emits signalSendMessage and, if autoAddMessages is true, calls KChatBase::addMessage.
Implements KChatBase. Definition at line 74 of file kchat.cpp. References KChatBase::addMessage(), autoAddMessages(), fromId(), QString::isNull(), player(), and signalSendMessage(). |
|
The Id of the next player. Incremented after every call. Definition at line 67 of file kchat.cpp. Referenced by addPlayer(). |
The documentation for this class was generated from the following files: