/indra/newview/llpanelpeople.h

https://bitbucket.org/lindenlab/viewer-beta/ · C Header · 167 lines · 108 code · 27 blank · 32 comment · 0 complexity · ad5018abdb0ab3c7b6eb88f8015285f3 MD5 · raw file

  1. /**
  2. * @file llpanelpeople.h
  3. * @brief Side tray "People" panel
  4. *
  5. * $LicenseInfo:firstyear=2009&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_LLPANELPEOPLE_H
  27. #define LL_LLPANELPEOPLE_H
  28. #include <llpanel.h>
  29. #include "llcallingcard.h" // for avatar tracker
  30. #include "llvoiceclient.h"
  31. class LLAvatarList;
  32. class LLAvatarName;
  33. class LLFilterEditor;
  34. class LLGroupList;
  35. class LLMenuButton;
  36. class LLTabContainer;
  37. class LLPanelPeople
  38. : public LLPanel
  39. , public LLVoiceClientStatusObserver
  40. {
  41. LOG_CLASS(LLPanelPeople);
  42. public:
  43. LLPanelPeople();
  44. virtual ~LLPanelPeople();
  45. /*virtual*/ BOOL postBuild();
  46. /*virtual*/ void onOpen(const LLSD& key);
  47. /*virtual*/ bool notifyChildren(const LLSD& info);
  48. // Implements LLVoiceClientStatusObserver::onChange() to enable call buttons
  49. // when voice is available
  50. /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal);
  51. // internals
  52. class Updater;
  53. private:
  54. typedef enum e_sort_oder {
  55. E_SORT_BY_NAME = 0,
  56. E_SORT_BY_STATUS = 1,
  57. E_SORT_BY_MOST_RECENT = 2,
  58. E_SORT_BY_DISTANCE = 3,
  59. E_SORT_BY_RECENT_SPEAKERS = 4,
  60. } ESortOrder;
  61. // methods indirectly called by the updaters
  62. void updateFriendListHelpText();
  63. void updateFriendList();
  64. void updateNearbyList();
  65. void updateRecentList();
  66. bool isItemsFreeOfFriends(const uuid_vec_t& uuids);
  67. void updateButtons();
  68. std::string getActiveTabName() const;
  69. LLUUID getCurrentItemID() const;
  70. void getCurrentItemIDs(uuid_vec_t& selected_uuids) const;
  71. void buttonSetVisible(std::string btn_name, BOOL visible);
  72. void buttonSetEnabled(const std::string& btn_name, bool enabled);
  73. void buttonSetAction(const std::string& btn_name, const commit_signal_t::slot_type& cb);
  74. void showGroupMenu(LLMenuGL* menu);
  75. void setSortOrder(LLAvatarList* list, ESortOrder order, bool save = true);
  76. // UI callbacks
  77. void onFilterEdit(const std::string& search_string);
  78. void onTabSelected(const LLSD& param);
  79. void onViewProfileButtonClicked();
  80. void onAddFriendButtonClicked();
  81. void onAddFriendWizButtonClicked();
  82. void onDeleteFriendButtonClicked();
  83. void onGroupInfoButtonClicked();
  84. void onChatButtonClicked();
  85. void onImButtonClicked();
  86. void onCallButtonClicked();
  87. void onGroupCallButtonClicked();
  88. void onTeleportButtonClicked();
  89. void onShareButtonClicked();
  90. void onMoreButtonClicked();
  91. void onActivateButtonClicked();
  92. void onAvatarListDoubleClicked(LLUICtrl* ctrl);
  93. void onAvatarListCommitted(LLAvatarList* list);
  94. void onGroupPlusButtonClicked();
  95. void onGroupMinusButtonClicked();
  96. void onGroupPlusMenuItemClicked(const LLSD& userdata);
  97. void onFriendsViewSortMenuItemClicked(const LLSD& userdata);
  98. void onNearbyViewSortMenuItemClicked(const LLSD& userdata);
  99. void onGroupsViewSortMenuItemClicked(const LLSD& userdata);
  100. void onRecentViewSortMenuItemClicked(const LLSD& userdata);
  101. //returns false only if group is "none"
  102. bool isRealGroup();
  103. bool onFriendsViewSortMenuItemCheck(const LLSD& userdata);
  104. bool onRecentViewSortMenuItemCheck(const LLSD& userdata);
  105. bool onNearbyViewSortMenuItemCheck(const LLSD& userdata);
  106. // misc callbacks
  107. static void onAvatarPicked(const uuid_vec_t& ids, const std::vector<LLAvatarName> names);
  108. void onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list);
  109. void showAccordion(const std::string name, bool show);
  110. void showFriendsAccordionsIfNeeded();
  111. void onFriendListRefreshComplete(LLUICtrl*ctrl, const LLSD& param);
  112. void setAccordionCollapsedByUser(LLUICtrl* acc_tab, bool collapsed);
  113. void setAccordionCollapsedByUser(const std::string& name, bool collapsed);
  114. bool isAccordionCollapsedByUser(LLUICtrl* acc_tab);
  115. bool isAccordionCollapsedByUser(const std::string& name);
  116. LLFilterEditor* mFilterEditor;
  117. LLTabContainer* mTabContainer;
  118. LLAvatarList* mOnlineFriendList;
  119. LLAvatarList* mAllFriendList;
  120. LLAvatarList* mNearbyList;
  121. LLAvatarList* mRecentList;
  122. LLGroupList* mGroupList;
  123. LLNetMap* mMiniMap;
  124. LLHandle<LLView> mGroupPlusMenuHandle;
  125. LLHandle<LLView> mNearbyViewSortMenuHandle;
  126. LLHandle<LLView> mFriendsViewSortMenuHandle;
  127. LLHandle<LLView> mGroupsViewSortMenuHandle;
  128. LLHandle<LLView> mRecentViewSortMenuHandle;
  129. Updater* mFriendListUpdater;
  130. Updater* mNearbyListUpdater;
  131. Updater* mRecentListUpdater;
  132. Updater* mButtonsUpdater;
  133. LLMenuButton* mNearbyGearButton;
  134. LLMenuButton* mFriendsGearButton;
  135. LLMenuButton* mGroupsGearButton;
  136. LLMenuButton* mRecentGearButton;
  137. std::string mFilterSubString;
  138. std::string mFilterSubStringOrig;
  139. };
  140. #endif //LL_LLPANELPEOPLE_H