PageRenderTime 34ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llgiveinventory.h

https://bitbucket.org/lindenlab/viewer-beta/
C Header | 94 lines | 29 code | 13 blank | 52 comment | 0 complexity | 2af85f8df6fd5ce257e3790205e4eeb1 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llgiveinventory.cpp
  3. * @brief LLGiveInventory class declaration
  4. *
  5. * $LicenseInfo:firstyear=2010&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_LLGIVEINVENTORY_H
  27. #define LL_LLGIVEINVENTORY_H
  28. class LLInventoryItem;
  29. class LLInventoryCategory;
  30. /**
  31. * Class represented give inventory related actions.
  32. *
  33. * It has only static methods and is not intended to be instantiated for now.
  34. */
  35. class LLGiveInventory
  36. {
  37. public:
  38. /**
  39. * Checks if inventory item you are attempting to transfer to a resident can be given.
  40. *
  41. * @return true if you can give, otherwise false.
  42. */
  43. static bool isInventoryGiveAcceptable(const LLInventoryItem* item);
  44. /**
  45. * Checks if inventory item you are attempting to transfer to a group can be given.
  46. *
  47. * @return true if you can give, otherwise false.
  48. */
  49. static bool isInventoryGroupGiveAcceptable(const LLInventoryItem* item);
  50. /**
  51. * Gives passed inventory item to specified avatar in specified session.
  52. */
  53. static bool doGiveInventoryItem(const LLUUID& to_agent,
  54. const LLInventoryItem* item,
  55. const LLUUID& im_session_id = LLUUID::null);
  56. /**
  57. * Gives passed inventory category to specified avatar in specified session.
  58. */
  59. static void doGiveInventoryCategory(const LLUUID& to_agent,
  60. const LLInventoryCategory* item,
  61. const LLUUID &session_id = LLUUID::null);
  62. // give inventory item functionality
  63. static bool handleCopyProtectedItem(const LLSD& notification, const LLSD& response);
  64. private:
  65. // this class is not intended to be instantiated.
  66. LLGiveInventory();
  67. /**
  68. * logs "Inventory item offered" to IM
  69. */
  70. static void logInventoryOffer(const LLUUID& to_agent,
  71. const LLUUID &im_session_id = LLUUID::null);
  72. static void commitGiveInventoryItem(const LLUUID& to_agent,
  73. const LLInventoryItem* item,
  74. const LLUUID &im_session_id = LLUUID::null);
  75. // give inventory category functionality
  76. static bool handleCopyProtectedCategory(const LLSD& notification, const LLSD& response);
  77. static void commitGiveInventoryCategory(const LLUUID& to_agent,
  78. const LLInventoryCategory* cat,
  79. const LLUUID &im_session_id = LLUUID::null);
  80. };
  81. #endif // LL_LLGIVEINVENTORY_H