/indra/newview/llpanelobjectinventory.h
C++ Header | 99 lines | 49 code | 17 blank | 33 comment | 0 complexity | 5c446890c49ad6fe4c1101c926c4edcc MD5 | raw file
Possible License(s): LGPL-2.1
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 27#ifndef LL_LLPANELOBJECTINVENTORY_H 28#define LL_LLPANELOBJECTINVENTORY_H 29 30#include "llvoinventorylistener.h" 31#include "llpanel.h" 32 33#include "llinventory.h" 34 35class LLScrollContainer; 36class LLFolderView; 37class LLFolderViewFolder; 38class LLViewerObject; 39 40//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 41// Class LLPanelObjectInventory 42// 43// This class represents the panel used to view and control a 44// particular task's inventory. 45// 46//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 47class LLPanelObjectInventory : public LLPanel, public LLVOInventoryListener 48{ 49public: 50 // dummy param block for template registration purposes 51 struct Params : public LLPanel::Params {}; 52 53 LLPanelObjectInventory(const Params&); 54 virtual ~LLPanelObjectInventory(); 55 56 virtual BOOL postBuild(); 57 58 void doToSelected(const LLSD& userdata); 59 60 void refresh(); 61 const LLUUID& getTaskUUID() { return mTaskUUID;} 62 void removeSelectedItem(); 63 void startRenamingSelectedItem(); 64 65 LLFolderView* getRootFolder() const { return mFolders; } 66 67 virtual void draw(); 68 virtual void deleteAllChildren(); 69 virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg); 70 71 /*virtual*/ void onFocusLost(); 72 /*virtual*/ void onFocusReceived(); 73 74 static void idle(void* user_data); 75 76protected: 77 void reset(); 78 /*virtual*/ void inventoryChanged(LLViewerObject* object, 79 LLInventoryObject::object_list_t* inventory, 80 S32 serial_num, 81 void* user_data); 82 void updateInventory(); 83 void createFolderViews(LLInventoryObject* inventory_root, LLInventoryObject::object_list_t& contents); 84 void createViewsForCategory(LLInventoryObject::object_list_t* inventory, 85 LLInventoryObject* parent, 86 LLFolderViewFolder* folder); 87 void clearContents(); 88 89private: 90 LLScrollContainer* mScroller; 91 LLFolderView* mFolders; 92 93 LLUUID mTaskUUID; 94 BOOL mHaveInventory; 95 BOOL mIsInventoryEmpty; 96 BOOL mInventoryNeedsUpdate; 97}; 98 99#endif // LL_LLPANELOBJECTINVENTORY_H