00001
00032 #ifndef LL_LLCHATBAR_H
00033 #define LL_LLCHATBAR_H
00034
00035 #include "llpanel.h"
00036 #include "llframetimer.h"
00037 #include "llchat.h"
00038
00039 class LLLineEditor;
00040 class LLMessageSystem;
00041 class LLUICtrl;
00042 class LLUUID;
00043 class LLFrameTimer;
00044 class LLChatBarGestureObserver;
00045 class LLComboBox;
00046
00047 class LLChatBar
00048 : public LLPanel
00049 {
00050 public:
00051
00052 LLChatBar(const std::string& name);
00053 LLChatBar(const std::string& name, const LLRect& rect);
00054 ~LLChatBar();
00055 virtual BOOL postBuild();
00056
00057 virtual void reshape(S32 width, S32 height, BOOL called_from_parent);
00058 virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent);
00059
00060
00061 void layout();
00062
00063 void refresh();
00064 void refreshGestures();
00065
00066
00067 void setKeyboardFocus(BOOL b);
00068
00069
00070 void setIgnoreArrowKeys(BOOL b);
00071
00072 BOOL inputEditorHasFocus();
00073 LLString getCurrentChat();
00074
00075
00076
00077 void setGestureCombo(LLComboBox* combo);
00078
00079
00080
00081 void sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate);
00082 void sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate);
00083
00084
00085
00086 LLWString stripChannelNumber(const LLWString &mesg, S32* channel);
00087
00088
00089 static void onClickSay( void* userdata );
00090 static void onClickShout( void* userdata );
00091
00092 static void onTabClick( void* userdata );
00093 static void onInputEditorKeystroke(LLLineEditor* caller, void* userdata);
00094 static void onInputEditorFocusLost(LLUICtrl* caller,void* userdata);
00095 static void onInputEditorGainFocus(LLUICtrl* caller,void* userdata);
00096
00097 static void onCommitGesture(LLUICtrl* ctrl, void* data);
00098
00099 static void startChat(void*);
00100 static void stopChat();
00101
00102 void setVisible(BOOL visible);
00103 protected:
00104 void sendChat(EChatType type);
00105 void updateChat();
00106
00107 protected:
00108 LLLineEditor* mInputEditor;
00109
00110 LLFrameTimer mGestureLabelTimer;
00111
00112
00113 S32 mLastSpecialChatChannel;
00114
00115 BOOL mIsBuilt;
00116 BOOL mDynamicLayout;
00117 LLComboBox* mGestureCombo;
00118
00119 LLChatBarGestureObserver* mObserver;
00120 };
00121
00122 extern LLChatBar *gChatBar;
00123
00124 #endif