diff options
Diffstat (limited to 'indra/newview/lloutfitslist.h')
-rw-r--r-- | indra/newview/lloutfitslist.h | 228 |
1 files changed, 115 insertions, 113 deletions
diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 89821f9333..11512b6731 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -5,21 +5,21 @@ * $LicenseInfo:firstyear=2010&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -52,13 +52,13 @@ class LLListContextMenu; */ class LLOutfitTabNameComparator : public LLAccordionCtrl::LLTabComparator { - LOG_CLASS(LLOutfitTabNameComparator); + LOG_CLASS(LLOutfitTabNameComparator); public: - LLOutfitTabNameComparator() {}; - virtual ~LLOutfitTabNameComparator() {}; + LLOutfitTabNameComparator() {}; + virtual ~LLOutfitTabNameComparator() {}; - /*virtual*/ bool compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const; + /*virtual*/ bool compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const; }; class LLOutfitListBase : public LLPanelAppearanceTab @@ -110,6 +110,7 @@ public: virtual bool getHasExpandableFolders() = 0; protected: + void observerCallback(const LLUUID& category_id); virtual LLOutfitListGearMenuBase* createGearMenu() = 0; virtual void onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id) = 0; virtual void onSetSelectedOutfitByUUID(const LLUUID& outfit_uuid) = 0; @@ -122,21 +123,22 @@ protected: struct { - LLUUID CategoryUUID; - uuid_vec_t Added; - uuid_vec_t Removed; - uuid_vec_t::const_iterator AddedIterator; - uuid_vec_t::const_iterator RemovedIterator; + LLUUID CategoryUUID; + uuid_vec_t Added; + uuid_vec_t Removed; + uuid_vec_t::const_iterator AddedIterator; + uuid_vec_t::const_iterator RemovedIterator; } mRefreshListState; + std::set<LLUUID> mChangedItems; bool mIsInitialized; - LLInventoryCategoriesObserver* mCategoriesObserver; - LLUUID mSelectedOutfitUUID; + LLInventoryCategoriesObserver* mCategoriesObserver; + LLUUID mSelectedOutfitUUID; // id of currently highlited outfit - LLUUID mHighlightedOutfitUUID; - selection_change_signal_t mSelectionChangeSignal; - LLListContextMenu* mOutfitMenu; - LLOutfitListGearMenuBase* mGearMenu; + LLUUID mHighlightedOutfitUUID; + selection_change_signal_t mSelectionChangeSignal; + LLListContextMenu* mOutfitMenu; + LLOutfitListGearMenuBase* mGearMenu; }; ////////////////////////////////////////////////////////////////////////// @@ -164,7 +166,7 @@ protected: void onSave(const LLUUID &outfit_cat_id); private: - LLOutfitListBase* mOutfitList; + LLOutfitListBase* mOutfitList; }; class LLOutfitListGearMenuBase @@ -172,7 +174,7 @@ class LLOutfitListGearMenuBase public: LLOutfitListGearMenuBase(LLOutfitListBase* olist); virtual ~LLOutfitListGearMenuBase(); - + void updateItemsVisibility(); LLToggleableMenu* getMenu(); @@ -184,8 +186,8 @@ protected: const LLUUID& getSelectedOutfitID(); - LLOutfitListBase* mOutfitList; - LLToggleableMenu* mMenu; + LLOutfitListBase* mOutfitList; + LLToggleableMenu* mMenu; private: LLViewerInventoryCategory* getSelectedOutfit(); @@ -222,8 +224,8 @@ public: virtual BOOL handleToolTip(S32 x, S32 y, MASK mask); protected: - LLOutfitAccordionCtrlTab(const LLOutfitAccordionCtrlTab::Params &p) - : LLAccordionCtrlTab(p), + LLOutfitAccordionCtrlTab(const LLOutfitAccordionCtrlTab::Params &p) + : LLAccordionCtrlTab(p), mFolderID(p.cat_id) {} friend class LLUICtrlFactory; @@ -243,12 +245,12 @@ class LLOutfitsList : public LLOutfitListBase { public: - LLOutfitsList(); - virtual ~LLOutfitsList(); + LLOutfitsList(); + virtual ~LLOutfitsList(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ BOOL postBuild(); - /*virtual*/ void onOpen(const LLSD& info); + /*virtual*/ void onOpen(const LLSD& info); //virtual void refreshList(const LLUUID& category_id); @@ -256,32 +258,32 @@ public: /*virtual*/ void updateAddedCategory(LLUUID cat_id); /*virtual*/ void updateRemovedCategory(LLUUID cat_id); - // highlits currently worn outfit tab text and unhighlights previously worn + // highlits currently worn outfit tab text and unhighlights previously worn /*virtual*/ void onHighlightBaseOutfit(LLUUID base_id, LLUUID prev_id); - //void performAction(std::string action); + //void performAction(std::string action); - /*virtual*/ void onFilterSubStringChanged(const std::string& new_string, const std::string& old_string); + /*virtual*/ void onFilterSubStringChanged(const std::string& new_string, const std::string& old_string); - /*virtual*/ void getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const; + /*virtual*/ void getSelectedItemsUUIDs(uuid_vec_t& selected_uuids) const; // Collects selected items from all selected lists and wears them(if possible- adds, else replaces) - void wearSelectedItems(); + void wearSelectedItems(); - /** - * Returns true if there is a selection inside currently selected outfit - */ + /** + * Returns true if there is a selection inside currently selected outfit + */ /*virtual*/ bool hasItemSelected(); - /** - Collapses all outfit accordions. - */ - /*virtual*/ void onCollapseAllFolders(); - /** - Expands all outfit accordions. - */ - void onExpandAllFolders(); + /** + Collapses all outfit accordions. + */ + /*virtual*/ void onCollapseAllFolders(); + /** + Expands all outfit accordions. + */ + void onExpandAllFolders(); /*virtual*/ bool getHasExpandableFolders() { return TRUE; } @@ -290,95 +292,95 @@ protected: private: - /** - * Wrapper for LLCommonUtils::computeDifference. @see LLCommonUtils::computeDifference - */ - //void computeDifference(const LLInventoryModel::cat_array_t& vcats, uuid_vec_t& vadded, uuid_vec_t& vremoved); + /** + * Wrapper for LLCommonUtils::computeDifference. @see LLCommonUtils::computeDifference + */ + //void computeDifference(const LLInventoryModel::cat_array_t& vcats, uuid_vec_t& vadded, uuid_vec_t& vremoved); void getCurrentCategories(uuid_vec_t& vcur); - /** - * Updates tab displaying outfit identified by category_id. - */ + /** + * Updates tab displaying outfit identified by category_id. + */ /*virtual*/ void updateChangedCategoryName(LLViewerInventoryCategory *cat, std::string name); /*virtual*/ void sortOutfits(); /*virtual*/ void onSetSelectedOutfitByUUID(const LLUUID& outfit_uuid); - /** - * Resets previous selection and stores newly selected list and outfit id. - */ + /** + * Resets previous selection and stores newly selected list and outfit id. + */ /*virtual*/ void onChangeOutfitSelection(LLWearableItemsList* list, const LLUUID& category_id); - /** - *Resets items selection inside outfit - */ - void resetItemSelection(LLWearableItemsList* list, const LLUUID& category_id); - - /** - * Removes the outfit from selection. - */ - /*virtual*/ void deselectOutfit(const LLUUID& category_id); - - /** - * Try restoring selection for a temporary hidden tab. - * - * A tab may be hidden if it doesn't match current filter. - */ - void restoreOutfitSelection(LLAccordionCtrlTab* tab, const LLUUID& category_id); - - /** - * Called upon list refresh event to update tab visibility depending on - * the results of applying filter to the title and list items of the tab. - */ - void onRefreshComplete(LLUICtrl* ctrl); - - /** - * Applies filter to the given tab - * - * @see applyFilter() - */ - void applyFilterToTab(const LLUUID& category_id, LLAccordionCtrlTab* tab, const std::string& filter_substring); - - /** - * Returns true if all selected items can be worn. - */ - bool canWearSelected(); - - void onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y); - void onCOFChanged(); - - void onListSelectionChange(LLUICtrl* ctrl); + /** + *Resets items selection inside outfit + */ + void resetItemSelection(LLWearableItemsList* list, const LLUUID& category_id); + + /** + * Removes the outfit from selection. + */ + /*virtual*/ void deselectOutfit(const LLUUID& category_id); + + /** + * Try restoring selection for a temporary hidden tab. + * + * A tab may be hidden if it doesn't match current filter. + */ + void restoreOutfitSelection(LLAccordionCtrlTab* tab, const LLUUID& category_id); + + /** + * Called upon list refresh event to update tab visibility depending on + * the results of applying filter to the title and list items of the tab. + */ + void onRefreshComplete(LLUICtrl* ctrl); + + /** + * Applies filter to the given tab + * + * @see applyFilter() + */ + void applyFilterToTab(const LLUUID& category_id, LLAccordionCtrlTab* tab, const std::string& filter_substring); + + /** + * Returns true if all selected items can be worn. + */ + bool canWearSelected(); + + void onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y); + void onCOFChanged(); + + void onListSelectionChange(LLUICtrl* ctrl); /*virtual*/ void onOutfitRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id); - static void onOutfitRename(const LLSD& notification, const LLSD& response); + static void onOutfitRename(const LLSD& notification, const LLSD& response); - //LLInventoryCategoriesObserver* mCategoriesObserver; + //LLInventoryCategoriesObserver* mCategoriesObserver; - LLAccordionCtrl* mAccordion; - LLPanel* mListCommands; + LLAccordionCtrl* mAccordion; + LLPanel* mListCommands; - typedef std::map<LLUUID, LLWearableItemsList*> wearables_lists_map_t; - typedef wearables_lists_map_t::value_type wearables_lists_map_value_t; - wearables_lists_map_t mSelectedListsMap; + typedef std::map<LLUUID, LLWearableItemsList*> wearables_lists_map_t; + typedef wearables_lists_map_t::value_type wearables_lists_map_value_t; + wearables_lists_map_t mSelectedListsMap; - typedef std::map<LLUUID, LLAccordionCtrlTab*> outfits_map_t; - typedef outfits_map_t::value_type outfits_map_value_t; - outfits_map_t mOutfitsMap; + typedef std::map<LLUUID, LLAccordionCtrlTab*> outfits_map_t; + typedef outfits_map_t::value_type outfits_map_value_t; + outfits_map_t mOutfitsMap; - // IDs of original items which are worn and linked in COF. - // Used to monitor COF changes for updating items worn state. See EXT-8636. - uuid_vec_t mCOFLinkedItems; + // IDs of original items which are worn and linked in COF. + // Used to monitor COF changes for updating items worn state. See EXT-8636. + uuid_vec_t mCOFLinkedItems; - //LLOutfitListGearMenu* mGearMenu; + //LLOutfitListGearMenu* mGearMenu; - //bool mIsInitialized; - /** - * True if there is a selection inside currently selected outfit - */ - bool mItemSelected; + //bool mIsInitialized; + /** + * True if there is a selection inside currently selected outfit + */ + bool mItemSelected; }; #endif //LL_LLOUTFITSLIST_H |