00001
00034 #ifndef LL_LLFLOATERFRIENDS_H
00035 #define LL_LLFLOATERFRIENDS_H
00036
00037 #include "llpanel.h"
00038 #include "llstring.h"
00039 #include "lluuid.h"
00040 #include "lltimer.h"
00041
00042 class LLFriendObserver;
00043 class LLRelationship;
00044 class LLScrollListItem;
00045 class LLScrollListCtrl;
00046
00054 class LLPanelFriends : public LLPanel, public LLEventTimer
00055 {
00056 public:
00057 LLPanelFriends();
00058 virtual ~LLPanelFriends();
00059
00065 virtual BOOL tick();
00066
00071 void updateFriends(U32 changed_mask);
00072
00073 virtual BOOL postBuild();
00074
00075
00076
00077 static void requestFriendshipDialog(const LLUUID& target_id,
00078 const std::string& target_name);
00079
00080
00081 static void requestFriendship(const LLUUID& target_id,
00082 const LLString& target_name);
00083
00084 private:
00085
00086 enum FRIENDS_COLUMN_ORDER
00087 {
00088 LIST_ONLINE_STATUS,
00089 LIST_FRIEND_NAME,
00090 LIST_VISIBLE_ONLINE,
00091 LIST_VISIBLE_MAP,
00092 LIST_EDIT_MINE,
00093 LIST_EDIT_THEIRS,
00094 LIST_FRIEND_UPDATE_GEN
00095 };
00096
00097
00098 typedef std::map<LLUUID, S32> rights_map_t;
00099 void reloadNames();
00100 void refreshNames();
00101 void refreshUI();
00102 void refreshRightsChangeList();
00103 void applyRightsToFriends();
00104 BOOL addFriend(const LLUUID& agent_id);
00105 BOOL updateFriendItem(const LLUUID& agent_id, const LLRelationship* relationship);
00106
00107 typedef enum
00108 {
00109 GRANT,
00110 REVOKE
00111 } EGrantRevoke;
00112 void confirmModifyRights(rights_map_t& ids, EGrantRevoke command);
00113 void sendRightsGrant(rights_map_t& ids);
00114
00115
00116 LLDynamicArray<LLUUID> getSelectedIDs();
00117
00118
00119 static void onSelectName(LLUICtrl* ctrl, void* user_data);
00120 static void callbackAddFriend(S32 option, void* user_data);
00121 static void onPickAvatar(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* user_data);
00122 static void onMaximumSelect(void* user_data);
00123
00124 static void onClickIM(void* user_data);
00125 static void onClickProfile(void* user_data);
00126 static void onClickAddFriend(void* user_data);
00127 static void onClickRemove(void* user_data);
00128
00129 static void onClickOfferTeleport(void* user_data);
00130 static void onClickPay(void* user_data);
00131
00132 static void onClickModifyStatus(LLUICtrl* ctrl, void* user_data);
00133
00134 static void handleRemove(S32 option, void* user_data);
00135 static void modifyRightsConfirmation(S32 option, void* user_data);
00136
00137 private:
00138
00139 LLFriendObserver* mObserver;
00140 LLUUID mAddFriendID;
00141 LLString mAddFriendName;
00142 LLScrollListCtrl* mFriendsList;
00143 BOOL mShowMaxSelectWarning;
00144 BOOL mAllowRightsChange;
00145 S32 mNumRightsChanged;
00146 };
00147
00148
00149 #endif // LL_LLFLOATERFRIENDS_H