diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-22 11:09:45 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-04-22 11:09:45 +0100 |
commit | d1910d93eb1f1e07362e99f68a0f69a664867e0d (patch) | |
tree | f24229d8ef073a1a427f2273f644cefa84380cbd /indra/newview/llinventoryobserver.h | |
parent | bf8bcfe4f76f1805a908af0368e334261b764591 (diff) | |
parent | ce8451a2578e09c00ef53b768a5dbb3e87999d0c (diff) |
merge from viewer-trunk
Diffstat (limited to 'indra/newview/llinventoryobserver.h')
-rw-r--r-- | indra/newview/llinventoryobserver.h | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 8d60df7e8d..e63b67d2ad 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -261,5 +261,40 @@ protected: uuid_vec_t mIncomplete; }; -#endif // LL_LLINVENTORYOBSERVERS_H +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryCategoriesObserver +// +// This class is used for monitoring a list of inventory categories +// and firing a callback when there are changes in any of them. +// Categories are identified by their UUIDs. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLInventoryCategoriesObserver : public LLInventoryObserver +{ +public: + typedef boost::function<void()> callback_t; + + LLInventoryCategoriesObserver() {}; + virtual void changed(U32 mask); + + void addCategory(const LLUUID& cat_id, callback_t cb); + void removeCategory(const LLUUID& cat_id); +protected: + struct LLCategoryData + { + LLCategoryData(callback_t cb, S32 version) + : mCallback(cb) + , mVersion(version) + {} + + callback_t mCallback; + S32 mVersion; + }; + + typedef std::map<LLUUID, LLCategoryData> category_map_t; + typedef category_map_t::value_type category_map_value_t; + + category_map_t mCategoryMap; +}; + +#endif // LL_LLINVENTORYOBSERVERS_H |