llpanelobjectinventory.h
上传用户:king477883
上传日期:2021-03-01
资源大小:9553k
文件大小:3k
源码类别:

游戏引擎

开发平台:

C++ Builder

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