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(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         // Adjust buttons and input field for width
00061         void            layout();
00062 
00063         void            refresh();
00064         void            refreshGestures();
00065 
00066         // Move cursor into chat input field.
00067         void            setKeyboardFocus(BOOL b);
00068 
00069         // Ignore arrow keys for chat bar
00070         void            setIgnoreArrowKeys(BOOL b);
00071 
00072         BOOL            inputEditorHasFocus();
00073         LLString        getCurrentChat();
00074 
00075         // since chat bar logic is reused for chat history
00076         // gesture combo box might not be a direct child
00077         void            setGestureCombo(LLComboBox* combo);
00078 
00079         // Send a chat (after stripping /20foo channel chats).
00080         // "Animate" means the nodding animation for regular text.
00081         void            sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL animate);
00082         void            sendChatFromViewer(const std::string &utf8text, EChatType type, BOOL animate);
00083 
00084         // If input of the form "/20foo" or "/20 foo", returns "foo" and channel 20.
00085         // Otherwise returns input and channel 0.
00086         LLWString stripChannelNumber(const LLWString &mesg, S32* channel);
00087 
00088         // callbacks
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         /*virtual*/ 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         // Which non-zero channel did we last chat on?
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

Generated on Thu Jul 1 06:08:21 2010 for Second Life Viewer by  doxygen 1.4.7