ChatWindow Class Reference
[User interface related classes (windows, dialogs)]

#include <chat.h>

Inheritance diagram for ChatWindow:

Window

List of all members.


Detailed Description

The chat window.

Definition at line 62 of file chat.h.


Public Member Functions

 ChatWindow ()
 Constructor.
 ~ChatWindow ()
 Destructor: used to write back values to the config file.
void widgetResized (const gcn::Event &event)
 Called when the widget changes size.
void logic ()
void resetToDefaultSize ()
 Reset the chat window and recorder window attached to it to their default positions.
ChatTabgetFocused () const
 Gets the focused tab.
void clearTab (ChatTab *tab)
 Clear the given tab.
void clearTab ()
 Clear the current tab.
void prevTab ()
 Switch to the previous tab in order.
void nextTab ()
 Switch to the next tab in order.
void action (const gcn::ActionEvent &event)
 Performs action.
bool requestChatFocus ()
 Request focus for typing chat message.
bool isInputFocused ()
 Checks whether ChatWindow is Focused or not.
void chatInput (std::string &msg)
 Passes the text to the current tab as input.
void keyPressed (gcn::KeyEvent &event)
 Called when key is pressed.
void addInputText (std::string input_str)
 Add the given text to the chat input.
void addItemText (const std::string &item)
 Called to add item to chat.
void setVisible (bool visible)
 Override to reset mTmpVisible.
void scroll (int amount)
 Scrolls the chat window.
void setRecordingFile (const std::string &msg)
 Sets the file being recorded to.
bool getReturnTogglesChat () const
void setReturnTogglesChat (bool toggles)
void doPresent ()
void whisper (const std::string &nick, std::string mes, bool own=false)
ChatTabaddWhisperTab (const std::string &nick, bool switchTo=false)

Protected Member Functions

void removeTab (ChatTab *tab)
 Remove the given tab from the window.
void addTab (ChatTab *tab)
 Add the tab to the window.
void removeWhisper (std::string nick)
void adjustTabSize ()

Protected Attributes

ItemLinkHandlermItemLinkHandler
 Used for showing item popup on clicking links.
RecordermRecorder
ChatInputmChatInput
 Input box for typing chat messages.

Private Types

typedef std::map< const
std::string, ChatTab * > 
TabMap
typedef std::list< std::string > History
typedef History::iterator HistoryIterator

Private Attributes

bool mTmpVisible
TabbedAreamChatTabs
 Tabbed area for holding each channel.
TabmCurrentTab
TabMap mWhispers
 Manage whisper tabs.
History mHistory
 Command history.
HistoryIterator mCurHist
 History iterator.
bool mReturnToggles
 Marks whether <Return> toggles the chat log or not.

Friends

class ChatTab
class WhisperTab

Member Typedef Documentation

typedef std::map<const std::string, ChatTab*> ChatWindow::TabMap [private]

Definition at line 207 of file chat.h.

typedef std::list<std::string> ChatWindow::History [private]

Definition at line 211 of file chat.h.

typedef History::iterator ChatWindow::HistoryIterator [private]

Definition at line 212 of file chat.h.


Constructor & Destructor Documentation

ChatWindow::ChatWindow (  ) 

Constructor.

Definition at line 71 of file chat.cpp.

ChatWindow::~ChatWindow (  ) 

Destructor: used to write back values to the config file.

Definition at line 115 of file chat.cpp.


Member Function Documentation

void ChatWindow::widgetResized ( const gcn::Event &  event  ) 

Called when the widget changes size.

Used for adapting the size of the tabbed area.

Reimplemented from Window.

Definition at line 151 of file chat.cpp.

void ChatWindow::logic (  ) 

Definition at line 158 of file chat.cpp.

void ChatWindow::resetToDefaultSize (  )  [virtual]

Reset the chat window and recorder window attached to it to their default positions.

Reimplemented from Window.

Definition at line 123 of file chat.cpp.

ChatTab * ChatWindow::getFocused (  )  const

Gets the focused tab.

Definition at line 169 of file chat.cpp.

void ChatWindow::clearTab ( ChatTab tab  ) 

Clear the given tab.

Definition at line 174 of file chat.cpp.

void ChatWindow::clearTab (  ) 

Clear the current tab.

Definition at line 180 of file chat.cpp.

void ChatWindow::prevTab (  ) 

Switch to the previous tab in order.

Definition at line 185 of file chat.cpp.

void ChatWindow::nextTab (  ) 

Switch to the next tab in order.

Definition at line 196 of file chat.cpp.

void ChatWindow::action ( const gcn::ActionEvent &  event  ) 

Performs action.

Definition at line 207 of file chat.cpp.

bool ChatWindow::requestChatFocus (  ) 

Request focus for typing chat message.

Returns:
true if the input was shown false otherwise

Definition at line 243 of file chat.cpp.

bool ChatWindow::isInputFocused (  ) 

Checks whether ChatWindow is Focused or not.

Definition at line 268 of file chat.cpp.

void ChatWindow::chatInput ( std::string &  msg  ) 

Passes the text to the current tab as input.

Parameters:
msg The message text which is to be sent.

Definition at line 302 of file chat.cpp.

void ChatWindow::keyPressed ( gcn::KeyEvent &  event  ) 

Called when key is pressed.

Definition at line 360 of file chat.cpp.

void ChatWindow::addInputText ( std::string  input_str  ) 

Add the given text to the chat input.

Definition at line 388 of file chat.cpp.

void ChatWindow::addItemText ( const std::string &  item  ) 

Called to add item to chat.

Definition at line 394 of file chat.cpp.

void ChatWindow::setVisible ( bool  visible  ) 

Override to reset mTmpVisible.

Reimplemented from Window.

Definition at line 401 of file chat.cpp.

void ChatWindow::scroll ( int  amount  ) 

Scrolls the chat window.

Parameters:
amount direction and amount to scroll. Negative numbers scroll up, positive numbers scroll down. The absolute amount indicates the amount of 1/8ths of chat window real estate that should be scrolled.

Definition at line 351 of file chat.cpp.

void ChatWindow::setRecordingFile ( const std::string &  msg  ) 

Sets the file being recorded to.

Parameters:
msg The file to write out to. If null, then stop recording.

Definition at line 412 of file chat.cpp.

bool ChatWindow::getReturnTogglesChat (  )  const [inline]

Definition at line 169 of file chat.h.

void ChatWindow::setReturnTogglesChat ( bool  toggles  )  [inline]

Definition at line 170 of file chat.h.

void ChatWindow::doPresent (  ) 

Definition at line 308 of file chat.cpp.

void ChatWindow::whisper ( const std::string &  nick,
std::string  mes,
bool  own = false 
)

Definition at line 417 of file chat.cpp.

ChatTab * ChatWindow::addWhisperTab ( const std::string &  nick,
bool  switchTo = false 
)

Definition at line 459 of file chat.cpp.

void ChatWindow::removeTab ( ChatTab tab  )  [protected]

Remove the given tab from the window.

Definition at line 273 of file chat.cpp.

void ChatWindow::addTab ( ChatTab tab  )  [protected]

Add the tab to the window.

Definition at line 282 of file chat.cpp.

void ChatWindow::removeWhisper ( std::string  nick  )  [protected]

Definition at line 297 of file chat.cpp.

void ChatWindow::adjustTabSize (  )  [protected]

Definition at line 129 of file chat.cpp.


Friends And Related Function Documentation

friend class ChatTab [friend]

Definition at line 180 of file chat.h.

friend class WhisperTab [friend]

Definition at line 181 of file chat.h.


Member Data Documentation

Used for showing item popup on clicking links.

Definition at line 194 of file chat.h.

Definition at line 195 of file chat.h.

Input box for typing chat messages.

Definition at line 198 of file chat.h.

bool ChatWindow::mTmpVisible [private]

Definition at line 201 of file chat.h.

Tabbed area for holding each channel.

Definition at line 204 of file chat.h.

Definition at line 205 of file chat.h.

Manage whisper tabs.

Definition at line 209 of file chat.h.

Command history.

Definition at line 213 of file chat.h.

History iterator.

Definition at line 214 of file chat.h.

Marks whether <Return> toggles the chat log or not.

Definition at line 215 of file chat.h.


The documentation for this class was generated from the following files:

Generated on Sun Apr 26 17:30:43 2009 for The Mana World by  doxygen 1.5.5