PageRenderTime 21ms CodeModel.GetById 14ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llavataractions.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 216 lines | 56 code | 36 blank | 124 comment | 0 complexity | 94bc94b92761264f36cc34332c5a7bd4 MD5 | raw file
  1/** 
  2 * @file llavataractions.h
  3 * @brief Friend-related actions (add, remove, offer teleport, etc)
  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_LLAVATARACTIONS_H
 28#define LL_LLAVATARACTIONS_H
 29
 30#include "lldarray.h"
 31#include "llsd.h"
 32#include "lluuid.h"
 33
 34#include <string>
 35#include <vector>
 36
 37class LLInventoryPanel;
 38class LLFloater;
 39
 40/**
 41 * Friend-related actions (add, remove, offer teleport, etc)
 42 */
 43class LLAvatarActions
 44{
 45public:
 46	/**
 47	 * Show a dialog explaining what friendship entails, then request friendship.
 48	 */
 49	static void requestFriendshipDialog(const LLUUID& id, const std::string& name);
 50
 51	/**
 52	 * Show a dialog explaining what friendship entails, then request friendship.
 53	 */
 54	static void requestFriendshipDialog(const LLUUID& id);
 55
 56	/**
 57	 * Show a friend removal dialog.
 58	 */
 59	static void removeFriendDialog(const LLUUID& id);
 60	static void removeFriendsDialog(const uuid_vec_t& ids);
 61	
 62	/**
 63	 * Show teleport offer dialog.
 64	 */
 65	static void offerTeleport(const LLUUID& invitee);
 66	static void offerTeleport(const uuid_vec_t& ids);
 67
 68	/**
 69	 * Start instant messaging session.
 70	 */
 71	static void startIM(const LLUUID& id);
 72
 73	/**
 74	 * End instant messaging session.
 75	 */
 76	static void endIM(const LLUUID& id);
 77
 78	/**
 79	 * Start an avatar-to-avatar voice call with another user
 80	 */
 81	static void startCall(const LLUUID& id);
 82
 83	/**
 84	 * Start an ad-hoc conference voice call with multiple users
 85	 */
 86	static void startAdhocCall(const uuid_vec_t& ids);
 87
 88	/**
 89	 * Start conference chat with the given avatars.
 90	 */
 91	static void startConference(const uuid_vec_t& ids);
 92
 93	/**
 94	 * Show avatar profile.
 95	 */
 96	static void showProfile(const LLUUID& id);
 97	static void hideProfile(const LLUUID& id);
 98	static bool profileVisible(const LLUUID& id);
 99	static LLFloater* getProfileFloater(const LLUUID& id);
100
101	/**
102	 * Show avatar on world map.
103	 */
104	static void showOnMap(const LLUUID& id);
105
106	/**
107	 * Give money to the avatar.
108	 */
109	static void pay(const LLUUID& id);
110
111	/**
112	 * Share items with the avatar.
113	 */
114	static void share(const LLUUID& id);
115
116	/**
117	 * Share items with the picked avatars.
118	 */
119	static void shareWithAvatars();
120
121	/**
122	 * Block/unblock the avatar.
123	 */
124	static void toggleBlock(const LLUUID& id);
125
126	/**
127	 * Return true if avatar with "id" is a friend
128	 */
129	static bool isFriend(const LLUUID& id);
130
131	/**
132	 * @return true if the avatar is blocked
133	 */
134	static bool isBlocked(const LLUUID& id);
135
136	/**
137	 * @return true if you can block the avatar
138	 */
139	static bool canBlock(const LLUUID& id);
140
141	/**
142	 * Return true if the avatar is in a P2P voice call with a given user
143	 */
144	/* AD *TODO: Is this function needed any more?
145		I fixed it a bit(added check for canCall), but it appears that it is not used
146		anywhere. Maybe it should be removed?
147	static bool isCalling(const LLUUID &id);*/
148
149	/**
150	 * @return true if call to the resident can be made
151	 */
152
153	static bool canCall();
154	/**
155	 * Invite avatar to a group.
156	 */	
157	static void inviteToGroup(const LLUUID& id);
158	
159	/**
160	 * Kick avatar off grid
161	 */	
162	static void kick(const LLUUID& id);
163
164	/**
165	 * Freeze avatar
166	 */	
167	static void freeze(const LLUUID& id);
168
169	/**
170	 * Unfreeze avatar
171	 */	
172	static void unfreeze(const LLUUID& id);
173
174	/**
175	 * Open csr page for avatar
176	 */	
177	static void csr(const LLUUID& id, std::string name);
178
179	/**
180	 * Checks whether we can offer a teleport to the avatar, only offline friends
181	 * cannot be offered a teleport.
182	 *
183	 * @return false if avatar is a friend and not visibly online
184	 */
185	static bool canOfferTeleport(const LLUUID& id);
186
187	/**
188	 * @return false if any one of the specified avatars a friend and not visibly online
189	 */
190	static bool canOfferTeleport(const uuid_vec_t& ids);
191
192	/**
193	 * Checks whether all items selected in the given inventory panel can be shared
194	 *
195	 * @param inv_panel Inventory panel to get selection from. If NULL, the active inventory panel is used.
196	 *
197	 * @return false if the selected items cannot be shared or the active inventory panel cannot be obtained
198	 */
199	static bool canShareSelectedItems(LLInventoryPanel* inv_panel = NULL);
200
201	static std::set<LLUUID> getInventorySelectedUUIDs();
202
203private:
204	static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
205	static bool handleRemove(const LLSD& notification, const LLSD& response);
206	static bool handlePay(const LLSD& notification, const LLSD& response, LLUUID avatar_id);
207	static bool handleKick(const LLSD& notification, const LLSD& response);
208	static bool handleFreeze(const LLSD& notification, const LLSD& response);
209	static bool handleUnfreeze(const LLSD& notification, const LLSD& response);
210	static void callback_invite_to_group(LLUUID group_id, LLUUID id);
211
212	// Just request friendship, no dialog.
213	static void requestFriendship(const LLUUID& target_id, const std::string& target_name, const std::string& message);
214};
215
216#endif // LL_LLAVATARACTIONS_H