diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-05-01 15:52:13 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-05-01 15:52:13 +0100 |
commit | f13b30848bb224695e9708ab61742c6d86d29935 (patch) | |
tree | 01a10ce4ea660b719cbca9544917b46af7628692 /indra/newview/llcofwearables.h | |
parent | 5ab2d0755578b4129b532f67a78d780be039fed0 (diff) | |
parent | 0cbdad70611201a94b9550598e61067faa1fac6b (diff) |
merge from viewer-trunk
Diffstat (limited to 'indra/newview/llcofwearables.h')
-rw-r--r-- | indra/newview/llcofwearables.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h index 58d67ed32f..2d26bf781f 100644 --- a/indra/newview/llcofwearables.h +++ b/indra/newview/llcofwearables.h @@ -34,12 +34,82 @@ #define LL_LLCOFWEARABLES_H #include "llpanel.h" +#include "llinventorymodel.h" +#include "llappearancemgr.h" +#include "llwearableitemslist.h" class LLFlatListView; +/** + * Adaptor between LLAccordionCtrlTab and LLFlatListView to facilitate communication between them + * (notify, notifyParent) regarding size changes of a list and selection changes across accordion tabs. + * Besides that it acts as a container for the LLFlatListView and a button bar on top of it. + */ +class LLCOFAccordionListAdaptor : public LLPanel +{ +public: + LLCOFAccordionListAdaptor() : LLPanel() {}; + ~LLCOFAccordionListAdaptor() {}; + + S32 notifyParent(const LLSD& info) + { + LLView* parent = getParent(); + if (!parent) return -1; + + if (!(info.has("action") && "size_changes" == info["action"].asString())) + { + return parent->notifyParent(info); + } + + LLRect rc; + childGetRect("button_bar", rc); + + LLSD params; + params["action"] = "size_changes"; + params["width"] = info["width"]; + params["height"] = info["height"].asInteger() + rc.getHeight(); + + return parent->notifyParent(params); + } + + + S32 notify(const LLSD& info) + { + for (child_list_const_iter_t iter = beginChild(); iter != endChild(); iter++) + { + if (dynamic_cast<LLFlatListView*>(*iter)) + { + return (*iter)->notify(info); + } + } + return LLPanel::notify(info); + }; +}; + + class LLCOFWearables : public LLPanel { public: + + /** + * Represents a collection of callbacks assigned to inventory panel item's buttons + */ + class LLCOFCallbacks + { + public: + LLCOFCallbacks() {}; + virtual ~LLCOFCallbacks() {}; + + typedef boost::function<void (void*)> cof_callback_t; + + cof_callback_t mMoveWearableCloser; + cof_callback_t mMoveWearableFurther; + cof_callback_t mEditWearable; + cof_callback_t mDeleteWearable; + }; + + + LLCOFWearables(); virtual ~LLCOFWearables() {}; @@ -50,16 +120,27 @@ public: void refresh(); void clear(); + LLCOFCallbacks& getCOFCallbacks() { return mCOFCallbacks; } + protected: + void populateAttachmentsAndBodypartsLists(const LLInventoryModel::item_array_t& cof_items); + void populateClothingList(LLAppearanceMgr::wearables_by_type_t& clothing_by_type); + + void addClothingTypesDummies(const LLAppearanceMgr::wearables_by_type_t& clothing_by_type); void onSelectionChange(LLFlatListView* selected_list); + LLPanelClothingListItem* buildClothingListItem(LLViewerInventoryItem* item, bool first, bool last); + LLPanelBodyPartsListItem* buildBodypartListItem(LLViewerInventoryItem* item); + LLFlatListView* mAttachments; LLFlatListView* mClothing; LLFlatListView* mBodyParts; LLFlatListView* mLastSelectedList; + LLCOFCallbacks mCOFCallbacks; + }; |