/indra/newview/llpanelimcontrolpanel.h

https://bitbucket.org/lindenlab/viewer-beta/ · C++ Header · 138 lines · 75 code · 33 blank · 30 comment · 0 complexity · bdd763efb86ef4d710c406ce15199a70 MD5 · raw file

  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. #ifndef LL_LLPANELIMCONTROLPANEL_H
  27. #define LL_LLPANELIMCONTROLPANEL_H
  28. #include "llpanel.h"
  29. #include "llvoicechannel.h"
  30. #include "llcallingcard.h"
  31. class LLParticipantList;
  32. class LLPanelChatControlPanel
  33. : public LLPanel
  34. , public LLVoiceClientStatusObserver
  35. {
  36. public:
  37. LLPanelChatControlPanel() :
  38. mSessionId(LLUUID()) {};
  39. ~LLPanelChatControlPanel();
  40. virtual BOOL postBuild();
  41. void onCallButtonClicked();
  42. void onEndCallButtonClicked();
  43. void onOpenVoiceControlsClicked();
  44. // Implements LLVoiceClientStatusObserver::onChange() to enable the call
  45. // button when voice is available
  46. /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
  47. virtual void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state);
  48. void updateButtons(LLVoiceChannel::EState state);
  49. // Enables/disables call button depending on voice availability
  50. void updateCallButton();
  51. virtual void setSessionId(const LLUUID& session_id);
  52. const LLUUID& getSessionId() { return mSessionId; }
  53. private:
  54. LLUUID mSessionId;
  55. // connection to voice channel state change signal
  56. boost::signals2::connection mVoiceChannelStateChangeConnection;
  57. };
  58. class LLPanelIMControlPanel : public LLPanelChatControlPanel, LLFriendObserver
  59. {
  60. public:
  61. LLPanelIMControlPanel();
  62. ~LLPanelIMControlPanel();
  63. BOOL postBuild();
  64. void setSessionId(const LLUUID& session_id);
  65. // LLFriendObserver trigger
  66. virtual void changed(U32 mask);
  67. protected:
  68. void onNameCache(const LLUUID& id, const std::string& full_name, bool is_group);
  69. private:
  70. void onViewProfileButtonClicked();
  71. void onAddFriendButtonClicked();
  72. void onShareButtonClicked();
  73. void onTeleportButtonClicked();
  74. void onPayButtonClicked();
  75. void onFocusReceived();
  76. void onClickMuteVolume();
  77. void onClickBlock();
  78. void onClickUnblock();
  79. /*virtual*/ void draw();
  80. void onVolumeChange(const LLSD& data);
  81. LLUUID mAvatarID;
  82. };
  83. class LLPanelGroupControlPanel : public LLPanelChatControlPanel
  84. {
  85. public:
  86. LLPanelGroupControlPanel(const LLUUID& session_id);
  87. ~LLPanelGroupControlPanel();
  88. BOOL postBuild();
  89. void setSessionId(const LLUUID& session_id);
  90. /*virtual*/ void draw();
  91. protected:
  92. LLUUID mGroupID;
  93. LLParticipantList* mParticipantList;
  94. private:
  95. void onGroupInfoButtonClicked();
  96. void onSortMenuItemClicked(const LLSD& userdata);
  97. /*virtual*/ void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state);
  98. };
  99. class LLPanelAdHocControlPanel : public LLPanelGroupControlPanel
  100. {
  101. public:
  102. LLPanelAdHocControlPanel(const LLUUID& session_id);
  103. BOOL postBuild();
  104. };
  105. #endif // LL_LLPANELIMCONTROLPANEL_H