llavataractions.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /**
  2. * @file llavataractions.h
  3. * @brief avatar-related actions (IM, teleporting, etc)
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewergpl$
  6. *
  7. * Copyright (c) 2001-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #ifndef LL_LLAVATARACTIONS_H
  33. #define LL_LLAVATARACTIONS_H
  34. #include "lluuid.h"
  35. class LLAvatarName;
  36. class LLViewerRegion;
  37. // Purely static class
  38. class LLAvatarActions
  39. {
  40. LLAvatarActions() = delete;
  41. ~LLAvatarActions() = delete;
  42. protected:
  43. LOG_CLASS(LLAvatarActions);
  44. public:
  45. // Friendship offers.
  46. // Request with avatar name resolution and a dialog
  47. static void requestFriendshipDialog(const LLUUID& id);
  48. // Request with known avatar name and a dialog
  49. static void requestFriendshipDialog(const LLUUID& id,
  50. const std::string& name);
  51. // Request with known name and withour dialog
  52. static void requestFriendship(const LLUUID& id,
  53. const std::string& name,
  54. const std::string& message);
  55. // Send teleport offers.
  56. static void offerTeleport(const LLUUID& id);
  57. static void offerTeleport(const uuid_vec_t& ids);
  58. // Request teleport from another avatar.
  59. static void teleportRequest(const LLUUID& id);
  60. // Start instant messaging session.
  61. static void startIM(const LLUUID& id);
  62. static void startIM(const uuid_vec_t& ids, bool friends = false);
  63. // Give money to the avatar.
  64. static void pay(const LLUUID& id);
  65. // Builds a string containing a list of avatar names.
  66. //
  67. // If force_legacy is true, then lecacy names are used, regardless of the
  68. // name displaying settings (useful for mute or ban lists and other
  69. // security sensitive lists). HB
  70. static void buildAvatarsList(std::vector<LLAvatarName> avatar_names,
  71. std::string& avatars,
  72. bool force_legacy = false,
  73. const std::string& separator = ", ");
  74. // Returns the avatar region when you have permission to eject or freeze
  75. // this avatar, or NULL otherwise. HB
  76. static LLViewerRegion* canEjectOrFreeze(const LLUUID& avatar_id);
  77. // These methods kick (log out) or (un)freeze a given avatar (would work
  78. // only if you have permission to do so). They ask for confirmation via a
  79. // dialog. When executed by a God, the God kick message is used, otherwise
  80. // a user freeze or eject (not kick/logout !) message is sent, when on a
  81. // controlled parcel or land. HB
  82. static void kick(const LLUUID& avatar_id);
  83. static void freeze(const LLUUID& avatar_id, bool freeze);
  84. // User (not God) eject (with optional ban) and freeze/unfreeze messages
  85. // sending, with prior land/parcel permission verification. No confirmation
  86. // is requested. The returned value is true when the permission was correct
  87. // and the message actually sent. HB
  88. static bool sendEject(const LLUUID& avatar_id, bool ban);
  89. static bool sendFreeze(const LLUUID& avatar_id, bool freeze);
  90. };
  91. #endif // LL_LLAVATARACTIONS_H