• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libtdegames
 

libtdegames

  • libtdegames
kchat.h
1/*
2 This file is part of the TDE games library
3 Copyright (C) 2001 Andreas Beckermann (b_mann@gmx.de)
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
18*/
19#ifndef __KCHAT_H__
20#define __KCHAT_H__
21
22#include <tqstring.h>
23
24#include "kchatbase.h"
25#include <tdemacros.h>
26
27class KChatPrivate;
28
36class TDE_EXPORT KChat : public KChatBase
37{
38 TQ_OBJECT
39
40public:
47 KChat(TQWidget* parent, bool twoPlayerGame = false);
48
49 virtual ~KChat();
50
56 virtual const TQString& fromName() const;
57
63 void setFromNickname(const TQString& name);
64
65// TODO:
66// void setPlayerList(TQIntDict<TQString>);// use this for non-KGame use
67
72 int addPlayer(const TQString& nick);
73
80 void removePlayer(const TQString& nick);
81
86 void removePlayer(int id);
87
88
94 bool autoAddMessages() const;
95
104 void setAutoAddMessages(bool add);
105
109 const TQString& player(int id) const;
110
115 int fromId() const;
116
117
118signals:
128 void signalSendMessage(int id, const TQString& msg);
129
130protected:
135 virtual void returnPressed(const TQString&);
136
140 int uniqueId();
141
142private:
143 void init();
144
145 KChatPrivate* d;
146};
147
148#endif
KChatBase::fromName
virtual const TQString & fromName() const =0
KChatBase::returnPressed
virtual void returnPressed(const TQString &text)=0
This is called whenever the user pushed return ie wants to send a message.
KChatBase::KChatBase
KChatBase(TQWidget *parent, bool noComboBox=false)
Definition kchatbase.cpp:185
KChat::uniqueId
int uniqueId()
The Id of the next player.
Definition kchat.cpp:67
KChat::autoAddMessages
bool autoAddMessages() const
Definition kchat.cpp:65
KChat::setAutoAddMessages
void setAutoAddMessages(bool add)
Usually the messages which will be sent from here (see signalSendMessage) are added autmatically to t...
Definition kchat.cpp:63
KChat::removePlayer
void removePlayer(const TQString &nick)
Removes all players with this nickname.
Definition kchat.cpp:104
KChat::KChat
KChat(TQWidget *parent, bool twoPlayerGame=false)
Definition kchat.cpp:39
KChat::signalSendMessage
void signalSendMessage(int id, const TQString &msg)
This signal is emitted when the player wants to send a message.
KChat::setFromNickname
void setFromNickname(const TQString &name)
This sets the name that will be shown on all chat widgets if this widget sends a message.
Definition kchat.cpp:59
KChat::player
const TQString & player(int id) const
Definition kchat.cpp:71
KChat::addPlayer
int addPlayer(const TQString &nick)
Adds a player nickname.
Definition kchat.cpp:92
KChat::fromId
int fromId() const
Definition kchat.cpp:69

libtdegames

Skip menu "libtdegames"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libtdegames

Skip menu "libtdegames"
  • libtdegames
Generated for libtdegames by doxygen 1.15.0
This website is maintained by Timothy Pearson.