19#ifndef __KCHATBASE_H__
20#define __KCHATBASE_H__
26#include <tdeglobalsettings.h>
33class KChatBaseTextPrivate;
90 const TQString&
name()
const;
96 const TQString&
message()
const;
132 virtual int width(TQListBox* )
const;
136 virtual int height(TQListBox* )
const;
141 virtual void paint(TQPainter*);
147 KChatBaseTextPrivate* d;
151class KChatBasePrivate;
195 KChatBase(TQWidget* parent,
bool noComboBox =
false);
226 bool addSendingEntry(
const TQString& text,
int id);
239 bool insertSendingEntry(
const TQString& text,
int id,
int index = -1);
246 void changeSendingEntry(
const TQString& text,
int id);
252 void setSendingEntry(
int id);
260 void removeSendingEntry(
int id);
269 int sendingEntry()
const;
274 int findIndex(
int id)
const;
288 virtual bool acceptMessage()
const;
293 void setCompletionMode(TDEGlobalSettings::Completion mode);
299 void setNameFont(
const TQFont& font);
305 void setMessageFont(
const TQFont& font);
313 void setBothFont(
const TQFont& font);
319 void setSystemNameFont(
const TQFont& font);
325 void setSystemMessageFont(
const TQFont& font);
331 void setSystemBothFont(
const TQFont& font);
340 const TQFont& nameFont()
const;
349 const TQFont& messageFont()
const;
355 const TQFont& systemNameFont()
const;
361 const TQFont& systemMessageFont()
const;
372 virtual void saveConfig(TDEConfig* conf = 0);
379 virtual void readConfig(TDEConfig* conf = 0);
388 void setMaxItems(
int maxItems);
399 int maxItems()
const;
414 virtual void addMessage(
const TQString& fromName,
const TQString& text);
423 virtual void addSystemMessage(
const TQString& fromName,
const TQString& text);
435 virtual void addItem(
const TQListBoxItem* item);
448 void setAcceptMessage(
bool a);
478 virtual TQString comboBoxItem(
const TQString& name)
const;
486 virtual TQListBoxItem* layoutMessage(
const TQString& fromName,
const TQString& text);
495 virtual TQListBoxItem* layoutSystemMessage(
const TQString& fromName,
const TQString& text);
503 void slotReturnPressed(
const TQString&);
506 void init(
bool noComboBox);
A TQListBoxText implementation for KChatBase.
KChatBaseText(const TQString &player, const TQString &text)
Constructs a KChatBaseText object with the player and text part.
virtual ~KChatBaseText()
Destruct a KChatBaseText object.
const TQString & message() const
void setMessage(const TQString &message)
Set the text part of a message.
const TQString & name() const
TQFont nameFont() const
You can set the font of the sender name independently of the message itself.
TQFont messageFont() const
You can set the font of the message independently of the sender name.
void setMessageFont(const TQFont *font)
Set the font for the message text.
void setName(const TQString &name)
Set the name part of a message.
void setNameFont(const TQFont *font)
Set the font for the name.
The base class for chat widgets.
virtual const TQString & fromName() const =0
void rightButtonClicked(TQListBoxItem *, const TQPoint &)
Emitted when the user right-clicks on a list item.
virtual void returnPressed(const TQString &text)=0
This is called whenever the user pushed return ie wants to send a message.