PageRenderTime 41ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llvoinventorylistener.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 66 lines | 21 code | 11 blank | 34 comment | 0 complexity | 773c837aba3e1fb039eeb5417641e388 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llvoinventorylistener.h
  3. * @brief Interface for classes that wish to receive updates about viewer object inventory
  4. *
  5. * $LicenseInfo:firstyear=2001&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. // Description of LLVOInventoryListener class, which is an interface
  27. // for windows that are interested in updates to a ViewerObject's inventory.
  28. #ifndef LL_LLVOINVENTORYLISTENER_H
  29. #define LL_LLVOINVENTORYLISTENER_H
  30. #include "llviewerobject.h"
  31. class LLVOInventoryListener
  32. {
  33. public:
  34. virtual void inventoryChanged(LLViewerObject* object,
  35. LLInventoryObject::object_list_t* inventory,
  36. S32 serial_num,
  37. void* user_data) = 0;
  38. // Remove the listener from the object and clear this listener
  39. void removeVOInventoryListener();
  40. // Just clear this listener, don't worry about the object.
  41. void clearVOInventoryListener();
  42. protected:
  43. LLVOInventoryListener() : mListenerVObject(NULL) { }
  44. virtual ~LLVOInventoryListener() { removeVOInventoryListener(); }
  45. void registerVOInventoryListener(LLViewerObject* object, void* user_data);
  46. void requestVOInventory();
  47. private:
  48. // LLViewerObject is normally wrapped by an LLPointer, but not in
  49. // this case, because it's already sure to be kept alive by
  50. // LLPointers held by other objects that have longer lifetimes
  51. // than this one. Plumbing correct LLPointer usage all the way
  52. // down here has been deemed too much work for now.
  53. LLViewerObject *mListenerVObject;
  54. };
  55. #endif