/indra/newview/llpanelimcontrolpanel.h
C++ Header | 138 lines | 75 code | 33 blank | 30 comment | 0 complexity | bdd763efb86ef4d710c406ce15199a70 MD5 | raw file
Possible License(s): LGPL-2.1
1/** 2 * @file llpanelimcontrolpanel.h 3 * @brief LLPanelIMControlPanel and related class definitions 4 * 5 * $LicenseInfo:firstyear=2004&license=viewerlgpl$ 6 * Second Life Viewer Source Code 7 * Copyright (C) 2010, Linden Research, Inc. 8 * 9 * This library is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU Lesser General Public 11 * License as published by the Free Software Foundation; 12 * version 2.1 of the License only. 13 * 14 * This library is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 * Lesser General Public License for more details. 18 * 19 * You should have received a copy of the GNU Lesser General Public 20 * License along with this library; if not, write to the Free Software 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 * 23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA 24 * $/LicenseInfo$ 25 */ 26 27#ifndef LL_LLPANELIMCONTROLPANEL_H 28#define LL_LLPANELIMCONTROLPANEL_H 29 30#include "llpanel.h" 31#include "llvoicechannel.h" 32#include "llcallingcard.h" 33 34class LLParticipantList; 35 36class LLPanelChatControlPanel 37 : public LLPanel 38 , public LLVoiceClientStatusObserver 39{ 40public: 41 LLPanelChatControlPanel() : 42 mSessionId(LLUUID()) {}; 43 ~LLPanelChatControlPanel(); 44 45 virtual BOOL postBuild(); 46 47 void onCallButtonClicked(); 48 void onEndCallButtonClicked(); 49 void onOpenVoiceControlsClicked(); 50 51 // Implements LLVoiceClientStatusObserver::onChange() to enable the call 52 // button when voice is available 53 /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); 54 55 virtual void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state); 56 57 void updateButtons(LLVoiceChannel::EState state); 58 59 // Enables/disables call button depending on voice availability 60 void updateCallButton(); 61 62 virtual void setSessionId(const LLUUID& session_id); 63 const LLUUID& getSessionId() { return mSessionId; } 64 65private: 66 LLUUID mSessionId; 67 68 // connection to voice channel state change signal 69 boost::signals2::connection mVoiceChannelStateChangeConnection; 70}; 71 72 73class LLPanelIMControlPanel : public LLPanelChatControlPanel, LLFriendObserver 74{ 75public: 76 LLPanelIMControlPanel(); 77 ~LLPanelIMControlPanel(); 78 79 BOOL postBuild(); 80 81 void setSessionId(const LLUUID& session_id); 82 83 // LLFriendObserver trigger 84 virtual void changed(U32 mask); 85 86protected: 87 void onNameCache(const LLUUID& id, const std::string& full_name, bool is_group); 88 89private: 90 void onViewProfileButtonClicked(); 91 void onAddFriendButtonClicked(); 92 void onShareButtonClicked(); 93 void onTeleportButtonClicked(); 94 void onPayButtonClicked(); 95 void onFocusReceived(); 96 97 void onClickMuteVolume(); 98 void onClickBlock(); 99 void onClickUnblock(); 100 /*virtual*/ void draw(); 101 void onVolumeChange(const LLSD& data); 102 103 LLUUID mAvatarID; 104}; 105 106 107class LLPanelGroupControlPanel : public LLPanelChatControlPanel 108{ 109public: 110 LLPanelGroupControlPanel(const LLUUID& session_id); 111 ~LLPanelGroupControlPanel(); 112 113 BOOL postBuild(); 114 115 void setSessionId(const LLUUID& session_id); 116 /*virtual*/ void draw(); 117 118protected: 119 LLUUID mGroupID; 120 121 LLParticipantList* mParticipantList; 122 123private: 124 void onGroupInfoButtonClicked(); 125 void onSortMenuItemClicked(const LLSD& userdata); 126 /*virtual*/ void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state); 127}; 128 129class LLPanelAdHocControlPanel : public LLPanelGroupControlPanel 130{ 131public: 132 LLPanelAdHocControlPanel(const LLUUID& session_id); 133 134 BOOL postBuild(); 135 136}; 137 138#endif // LL_LLPANELIMCONTROLPANEL_H