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

Signals | |
void | signalSendMessage (int id, const TQString &msg) |
Public Member Functions | |
KChat (TQWidget *parent, bool twoPlayerGame=false) | |
virtual const TQString & | fromName () const |
void | setFromNickname (const TQString &name) |
int | addPlayer (const TQString &nick) |
void | removePlayer (const TQString &nick) |
void | removePlayer (int id) |
bool | autoAddMessages () const |
void | setAutoAddMessages (bool add) |
const TQString & | player (int id) const |
int | fromId () const |
Protected Member Functions | |
virtual void | returnPressed (const TQString &) |
int | uniqueId () |
Detailed Description
A chat widget for non-KGame games.Docu is TODO
Definition at line 36 of file kchat.h.
Constructor & Destructor Documentation
KChat::KChat | ( | TQWidget * | parent, | |
bool | twoPlayerGame = false | |||
) |
Member Function Documentation
const TQString & KChat::fromName | ( | ) | const [virtual] |
Equivalent to player(fromId()).
- Returns:
- The name that will be shown for messages from this widget. That is the string from setFromNickname
Implements KChatBase.
void KChat::setFromNickname | ( | const TQString & | name | ) |
int KChat::addPlayer | ( | const TQString & | nick | ) |
void KChat::removePlayer | ( | const TQString & | nick | ) |
void KChat::removePlayer | ( | int | id | ) |
bool KChat::autoAddMessages | ( | ) | const |
- Returns:
- true if the messages which will be sent from here will be added automatically using KChatBase::addMessage. See also setAutoAddMessages
void KChat::setAutoAddMessages | ( | bool | add | ) |
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
- Parameters:
-
add If true (default) messages sent from here will be added automatically. Otherwise you will have to add them yourself
const TQString & KChat::player | ( | int | id | ) | const |
int KChat::fromId | ( | ) | const |
void KChat::signalSendMessage | ( | int | id, | |
const TQString & | msg | |||
) | [signal] |
This signal is emitted when the player wants to send a message.
The message is added automatically using KChatBase::addMessage if autoAddMessages is enabled.
- Parameters:
-
id The id of the player who sends the message - see setFromNickname and player msg The message itself
void KChat::returnPressed | ( | const TQString & | text | ) | [protected, virtual] |
This emits signalSendMessage and, if autoAddMessages is true, calls KChatBase::addMessage.
Implements KChatBase.
int KChat::uniqueId | ( | ) | [protected] |
The documentation for this class was generated from the following files: