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