#include <kchat.h>
Inheritance diagram for KChat:


Signals | |
| void | signalSendMessage (int id, const QString &msg) |
| This signal is emitted when the player wants to send a message. | |
Public Member Functions | |
| KChat (QWidget *parent, bool twoPlayerGame=false) | |
| virtual | ~KChat () |
| virtual const QString & | fromName () const |
| Equivalent to player(fromId()). | |
| void | setFromNickname (const QString &name) |
| This sets the name that will be shown on all chat widgets if this widget sends a message. | |
| int | addPlayer (const QString &nick) |
| Adds a player nickname. | |
| void | removePlayer (const QString &nick) |
| Removes all players with this nickname. | |
| void | removePlayer (int id) |
| Removes the player with this id, as returned by addPlayer. | |
| bool | autoAddMessages () const |
| void | setAutoAddMessages (bool add) |
| Usually the messages which will be sent from here (see signalSendMessage) are added autmatically to this widget. | |
| const QString & | player (int id) const |
| int | fromId () const |
Protected Member Functions | |
| virtual void | returnPressed (const QString &) |
| This emits signalSendMessage and, if autoAddMessages is true, calls KChatBase::addMessage. | |
| int | uniqueId () |
| The Id of the next player. | |
Docu is TODO
Definition at line 36 of file kchat.h.
|
||||||||||||
|
|
|
|
|
|
|
Adds a player nickname.
Definition at line 92 of file kchat.cpp. References KChatPrivate::mPlayerMap, and uniqueId(). Referenced by setFromNickname(). Here is the call graph for this function: ![]() |
|
|
Definition at line 65 of file kchat.cpp. References KChatPrivate::mAutoAddMessages. Referenced by returnPressed(). |
|
|
Definition at line 69 of file kchat.cpp. References KChatPrivate::mFromId. Referenced by fromName(), and returnPressed(). |
|
|
Equivalent to player(fromId()).
Implements KChatBase. Definition at line 61 of file kchat.cpp. References fromId(), and player(). Here is the call graph for this function: ![]() |
|
|
Definition at line 71 of file kchat.cpp. References KChatPrivate::mPlayerMap. Referenced by fromName(), and returnPressed(). |
|
|
Removes the player with this id, as returned by addPlayer.
Definition at line 99 of file kchat.cpp. References KChatPrivate::mPlayerMap. |
|
|
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 KChatPrivate::mPlayerMap. |
|
|
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(), player(), and signalSendMessage(). Here is the call graph for this function: ![]() |
|
|
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 KChatPrivate::mAutoAddMessages. |
|
|
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 KChatPrivate::mFromId. Here is the call graph for this function: ![]() |
|
||||||||||||
|
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(). |
|
|
The Id of the next player. Incremented after every call. Definition at line 67 of file kchat.cpp. References KChatPrivate::mPlayerId. Referenced by addPlayer(). |
1.4.6