00001
00032
00033
00034
00035
00036
00037 #ifndef LL_LLFLOATERCHAT_H
00038 #define LL_LLFLOATERCHAT_H
00039
00040 #include <deque>
00041 #include <map>
00042 #include "llfloater.h"
00043
00044
00045 class LLButton;
00046 class LLChat;
00047 class LLComboBox;
00048 class LLLineEditor;
00049 class LLViewerTextEditor;
00050 class LLMessageSystem;
00051 class LLUUID;
00052 class LLCheckBoxCtrl;
00053 class LLPanelActiveSpeakers;
00054
00055 class LLNameLookupEntry
00056 {
00057 public:
00058 LLNameLookupEntry(const LLUUID &id = LLUUID::null, const LLString &object = "") : mID(id), mObject(object) {}
00059 bool operator==(const LLNameLookupEntry&rhs) { return mID == rhs.mID; }
00060
00061 LLUUID mID;
00062 LLString mObject;
00063 };
00064
00065 class LLOwnerCacheEntry
00066 {
00067 public:
00068 LLOwnerCacheEntry(const LLString &name = "", const LLUUID &owner = LLUUID::null) : mObjectName(name), mOwnerID(owner) {}
00069
00070 LLString mObjectName;
00071 LLUUID mOwnerID;
00072 };
00073
00074
00075 class LLFloaterChat
00076 : public LLFloater, public LLUISingleton<LLFloaterChat>
00077 {
00078 public:
00079 LLFloaterChat(const LLSD& seed);
00080 ~LLFloaterChat();
00081
00082 virtual void setVisible( BOOL b );
00083 virtual void draw();
00084 virtual BOOL postBuild();
00085 virtual void onClose(bool app_quitting);
00086 virtual void onVisibilityChange(BOOL cur_visibility);
00087
00088 static void setHistoryCursorAndScrollToEnd();
00089
00090
00091
00092 static void addChat(const LLChat& chat, BOOL local_agent = FALSE);
00093
00094
00095 static void addChatHistory(const LLChat& chat, bool log_to_file = true);
00096
00097 static void onClickMute(void *data);
00098 static void onClickToggleShowMute(LLUICtrl* caller, void *data);
00099 static void onClickToggleActiveSpeakers(void* userdata);
00100 static void chatFromLogFile(LLString line, void* userdata);
00101 static void loadHistory();
00102 static void* createSpeakersPanel(void* data);
00103 static void* createChatPanel(void* data);
00104 static void hideInstance(const LLSD& id);
00105
00106 LLString getChatAvatar(const LLChat& chat);
00107 LLString getAvatarName(const LLUUID &speakerID, const LLString &speakerName);
00108 static LLString getChatPosition(const LLChat &chat);
00109 static void cache_name_callback(const LLUUID &, const char *first, const char *last, BOOL is_group, void *data);
00110 static void requestObjectOwner(const LLUUID &object_id, const LLHost &host);
00111 static void processObjectPropertiesFamily(LLMessageSystem *msg, void **user_data);
00112
00113 protected:
00114 LLPanelActiveSpeakers* mPanel;
00115 std::deque<LLNameLookupEntry> mLookupQueue;
00116 std::map<LLUUID, LLOwnerCacheEntry> mObjectOwners;
00117 };
00118
00119 #endif