diff options
author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-04-04 20:18:08 +0300 |
---|---|---|
committer | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2023-04-04 20:18:08 +0300 |
commit | f5809ad862c0a9b1004a2c9a779df99ff4555a1f (patch) | |
tree | d873fc3253d10f4574b9aff1c9e2488366259cad /indra/newview/llinventorygallery.h | |
parent | 58092382269eb8dc48fb30734ee3738f7385f8da (diff) |
SL-19379 Observe thumbnail changes and update it in Gallery
Diffstat (limited to 'indra/newview/llinventorygallery.h')
-rw-r--r-- | indra/newview/llinventorygallery.h | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/indra/newview/llinventorygallery.h b/indra/newview/llinventorygallery.h index 7284c92c96..98ed91df19 100644 --- a/indra/newview/llinventorygallery.h +++ b/indra/newview/llinventorygallery.h @@ -30,15 +30,19 @@ #include "lllistcontextmenu.h" #include "llpanel.h" #include "llinventoryfilter.h" +#include "llinventoryobserver.h" #include "llinventorymodel.h" class LLInventoryCategoriesObserver; class LLInventoryGalleryItem; class LLScrollContainer; class LLTextBox; +class LLThumbnailsObserver; class LLInventoryGalleryContextMenu; +typedef boost::function<void()> callback_t; + class LLInventoryGallery : public LLPanel { public: @@ -90,8 +94,7 @@ public: void setRootFolder(const LLUUID cat_id); void updateRootFolder(); LLUUID getRootFolder() { return mFolderID; } - typedef boost::function<void()> root_changed_callback_t; - boost::signals2::connection setRootChangedCallback(root_changed_callback_t cb); + boost::signals2::connection setRootChangedCallback(callback_t cb); void onForwardFolder(); void onBackwardFolder(); void clearNavigationHistory(); @@ -127,6 +130,7 @@ protected: void applyFilter(LLInventoryGalleryItem* item, const std::string& filter_substring); LLInventoryCategoriesObserver* mCategoriesObserver; + LLThumbnailsObserver* mThumbnailsObserver; LLUUID mSelectedItemID; bool mIsInitialized; @@ -279,4 +283,33 @@ private: LLInventoryGallery* mGallery; }; +class LLThumbnailsObserver : public LLInventoryObserver +{ +public: + LLThumbnailsObserver(){}; + + virtual void changed(U32 mask); + bool addItem(const LLUUID& obj_id, callback_t cb); + void removeItem(const LLUUID& obj_id); + +protected: + + struct LLItemData + { + LLItemData(const LLUUID& obj_id, const LLUUID& thumbnail_id, callback_t cb) + : mItemID(obj_id) + , mCallback(cb) + , mThumbnailID(thumbnail_id) + {} + + callback_t mCallback; + LLUUID mItemID; + LLUUID mThumbnailID; + }; + + typedef std::map<LLUUID, LLItemData> item_map_t; + typedef item_map_t::value_type item_map_value_t; + item_map_t mItemMap; +}; + #endif |