diff options
Diffstat (limited to 'indra/newview/llinventoryfunctions.h')
-rw-r--r-- | indra/newview/llinventoryfunctions.h | 56 |
1 files changed, 48 insertions, 8 deletions
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 93c56e1b8a..4a7721098d 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -46,6 +46,9 @@ // Is this item or its baseitem is worn, attached, etc... BOOL get_is_item_worn(const LLUUID& id); +// Could this item be worn (correct type + not already being worn) +BOOL get_can_item_be_worn(const LLUUID& id); + BOOL get_is_item_removable(const LLInventoryModel* model, const LLUUID& id); BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id); @@ -53,6 +56,7 @@ BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id); BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id); void show_item_profile(const LLUUID& item_uuid); +void show_task_item_profile(const LLUUID& item_uuid, const LLUUID& object_id); void show_item_original(const LLUUID& item_uuid); @@ -170,6 +174,25 @@ protected: LLAssetType::EType mType; }; +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLIsOfAssetType +// +// Implementation of a LLInventoryCollectFunctor which returns TRUE if +// the item or category is of asset type passed in during construction. +// Link types are treated as links, not as the types they point to. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLIsOfAssetType : public LLInventoryCollectFunctor +{ +public: + LLIsOfAssetType(LLAssetType::EType type) : mType(type) {} + virtual ~LLIsOfAssetType() {} + virtual bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item); +protected: + LLAssetType::EType mType; +}; + class LLIsTypeWithPermissions : public LLInventoryCollectFunctor { public: @@ -267,9 +290,7 @@ public: }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLFindNonLinksByMask -// -// +// Class LLFindByMask //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class LLFindByMask : public LLInventoryCollectFunctor { @@ -337,6 +358,21 @@ public: LLInventoryItem* item); }; +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLFindWearablesEx +// +// Collects wearables based on given criteria. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLFindWearablesEx : public LLInventoryCollectFunctor +{ +public: + LLFindWearablesEx(bool is_worn, bool include_body_parts = true); + virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); +private: + bool mIncludeBodyParts; + bool mIsWorn; +}; + //Inventory collect functor collecting wearables of a specific wearable type class LLFindWearablesOfType : public LLInventoryCollectFunctor { @@ -363,13 +399,17 @@ public: } }; -// Find worn items. -class LLFindWorn : public LLInventoryCollectFunctor +/* Filters out items of a particular asset type */ +class LLIsTypeActual : public LLIsType { public: - LLFindWorn() {} - virtual ~LLFindWorn() {} - virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item); + LLIsTypeActual(LLAssetType::EType type) : LLIsType(type) {} + virtual ~LLIsTypeActual() {} + virtual bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) + { + if (item && item->getIsLinkType()) return false; + return LLIsType::operator()(cat, item); + } }; // Collect non-removable folders and items. |