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 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 35 of file kchat.h.
Constructor & Destructor Documentation
|
Definition at line 39 of file kchat.cpp. References KChat(). Referenced by KChat(). |
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(), and setFromNickname(). Referenced by setFromNickname(). |
|
Adds a player nickname.
Definition at line 92 of file kchat.cpp. References addPlayer(), and uniqueId(). Referenced by addPlayer(), and 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)
Definition at line 104 of file kchat.cpp. References removePlayer(). Referenced by removePlayer(). |
|
Removes the player with this id, as returned by addPlayer.
Definition at line 99 of file kchat.cpp. References removePlayer(). |
|
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 63 of file kchat.cpp. References setAutoAddMessages(). Referenced by setAutoAddMessages(). |
|
Definition at line 71 of file kchat.cpp. References player(). Referenced by fromName(), player(), 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 autoAddMessages(), fromId(), player(), returnPressed(), and signalSendMessage(). Referenced by returnPressed(). |
|
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: