LLChatBar Class Reference

#include <llchatbar.h>

Inheritance diagram for LLChatBar:

Inheritance graph
[legend]
Collaboration diagram for LLChatBar:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LLChatBar (const std::string &name)
 LLChatBar (const std::string &name, const LLRect &rect)
 ~LLChatBar ()
virtual BOOL postBuild ()
virtual void reshape (S32 width, S32 height, BOOL called_from_parent)
virtual BOOL handleKeyHere (KEY key, MASK mask, BOOL called_from_parent)
void layout ()
void refresh ()
void refreshGestures ()
void setKeyboardFocus (BOOL b)
void setIgnoreArrowKeys (BOOL b)
BOOL inputEditorHasFocus ()
LLString getCurrentChat ()
void setGestureCombo (LLComboBox *combo)
void sendChatFromViewer (const LLWString &wtext, EChatType type, BOOL animate)
void sendChatFromViewer (const std::string &utf8text, EChatType type, BOOL animate)
LLWString stripChannelNumber (const LLWString &mesg, S32 *channel)
void setVisible (BOOL visible)

Static Public Member Functions

static void onClickSay (void *userdata)
static void onClickShout (void *userdata)
static void onTabClick (void *userdata)
static void onInputEditorKeystroke (LLLineEditor *caller, void *userdata)
static void onInputEditorFocusLost (LLUICtrl *caller, void *userdata)
static void onInputEditorGainFocus (LLUICtrl *caller, void *userdata)
static void onCommitGesture (LLUICtrl *ctrl, void *data)
static void startChat (void *)
static void stopChat ()

Protected Member Functions

void sendChat (EChatType type)
void updateChat ()

Protected Attributes

LLLineEditor * mInputEditor
LLFrameTimer mGestureLabelTimer
S32 mLastSpecialChatChannel
BOOL mIsBuilt
BOOL mDynamicLayout
LLComboBox * mGestureCombo
LLChatBarGestureObserver * mObserver

Detailed Description

Definition at line 47 of file llchatbar.h.


Constructor & Destructor Documentation

LLChatBar::LLChatBar ( const std::string &  name  ) 

Definition at line 99 of file llchatbar.cpp.

LLChatBar::LLChatBar ( const std::string &  name,
const LLRect &  rect 
)

Definition at line 111 of file llchatbar.cpp.

References LLUICtrlFactory::buildPanel(), LLPanel::childDisplayNotFound(), LLControlGroup::getBOOL(), gSavedSettings, gUICtrlFactory, layout(), LLView::mIsFocusRoot, LLPanel::setBackgroundOpaque(), LLPanel::setBackgroundVisible(), LLUICtrl::setIsChrome(), LLView::setRect(), setVisible(), and TRUE.

LLChatBar::~LLChatBar (  ) 

Definition at line 145 of file llchatbar.cpp.

References mObserver, and NULL.


Member Function Documentation

LLString LLChatBar::getCurrentChat (  ) 

Definition at line 421 of file llchatbar.cpp.

References LLLineEditor::getText(), mInputEditor, and LLStringBase< char >::null.

Referenced by LLViewerWindow::handleKey().

BOOL LLChatBar::handleKeyHere ( KEY  key,
MASK  mask,
BOOL  called_from_parent 
) [virtual]

Reimplemented from LLPanel.

Definition at line 203 of file llchatbar.cpp.

References CHAT_TYPE_NORMAL, CHAT_TYPE_SHOUT, FALSE, gChatBar, LLView::getEnabled(), LLView::getVisible(), KEY_ESCAPE, KEY_RETURN, MASK_CONTROL, MASK_NONE, sendChat(), stopChat(), and TRUE.

BOOL LLChatBar::inputEditorHasFocus (  ) 

Definition at line 416 of file llchatbar.cpp.

References LLUICtrl::hasFocus(), and mInputEditor.

Referenced by LLViewerWindow::handleKey(), and start_chat().

void LLChatBar::layout (  ) 

Definition at line 244 of file llchatbar.cpp.

References BTN_HEIGHT, LLPanel::childGetRect(), LLPanel::childSetRect(), count, LLRectBase< Type >::getWidth(), llfloor(), llround(), lltrunc(), mDynamicLayout, mInputEditor, LLView::mRect, r, LLLineEditor::reshape(), S32, LLLineEditor::setRect(), TRUE, x, and y.

Referenced by LLChatBar(), and reshape().

void LLChatBar::onClickSay ( void *  userdata  )  [static]

Definition at line 714 of file llchatbar.cpp.

References CHAT_TYPE_NORMAL.

Referenced by postBuild().

void LLChatBar::onClickShout ( void *  userdata  )  [static]

Definition at line 721 of file llchatbar.cpp.

References CHAT_TYPE_SHOUT.

Referenced by postBuild().

void LLChatBar::onCommitGesture ( LLUICtrl *  ctrl,
void *  data 
) [static]

Definition at line 751 of file llchatbar.cpp.

References LLSD::asString(), CHAT_TYPE_NORMAL, FALSE, LLCtrlSelectionInterface::getFirstSelectedIndex(), LLCtrlSelectionInterface::getSimpleSelectedValue(), gGestureManager, NULL, S32, LLGestureManager::triggerAndReviseString(), and utf8str_trim().

Referenced by setGestureCombo().

void LLChatBar::onInputEditorFocusLost ( LLUICtrl *  caller,
void *  userdata 
) [static]

Definition at line 701 of file llchatbar.cpp.

References gAgent, and LLAgent::stopTyping().

Referenced by postBuild().

void LLChatBar::onInputEditorGainFocus ( LLUICtrl *  caller,
void *  userdata 
) [static]

Definition at line 708 of file llchatbar.cpp.

References LLFloaterChat::setHistoryCursorAndScrollToEnd().

Referenced by postBuild().

void LLChatBar::onInputEditorKeystroke ( LLLineEditor *  caller,
void *  userdata 
) [static]

Definition at line 597 of file llchatbar.cpp.

References _PREHASH_AgentData, _PREHASH_AgentID, _PREHASH_ChatData, _PREHASH_ChatFromViewer, _PREHASH_Message, _PREHASH_SessionID, _PREHASH_Type, CHAT_TYPE_WHISPER, LLKeyboard::currentKey(), gAgent, LLAgent::getID(), LLControlGroup::getS32(), LLAgent::getSessionID(), gGestureManager, gKeyboard, gMessageSystem, gSavedPerAccountSettings, KEY_BACKSPACE, KEY_DELETE, KEY_RETURN, KEY_SPECIAL, LLGestureManager::matchPrefix(), LLMessageSystem::newMessageFast(), S32, LLAgent::sendReliableMessage(), LLAgent::startTyping(), LLAgent::stopTyping(), LLStringBase< T >::trimHead(), and wstring_to_utf8str().

Referenced by postBuild().

static void LLChatBar::onTabClick ( void *  userdata  )  [static]

BOOL LLChatBar::postBuild (  )  [virtual]

Reimplemented from LLPanel.

Definition at line 152 of file llchatbar.cpp.

References LLPanel::childSetAction(), FALSE, LLPanel::getChildByName(), LLUICtrlFactory::getComboBoxByName(), LLUICtrlFactory::getLineEditorByName(), mInputEditor, mIsBuilt, onClickSay(), onClickShout(), onInputEditorFocusLost(), onInputEditorGainFocus(), onInputEditorKeystroke(), LLUICtrl::setCallbackUserData(), LLLineEditor::setCommitOnFocusLost(), LLPanel::setDefaultBtn(), LLLineEditor::setEnableLineHistory(), LLUICtrl::setFocusLostCallback(), LLUICtrl::setFocusReceivedCallback(), setGestureCombo(), LLLineEditor::setIgnoreTab(), LLLineEditor::setKeystrokeCallback(), LLLineEditor::setMaxTextLength(), LLLineEditor::setPassDelete(), LLLineEditor::setRevertOnEsc(), toggleChatHistory(), and TRUE.

void LLChatBar::refresh (  )  [virtual]

Reimplemented from LLPanel.

Definition at line 293 of file llchatbar.cpp.

References AGENT_STATE_TYPING, AGENT_TYPING_TIMEOUT, LLPanel::childSetEnabled(), LLPanel::childSetValue(), gAgent, LLControlGroup::getBOOL(), LLFrameTimer::getElapsedTimeF32(), LLComboBox::getListInterface(), LLAgent::getRenderState(), LLFrameTimer::getStarted(), LLLineEditor::getText(), LLAgent::getTypingTime(), gSavedSettings, LLUIInstanceMgr< LLFloaterChat, LLFloaterChat >::instanceVisible(), mDynamicLayout, mGestureCombo, mGestureLabelTimer, mInputEditor, NULL, LLView::setVisible(), LLFrameTimer::stop(), and LLAgent::stopTyping().

Referenced by LLFloaterChat::draw(), and LLViewerWindow::handlePerFrameHover().

void LLChatBar::refreshGestures (  ) 

Definition at line 336 of file llchatbar.cpp.

References ADD_TOP, LLCtrlListInterface::addSimpleElement(), LLSD::asString(), LLCtrlListInterface::clearRows(), LLComboBox::getListInterface(), LLComboBox::getValue(), gGestureManager, LLGestureManager::mActive, mGestureCombo, NULL, LLCtrlSelectionInterface::selectByValue(), LLCtrlSelectionInterface::selectFirstItem(), LLCtrlListInterface::sortByColumn(), and TRUE.

Referenced by LLChatBarGestureObserver::changed(), and setGestureCombo().

void LLChatBar::reshape ( S32  width,
S32  height,
BOOL  called_from_parent 
) [virtual]

Reimplemented from LLView.

Definition at line 193 of file llchatbar.cpp.

References layout(), mIsBuilt, and LLView::reshape().

void LLChatBar::sendChat ( EChatType  type  )  [protected]

Definition at line 499 of file llchatbar.cpp.

References LLPanel::childSetValue(), gAgent, gChatBar, LLControlGroup::getBOOL(), LLLineEditor::getWText(), gGestureManager, gSavedSettings, mInputEditor, LLStringBase< char >::null, S32, sendChatFromViewer(), stopChat(), LLAgent::stopTyping(), stripChannelNumber(), LLGestureManager::triggerAndReviseString(), LLStringBase< T >::trim(), TRUE, utf8str_trim(), and wstring_to_utf8str().

Referenced by handleKeyHere().

void LLChatBar::sendChatFromViewer ( const std::string &  utf8text,
EChatType  type,
BOOL  animate 
)

Definition at line 727 of file llchatbar.cpp.

References sendChatFromViewer(), and utf8str_to_wstring().

void LLChatBar::sendChatFromViewer ( const LLWString &  wtext,
EChatType  type,
BOOL  animate 
)

Definition at line 732 of file llchatbar.cpp.

References gAgent, MAX_STRING, S32, LLAgent::sendChat(), stripChannelNumber(), utf8str_trim(), utf8str_truncate(), and wstring_to_utf8str().

Referenced by LLViewerGesture::doTrigger(), LLGestureManager::runStep(), sendChat(), and sendChatFromViewer().

void LLChatBar::setGestureCombo ( LLComboBox *  combo  ) 

Definition at line 426 of file llchatbar.cpp.

References LLGestureManager::addObserver(), gGestureManager, mGestureCombo, mObserver, onCommitGesture(), refreshGestures(), LLUICtrl::setCallbackUserData(), and LLUICtrl::setCommitCallback().

Referenced by LLFloaterChat::postBuild(), and postBuild().

void LLChatBar::setIgnoreArrowKeys ( BOOL  b  ) 

Definition at line 408 of file llchatbar.cpp.

References mInputEditor, and LLLineEditor::setIgnoreArrowKeys().

void LLChatBar::setKeyboardFocus ( BOOL  b  ) 

Definition at line 386 of file llchatbar.cpp.

References LLFocusMgr::childHasKeyboardFocus(), FALSE, gFocusMgr, mInputEditor, LLPanel::setFocus(), and TRUE.

Referenced by startChat(), and stopChat().

void LLChatBar::setVisible ( BOOL  visible  )  [virtual]

Reimplemented from LLView.

Definition at line 590 of file llchatbar.cpp.

References gSavedSettings, LLControlGroup::setBOOL(), and LLView::setVisible().

Referenced by LLChatBar(), startChat(), and stopChat().

void LLChatBar::startChat ( void *   )  [static]

Definition at line 552 of file llchatbar.cpp.

References gChatBar, gSavedSettings, mInputEditor, LLControlGroup::setBOOL(), LLLineEditor::setCursorToEnd(), setKeyboardFocus(), LLLineEditor::setText(), setVisible(), and TRUE.

Referenced by handle_chat(), handle_slash_key(), LLViewerWindow::handlePerFrameHover(), and start_chat().

void LLChatBar::stopChat (  )  [static]

Definition at line 572 of file llchatbar.cpp.

References FALSE, gAgent, gChatBar, gKeyboard, LLKeyboard::resetKeys(), LLKeyboard::resetMaskKeys(), setKeyboardFocus(), setVisible(), and LLAgent::stopTyping().

Referenced by handle_chat(), handleKeyHere(), and sendChat().

LLWString LLChatBar::stripChannelNumber ( const LLWString &  mesg,
S32 *  channel 
)

Definition at line 449 of file llchatbar.cpp.

References c, LLStringOps::isDigit(), mLastSpecialChatChannel, NULL, S32, and wstring_to_utf8str().

Referenced by sendChat(), and sendChatFromViewer().

void LLChatBar::updateChat (  )  [protected]


Member Data Documentation

BOOL LLChatBar::mDynamicLayout [protected]

Definition at line 116 of file llchatbar.h.

Referenced by layout(), and refresh().

LLComboBox* LLChatBar::mGestureCombo [protected]

Definition at line 117 of file llchatbar.h.

Referenced by refresh(), refreshGestures(), and setGestureCombo().

LLFrameTimer LLChatBar::mGestureLabelTimer [protected]

Definition at line 110 of file llchatbar.h.

Referenced by refresh().

LLLineEditor* LLChatBar::mInputEditor [protected]

Definition at line 108 of file llchatbar.h.

Referenced by getCurrentChat(), inputEditorHasFocus(), layout(), postBuild(), refresh(), sendChat(), setIgnoreArrowKeys(), setKeyboardFocus(), and startChat().

BOOL LLChatBar::mIsBuilt [protected]

Definition at line 115 of file llchatbar.h.

Referenced by postBuild(), and reshape().

S32 LLChatBar::mLastSpecialChatChannel [protected]

Definition at line 113 of file llchatbar.h.

Referenced by stripChannelNumber().

LLChatBarGestureObserver* LLChatBar::mObserver [protected]

Definition at line 119 of file llchatbar.h.

Referenced by setGestureCombo(), and ~LLChatBar().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:12 2010 for Second Life Viewer by  doxygen 1.4.7