aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llimview.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llimview.h57
1 files changed, 34 insertions, 23 deletions
diff --git a/linden/indra/newview/llimview.h b/linden/indra/newview/llimview.h
index c0b0f79..ca3ef5f 100644
--- a/linden/indra/newview/llimview.h
+++ b/linden/indra/newview/llimview.h
@@ -1,5 +1,5 @@
1/** 1/**
2 * @file llimview.h 2 * @file LLIMMgr.h
3 * @brief Container for Instant Messaging 3 * @brief Container for Instant Messaging
4 * 4 *
5 * Copyright (c) 2001-2007, Linden Research, Inc. 5 * Copyright (c) 2001-2007, Linden Research, Inc.
@@ -33,31 +33,32 @@
33#include "llinstantmessage.h" 33#include "llinstantmessage.h"
34#include "lluuid.h" 34#include "lluuid.h"
35 35
36class LLFloaterNewIM; 36class LLFloaterChatterBox;
37class LLUUID; 37class LLUUID;
38class LLFloaterIMPanel; 38class LLFloaterIMPanel;
39class LLFriendObserver; 39class LLFriendObserver;
40class LLFloaterIM; 40class LLFloaterIM;
41 41
42class LLIMView : public LLView 42class LLIMMgr : public LLSingleton<LLIMMgr>
43{ 43{
44public: 44public:
45 LLIMView(const std::string& name, const LLRect& rect); 45 LLIMMgr();
46 ~LLIMView(); 46 virtual ~LLIMMgr();
47
48 virtual EWidgetType getWidgetType() const;
49 virtual LLString getWidgetTag() const;
50 47
51 // Add a message to a session. The session can keyed to sesion id 48 // Add a message to a session. The session can keyed to sesion id
52 // or agent id. 49 // or agent id.
53 void addMessage(const LLUUID& session_id, const LLUUID& target_id, 50 void addMessage(const LLUUID& session_id,
54 const char* from, const char* msg, 51 const LLUUID& target_id,
52 const char* from,
53 const char* msg,
55 const char* session_name = NULL, 54 const char* session_name = NULL,
56 EInstantMessage dialog = IM_NOTHING_SPECIAL, 55 EInstantMessage dialog = IM_NOTHING_SPECIAL,
57 U32 parent_estate_id = 0, 56 U32 parent_estate_id = 0,
58 const LLUUID& region_id = LLUUID::null, 57 const LLUUID& region_id = LLUUID::null,
59 const LLVector3& position = LLVector3::zero); 58 const LLVector3& position = LLVector3::zero);
60 59
60 void addSystemMessage(const LLUUID& session_id, const LLString& message_name, const LLString::format_map_t& args);
61
61 // This method returns TRUE if the local viewer has a session 62 // This method returns TRUE if the local viewer has a session
62 // currently open keyed to the uuid. The uuid can be keyed by 63 // currently open keyed to the uuid. The uuid can be keyed by
63 // either session id or agent id. 64 // either session id or agent id.
@@ -82,11 +83,23 @@ public:
82 const LLUUID& other_participant_id, 83 const LLUUID& other_participant_id,
83 const LLDynamicArray<LLUUID>& ids); 84 const LLDynamicArray<LLUUID>& ids);
84 85
86 // Creates a P2P session with the requisite handle for responding to voice calls
87 LLUUID addP2PSession(const std::string& name,
88 const LLUUID& other_participant_id,
89 const LLString& voice_session_handle);
90
85 // This removes the panel referenced by the uuid, and then 91 // This removes the panel referenced by the uuid, and then
86 // restores internal consistency. The internal pointer is not 92 // restores internal consistency. The internal pointer is not
87 // deleted. 93 // deleted.
88 void removeSession(const LLUUID& session_id); 94 void removeSession(const LLUUID& session_id);
89 95
96 void inviteToSession(const LLUUID& session_id,
97 const LLString& session_name,
98 const LLUUID& caller,
99 const LLString& caller_name,
100 EInstantMessage type,
101 const LLString& session_handle = LLString::null);
102
90 //Updates a given session's session IDs. Does not open, 103 //Updates a given session's session IDs. Does not open,
91 //create or do anything new. If the old session doesn't 104 //create or do anything new. If the old session doesn't
92 //exist, then nothing happens. 105 //exist, then nothing happens.
@@ -100,6 +113,7 @@ public:
100 void refresh(); 113 void refresh();
101 114
102 void notifyNewIM(); 115 void notifyNewIM();
116 void clearNewIMNotification();
103 117
104 // IM received that you haven't seen yet 118 // IM received that you haven't seen yet
105 BOOL getIMReceived() const; 119 BOOL getIMReceived() const;
@@ -107,10 +121,7 @@ public:
107 void setFloaterOpen(BOOL open); /*Flawfinder: ignore*/ 121 void setFloaterOpen(BOOL open); /*Flawfinder: ignore*/
108 BOOL getFloaterOpen(); 122 BOOL getFloaterOpen();
109 123
110 LLFloaterIM * getFloater() { return mTalkFloater; } 124 LLFloaterChatterBox* getFloater();
111
112 // close any sessions which are not available in the newimpanel.
113 void pruneSessions();
114 125
115 // This method is used to go through all active sessions and 126 // This method is used to go through all active sessions and
116 // disable all of them. This method is usally called when you are 127 // disable all of them. This method is usally called when you are
@@ -131,9 +142,13 @@ public:
131 // is no matching panel. 142 // is no matching panel.
132 LLFloaterIMPanel* findFloaterBySession(const LLUUID& session_id); 143 LLFloaterIMPanel* findFloaterBySession(const LLUUID& session_id);
133 144
134 void onDropRequestReplyReceived(const LLUUID& session_id); 145 static LLUUID computeSessionID(EInstantMessage dialog, const LLUUID& other_participant_id);
135 146
147 void clearPendingVoiceInviation(const LLUUID& session_id);
148
136private: 149private:
150 class LLIMSessionInvite;
151
137 // create a panel and update internal representation for 152 // create a panel and update internal representation for
138 // consistency. Returns the pointer, caller (the class instance 153 // consistency. Returns the pointer, caller (the class instance
139 // since it is a private method) is not responsible for deleting 154 // since it is a private method) is not responsible for deleting
@@ -159,9 +174,8 @@ private:
159 174
160 void processIMTypingCore(const LLIMInfo* im_info, BOOL typing); 175 void processIMTypingCore(const LLIMInfo* im_info, BOOL typing);
161 176
162public: 177 static void inviteUserResponse(S32 option, void* user_data);
163 LLFloaterIM* mTalkFloater; 178 static void onInviteNameLookup(const LLUUID& id, const char* first, const char* last, BOOL is_group, void* userdata);
164 LLFloaterNewIM* mNewIMFloater;
165 179
166private: 180private:
167 std::set<LLViewHandle> mFloaters; 181 std::set<LLViewHandle> mFloaters;
@@ -170,7 +184,7 @@ private:
170 // An IM has been received that you haven't seen yet. 184 // An IM has been received that you haven't seen yet.
171 BOOL mIMReceived; 185 BOOL mIMReceived;
172 186
173 LLSD mSessionsDropRequested; 187 LLSD mPendingVoiceInvitations;
174}; 188};
175 189
176 190
@@ -178,13 +192,10 @@ class LLFloaterIM : public LLMultiFloater
178{ 192{
179public: 193public:
180 LLFloaterIM(); 194 LLFloaterIM();
181 ///*virtual*/ BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent);
182 /*virtual*/ BOOL postBuild(); 195 /*virtual*/ BOOL postBuild();
183 /*virtual*/ void onClose(bool app_quitting);
184 /*virtual*/ void addFloater(LLFloater* floaterp, BOOL select_added_floater, LLTabContainer::eInsertionPoint insertion_point = LLTabContainerCommon::END);
185}; 196};
186 197
187// Globals 198// Globals
188extern LLIMView *gIMView; 199extern LLIMMgr *gIMMgr;
189 200
190#endif // LL_LLIMView_H 201#endif // LL_LLIMView_H