00001 00032 // Description of LLVOInventoryListener class, which is an interface 00033 // for windows that are interested in updates to a ViewerObject's inventory. 00034 00035 #ifndef LL_LLVOINVENTORYLISTENER_H 00036 #define LL_LLVOINVENTORYLISTENER_H 00037 00038 #include "llviewerobject.h" 00039 00040 class LLVOInventoryListener 00041 { 00042 public: 00043 virtual void inventoryChanged(LLViewerObject* object, 00044 InventoryObjectList* inventory, 00045 S32 serial_num, 00046 void* user_data) = 0; 00047 00048 // Remove the listener from the object and clear this listener 00049 void removeVOInventoryListener(); 00050 00051 // Just clear this listener, don't worry about the object. 00052 void clearVOInventoryListener(); 00053 00054 protected: 00055 LLVOInventoryListener() : mListenerVObject(NULL) { } 00056 virtual ~LLVOInventoryListener() { removeVOInventoryListener(); } 00057 00058 void registerVOInventoryListener(LLViewerObject* object, void* user_data); 00059 void requestVOInventory(); 00060 00061 private: 00062 // LLViewerObject is normally wrapped by an LLPointer, but not in 00063 // this case, because it's already sure to be kept alive by 00064 // LLPointers held by other objects that have longer lifetimes 00065 // than this one. Plumbing correct LLPointer usage all the way 00066 // down here has been deemed too much work for now. 00067 LLViewerObject *mListenerVObject; 00068 }; 00069 00070 #endif 00071