19 #ifndef __KCHATBASE_H__
20 #define __KCHATBASE_H__
24 #include <tqlistbox.h>
26 #include <tdeglobalsettings.h>
27 #include <tdemacros.h>
33 class 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;
151 class KChatBasePrivate;
195 KChatBase(TQWidget* parent,
bool noComboBox =
false);
213 virtual const TQString& fromName()
const = 0;
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);
455 void rightButtonClicked(TQListBoxItem*,
const TQPoint&);
469 virtual void returnPressed(
const TQString& text) = 0;
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);
virtual ~KChatBaseText()
Destruct a KChatBaseText object.
A TQListBoxText implementation for KChatBase.
void setMessageFont(const TQFont *font)
Set the font for the message text.
void setNameFont(const TQFont *font)
Set the font for the name.
The base class for chat widgets.
void setName(const TQString &name)
Set the name part of a message.
const TQString & message() const
KChatBaseText(const TQString &player, const TQString &text)
Constructs a KChatBaseText object with the player and text part.
void setMessage(const TQString &message)
Set the text part of a message.
TQFont messageFont() const
You can set the font of the message independently of the sender name.
const TQString & name() const
TQFont nameFont() const
You can set the font of the sender name independently of the message itself.