/indra/newview/llpanelobjectinventory.h

https://bitbucket.org/lindenlab/viewer-beta/ · C++ Header · 99 lines · 49 code · 17 blank · 33 comment · 0 complexity · 5c446890c49ad6fe4c1101c926c4edcc MD5 · raw file

  1. /**
  2. * @file llpanelobjectinventory.h
  3. * @brief LLPanelObjectInventory class definition
  4. *
  5. * $LicenseInfo:firstyear=2002&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_LLPANELOBJECTINVENTORY_H
  27. #define LL_LLPANELOBJECTINVENTORY_H
  28. #include "llvoinventorylistener.h"
  29. #include "llpanel.h"
  30. #include "llinventory.h"
  31. class LLScrollContainer;
  32. class LLFolderView;
  33. class LLFolderViewFolder;
  34. class LLViewerObject;
  35. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  36. // Class LLPanelObjectInventory
  37. //
  38. // This class represents the panel used to view and control a
  39. // particular task's inventory.
  40. //
  41. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  42. class LLPanelObjectInventory : public LLPanel, public LLVOInventoryListener
  43. {
  44. public:
  45. // dummy param block for template registration purposes
  46. struct Params : public LLPanel::Params {};
  47. LLPanelObjectInventory(const Params&);
  48. virtual ~LLPanelObjectInventory();
  49. virtual BOOL postBuild();
  50. void doToSelected(const LLSD& userdata);
  51. void refresh();
  52. const LLUUID& getTaskUUID() { return mTaskUUID;}
  53. void removeSelectedItem();
  54. void startRenamingSelectedItem();
  55. LLFolderView* getRootFolder() const { return mFolders; }
  56. virtual void draw();
  57. virtual void deleteAllChildren();
  58. virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg);
  59. /*virtual*/ void onFocusLost();
  60. /*virtual*/ void onFocusReceived();
  61. static void idle(void* user_data);
  62. protected:
  63. void reset();
  64. /*virtual*/ void inventoryChanged(LLViewerObject* object,
  65. LLInventoryObject::object_list_t* inventory,
  66. S32 serial_num,
  67. void* user_data);
  68. void updateInventory();
  69. void createFolderViews(LLInventoryObject* inventory_root, LLInventoryObject::object_list_t& contents);
  70. void createViewsForCategory(LLInventoryObject::object_list_t* inventory,
  71. LLInventoryObject* parent,
  72. LLFolderViewFolder* folder);
  73. void clearContents();
  74. private:
  75. LLScrollContainer* mScroller;
  76. LLFolderView* mFolders;
  77. LLUUID mTaskUUID;
  78. BOOL mHaveInventory;
  79. BOOL mIsInventoryEmpty;
  80. BOOL mInventoryNeedsUpdate;
  81. };
  82. #endif // LL_LLPANELOBJECTINVENTORY_H