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