llchatbar.h

Go to the documentation of this file.
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         // constructor for inline chat-bars (e.g. hosted in chat history window)
00052         LLChatBar();
00053         ~LLChatBar();
00054         virtual BOOL postBuild();
00055 
00056         virtual BOOL handleKeyHere(KEY key, MASK mask);
00057 
00058         void            refresh();
00059         void            refreshGestures();
00060 
00061         // Move cursor into chat input field.
00062         void            setKeyboardFocus(BOOL b);
00063 
00064         // Ignore arrow keys for chat bar
00065         void            setIgnoreArrowKeys(BOOL b);
00066 
00067         BOOL            inputEditorHasFocus();
00068         LLString        getCurrentChat();
00069 
00070         // since chat bar logic is reused for chat history
00071         // gesture combo box might not be a direct child
00072         void            setGestureCombo(LLComboBox* combo);
00073 
00074         // Send a chat (after stripping /20foo channel chats).
00075         // "Animate" means the nodding animation for regular text.
00076         void            sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate);
00077         void            sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate);
00078 
00079         // If input of the form "/20foo" or "/20 foo", returns "foo" and channel 20.
00080         // Otherwise returns input and channel 0.
00081         LLWString stripChannelNumber(const LLWString &mesg, S32* channel);
00082 
00083         // callbacks
00084         static void     onClickSay( LLUICtrl*, void* userdata );
00085 
00086         static void     onTabClick( void* userdata );
00087         static void     onInputEditorKeystroke(LLLineEditor* caller, void* userdata);
00088         static void     onInputEditorFocusLost(LLFocusableElement* caller,void* userdata);
00089         static void     onInputEditorGainFocus(LLFocusableElement* caller,void* userdata);
00090 
00091         static void onCommitGesture(LLUICtrl* ctrl, void* data);
00092 
00093         static void startChat(const char* line);
00094         static void stopChat();
00095 
00096 protected:
00097         void sendChat(EChatType type);
00098         void updateChat();
00099 
00100 protected:
00101         LLLineEditor*   mInputEditor;
00102 
00103         LLFrameTimer    mGestureLabelTimer;
00104 
00105         // Which non-zero channel did we last chat on?
00106         S32                             mLastSpecialChatChannel;
00107 
00108         BOOL                    mIsBuilt;
00109         LLComboBox*             mGestureCombo;
00110 
00111         LLChatBarGestureObserver* mObserver;
00112 };
00113 
00114 extern LLChatBar *gChatBar;
00115 
00116 #endif

Generated on Fri May 16 08:33:16 2008 for SecondLife by  doxygen 1.5.5