aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llimpanel.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:04 -0500
committerJacek Antonelli2008-08-15 23:45:04 -0500
commit117e22047c5752352342d64e3fb7ce00a4eb8113 (patch)
treee32de2cfba0dda8705ae528fcd1fbe23ba075685 /linden/indra/newview/llimpanel.h
parentSecond Life viewer sources 1.18.0.6 (diff)
downloadmeta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.zip
meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.gz
meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.bz2
meta-impy-117e22047c5752352342d64e3fb7ce00a4eb8113.tar.xz
Second Life viewer sources 1.18.1.2
Diffstat (limited to 'linden/indra/newview/llimpanel.h')
-rw-r--r--linden/indra/newview/llimpanel.h155
1 files changed, 147 insertions, 8 deletions
diff --git a/linden/indra/newview/llimpanel.h b/linden/indra/newview/llimpanel.h
index 10d387e..525f868 100644
--- a/linden/indra/newview/llimpanel.h
+++ b/linden/indra/newview/llimpanel.h
@@ -33,15 +33,122 @@
33#include "lluuid.h" 33#include "lluuid.h"
34#include "lldarray.h" 34#include "lldarray.h"
35#include "llinstantmessage.h" 35#include "llinstantmessage.h"
36#include "llvoiceclient.h"
36 37
37class LLLineEditor; 38class LLLineEditor;
38class LLViewerTextEditor; 39class LLViewerTextEditor;
39class LLInventoryItem; 40class LLInventoryItem;
40class LLInventoryCategory; 41class LLInventoryCategory;
42class LLIMSpeakerMgr;
43class LLPanelActiveSpeakers;
44
45class LLVoiceChannel : public LLVoiceClientStatusObserver
46{
47public:
48 typedef enum e_voice_channel_state
49 {
50 STATE_NO_CHANNEL_INFO,
51 STATE_ERROR,
52 STATE_HUNG_UP,
53 STATE_READY,
54 STATE_CALL_STARTED,
55 STATE_RINGING,
56 STATE_CONNECTED
57 } EState;
58
59 LLVoiceChannel(const LLUUID& session_id, const LLString& session_name);
60 virtual ~LLVoiceChannel();
61
62 void setChannelInfo(const LLString& uri, const LLString& credentials);
63 /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
64
65 virtual void handleStatusChange(EStatusType status);
66 virtual void handleError(EStatusType status);
67 virtual void deactivate();
68 virtual void activate();
69 virtual void getChannelInfo();
70 virtual BOOL isActive();
71 virtual BOOL callStarted();
72 EState getState() { return mState; }
73
74 void updateSessionID(const LLUUID& new_session_id);
75
76 static LLVoiceChannel* getChannelByID(const LLUUID& session_id);
77 static LLVoiceChannel* getChannelByURI(LLString uri);
78 static LLVoiceChannel* getCurrentVoiceChannel() { return sCurrentVoiceChannel; }
79 static void initClass();
80
81protected:
82 void setState(EState state);
83 void setURI(LLString uri);
84
85 LLString mURI;
86 LLString mCredentials;
87 LLUUID mSessionID;
88 EState mState;
89 LLString mSessionName;
90 LLString::format_map_t mNotifyArgs;
91 BOOL mIgnoreNextSessionLeave;
92 LLViewHandle mLoginNotificationHandle;
93
94 typedef std::map<LLUUID, LLVoiceChannel*> voice_channel_map_t;
95 static voice_channel_map_t sVoiceChannelMap;
96
97 typedef std::map<LLString, LLVoiceChannel*> voice_channel_map_uri_t;
98 static voice_channel_map_uri_t sVoiceChannelURIMap;
99
100 static LLVoiceChannel* sCurrentVoiceChannel;
101};
102
103class LLVoiceChannelGroup : public LLVoiceChannel
104{
105public:
106 LLVoiceChannelGroup(const LLUUID& session_id, const LLString& session_name);
107 virtual ~LLVoiceChannelGroup();
108
109 /*virtual*/ void handleError(EStatusType status);
110 /*virtual*/ void activate();
111 /*virtual*/ void deactivate();
112 /*virtual*/ void getChannelInfo();
113};
114
115class LLVoiceChannelProximal : public LLVoiceChannel, public LLSingleton<LLVoiceChannelProximal>
116{
117public:
118 LLVoiceChannelProximal();
119 virtual ~LLVoiceChannelProximal();
120
121 /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
122 /*virtual*/ void handleStatusChange(EStatusType status);
123 /*virtual*/ void handleError(EStatusType status);
124 /*virtual*/ BOOL isActive();
125 /*virtual*/ void activate();
126 /*virtual*/ void deactivate();
127
128};
129
130class LLVoiceChannelP2P : public LLVoiceChannelGroup
131{
132public:
133 LLVoiceChannelP2P(const LLUUID& session_id, const LLString& session_name, const LLUUID& other_user_id);
134 virtual ~LLVoiceChannelP2P();
135
136 /*virtual*/ void handleStatusChange(EStatusType status);
137 /*virtual*/ void handleError(EStatusType status);
138 /*virtual*/ void activate();
139 /*virtual*/ void getChannelInfo();
140
141 void setSessionHandle(const LLString& handle);
142
143private:
144 LLString mSessionHandle;
145 LLUUID mOtherUserID;
146};
41 147
42class LLFloaterIMPanel : public LLFloater 148class LLFloaterIMPanel : public LLFloater
43{ 149{
44public: 150public:
151
45 // The session id is the id of the session this is for. The target 152 // The session id is the id of the session this is for. The target
46 // refers to the user (or group) that where this session serves as 153 // refers to the user (or group) that where this session serves as
47 // the default. For example, if you open a session though a 154 // the default. For example, if you open a session though a
@@ -60,7 +167,7 @@ public:
60 const LLUUID& target_id, 167 const LLUUID& target_id,
61 const LLDynamicArray<LLUUID>& ids, 168 const LLDynamicArray<LLUUID>& ids,
62 EInstantMessage dialog); 169 EInstantMessage dialog);
63 170 virtual ~LLFloaterIMPanel();
64 171
65 /*virtual*/ BOOL postBuild(); 172 /*virtual*/ BOOL postBuild();
66 173
@@ -73,6 +180,10 @@ public:
73 // Return TRUE if successful, otherwise FALSE. 180 // Return TRUE if successful, otherwise FALSE.
74 BOOL inviteToSession(const LLDynamicArray<LLUUID>& agent_ids); 181 BOOL inviteToSession(const LLDynamicArray<LLUUID>& agent_ids);
75 182
183 void addHistoryLine(const LLUUID& source,
184 const std::string &utf8msg,
185 const LLColor4& color = LLColor4::white,
186 bool log_to_file = true);
76 void addHistoryLine(const std::string &utf8msg, 187 void addHistoryLine(const std::string &utf8msg,
77 const LLColor4& color = LLColor4::white, 188 const LLColor4& color = LLColor4::white,
78 bool log_to_file = true); 189 bool log_to_file = true);
@@ -91,15 +202,32 @@ public:
91 static void onInputEditorFocusReceived( LLUICtrl* caller, void* userdata ); 202 static void onInputEditorFocusReceived( LLUICtrl* caller, void* userdata );
92 static void onInputEditorFocusLost(LLUICtrl* caller, void* userdata); 203 static void onInputEditorFocusLost(LLUICtrl* caller, void* userdata);
93 static void onInputEditorKeystroke(LLLineEditor* caller, void* userdata); 204 static void onInputEditorKeystroke(LLLineEditor* caller, void* userdata);
205 static void onCommitChat(LLUICtrl* caller, void* userdata);
94 static void onTabClick( void* userdata ); 206 static void onTabClick( void* userdata );
95 207
96 static void onClickProfile( void* userdata ); // Profile button pressed 208 static void onClickProfile( void* userdata );
209 static void onClickGroupInfo( void* userdata );
97 static void onClickClose( void* userdata ); 210 static void onClickClose( void* userdata );
211 static void onClickStartCall( void* userdata );
212 static void onClickEndCall( void* userdata );
213 static void onClickSend( void* userdata );
214 static void onClickToggleActiveSpeakers( void* userdata );
215 static void* createSpeakersPanel(void* data);
216
217 //callbacks for P2P muting and volume control
218 static void onClickMuteVoice(LLUICtrl* source, void* user_data);
219 static void onVolumeChange(LLUICtrl* source, void* user_data);
98 220
99 const LLUUID& getSessionID() const { return mSessionUUID; } 221 const LLUUID& getSessionID() const { return mSessionUUID; }
100 const LLUUID& getOtherParticipantID() const { return mOtherParticipantUUID; } 222 const LLUUID& getOtherParticipantID() const { return mOtherParticipantUUID; }
223 void updateSpeakersList(LLSD speaker_updates);
224 void setSpeakersListFromMap(LLSD speaker_list);
225 void setSpeakersList(LLSD speaker_list);
226 LLVoiceChannel* getVoiceChannel() { return mVoiceChannel; }
101 EInstantMessage getDialogType() const { return mDialog; } 227 EInstantMessage getDialogType() const { return mDialog; }
102 228
229 void requestAutoConnect();
230
103 void sessionInitReplyReceived(const LLUUID& im_session_id); 231 void sessionInitReplyReceived(const LLUUID& im_session_id);
104 232
105 // Handle other participant in the session typing. 233 // Handle other participant in the session typing.
@@ -118,17 +246,17 @@ private:
118 BOOL dropCategory(LLInventoryCategory* category, BOOL drop); 246 BOOL dropCategory(LLInventoryCategory* category, BOOL drop);
119 247
120 // test if local agent can add agents. 248 // test if local agent can add agents.
121 BOOL isAddAllowed() const; 249 BOOL isInviteAllowed() const;
122 250
123 // Called whenever the user starts or stops typing. 251 // Called whenever the user starts or stops typing.
124 // Sends the typing state to the other user if necessary. 252 // Sends the typing state to the other user if necessary.
125 void setTyping(BOOL typing); 253 void setTyping(BOOL typing);
126 254
127 // Add the "User is typing..." indicator. 255 // Add the "User is typing..." indicator.
128 void addTypingIndicator(const LLIMInfo* im_info); 256 void addTypingIndicator(const std::string &name);
129 257
130 // Remove the "User is typing..." indicator. 258 // Remove the "User is typing..." indicator.
131 void removeTypingIndicator(); 259 void removeTypingIndicator(const LLIMInfo* im_info);
132 260
133 void sendTypingState(BOOL typing); 261 void sendTypingState(BOOL typing);
134 262
@@ -145,7 +273,8 @@ private:
145 // 911 ==> Gaurdian_Angel_Group_ID ^ gAgent.getID() 273 // 911 ==> Gaurdian_Angel_Group_ID ^ gAgent.getID()
146 LLUUID mSessionUUID; 274 LLUUID mSessionUUID;
147 275
148 BOOL mSessionInitRequested; 276 LLVoiceChannel* mVoiceChannel;
277
149 BOOL mSessionInitialized; 278 BOOL mSessionInitialized;
150 LLSD mQueuedMsgsForInit; 279 LLSD mQueuedMsgsForInit;
151 280
@@ -165,12 +294,22 @@ private:
165 // Is other user currently typing? 294 // Is other user currently typing?
166 BOOL mOtherTyping; 295 BOOL mOtherTyping;
167 296
297 // name of other user who is currently typing
298 std::string mOtherTypingName;
299
168 // Where does the "User is typing..." line start? 300 // Where does the "User is typing..." line start?
169 S32 mTypingLineStartIndex; 301 S32 mTypingLineStartIndex;
170 //Where does the "Starting session..." line start? 302 // Where does the "Starting session..." line start?
171 S32 mSessionStartMsgPos; 303 S32 mSessionStartMsgPos;
172 304
173 BOOL mSentTypingState; 305 BOOL mSentTypingState;
306
307 BOOL mShowSpeakersOnConnect;
308
309 BOOL mAutoConnect;
310
311 LLIMSpeakerMgr* mSpeakers;
312 LLPanelActiveSpeakers* mSpeakerPanel;
174 313
175 // Optimization: Don't send "User is typing..." until the 314 // Optimization: Don't send "User is typing..." until the
176 // user has actually been typing for a little while. Prevents 315 // user has actually been typing for a little while. Prevents