summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventorybridge.h')
-rw-r--r--indra/newview/llinventorybridge.h105
1 files changed, 69 insertions, 36 deletions
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 6ddd77284a..f7a06477a3 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -2,25 +2,31 @@
* @file llinventorybridge.h
* @brief Implementation of the Inventory-Folder-View-Bridge classes.
*
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
+ * $LicenseInfo:firstyear=2001&license=viewergpl$
+ *
+ * Copyright (c) 2001-2009, 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.
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
- * 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.
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
- * 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
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
*
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
@@ -41,6 +47,7 @@ class LLMenuGL;
class LLCallingCardObserver;
class LLViewerJointAttachment;
+
typedef std::vector<std::string> menuentry_vec_t;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -68,6 +75,7 @@ public:
U32 flags = 0x00);
virtual ~LLInvFVBridge() {}
+ BOOL isInOutfitsSidePanel() const; // allow context menus to be customized for side panel
BOOL canShare() const;
//--------------------------------------------------------------------
@@ -116,7 +124,6 @@ public:
EDragAndDropType cargo_type,
void* cargo_data) { return FALSE; }
virtual LLInventoryType::EType getInventoryType() const { return mInvType; }
- virtual LLWearableType::EType getWearableType() const { return LLWearableType::WT_NONE; }
//--------------------------------------------------------------------
// Convenience functions for adding various common menu options.
@@ -176,6 +183,7 @@ public:
U32 flags = 0x00) const;
};
+ MESH_ICON_NAME,
class LLItemBridge : public LLInvFVBridge
{
public:
@@ -224,8 +232,8 @@ public:
const LLUUID& uuid) :
LLInvFVBridge(inventory, root, uuid),
mCallingCards(FALSE),
- mWearables(FALSE)
- {}
+ mWearables(FALSE),
+ mMenu(NULL) {}
BOOL dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop);
BOOL dragCategoryIntoFolder(LLInventoryCategory* inv_category, BOOL drop);
@@ -239,7 +247,7 @@ public:
virtual LLFolderType::EType getPreferredType() const;
virtual LLUIImagePtr getIcon() const;
virtual LLUIImagePtr getOpenIcon() const;
- static LLUIImagePtr getIcon(LLFolderType::EType preferred_type);
+ static LLUIImagePtr getIcon(LLFolderType::EType preferred_type, BOOL is_link = FALSE);
virtual BOOL renameItem(const std::string& new_name);
@@ -266,7 +274,6 @@ public:
static void createWearable(LLFolderBridge* bridge, LLWearableType::EType type);
LLViewerInventoryCategory* getCategory() const;
- LLHandle<LLFolderBridge> getHandle() { mHandle.bind(this); return mHandle; }
protected:
//--------------------------------------------------------------------
@@ -289,6 +296,7 @@ protected:
static void createNewEyes(void* user_data);
BOOL checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& typeToCheck);
+ BOOL areAnyContentsWorn(LLInventoryModel* model) const;
void modifyOutfit(BOOL append);
void determineFolderType();
@@ -300,17 +308,16 @@ protected:
// Messy hacks for handling folder options
//--------------------------------------------------------------------
public:
- static LLHandle<LLFolderBridge> sSelf;
+ static LLFolderBridge* sSelf;
static void staticFolderOptionsMenu();
void folderOptionsMenu();
private:
- BOOL mCallingCards;
- BOOL mWearables;
- LLHandle<LLView> mMenu;
- menuentry_vec_t mItems;
- menuentry_vec_t mDisabledItems;
- LLRootHandle<LLFolderBridge> mHandle;
+ BOOL mCallingCards;
+ BOOL mWearables;
+ LLMenuGL* mMenu;
+ menuentry_vec_t mItems;
+ menuentry_vec_t mDisabledItems;
};
class LLTextureBridge : public LLItemBridge
@@ -466,7 +473,6 @@ public:
virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
virtual std::string getLabelSuffix() const;
virtual BOOL renameItem(const std::string& new_name);
- virtual LLWearableType::EType getWearableType() const { return mWearableType; }
static void onWearOnAvatar( void* userdata ); // Access to wearOnAvatar() from menu
static BOOL canWearOnAvatar( void* userdata );
@@ -521,6 +527,27 @@ protected:
static std::string sPrefix;
};
+
+
+class LLMeshBridge : public LLItemBridge
+{
+ friend class LLInvFVBridge;
+public:
+ virtual LLUIImagePtr getIcon() const;
+ virtual void openItem();
+ virtual void previewItem();
+ virtual void buildContextMenu(LLMenuGL& menu, U32 flags);
+
+protected:
+ LLMeshBridge(LLInventoryPanel* inventory,
+ LLFolderView* root,
+ const LLUUID& uuid) :
+ LLItemBridge(inventory, root, uuid) {}
+};
+
+
+
+
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLInvFVBridgeAction
//
@@ -551,13 +578,23 @@ protected:
LLInventoryModel* mModel;
};
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// Recent Inventory Panel related classes
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+class LLMeshBridgeAction: public LLInvFVBridgeAction
+{
+ friend class LLInvFVBridgeAction;
+public:
+ virtual void doIt() ;
+ virtual ~LLMeshBridgeAction(){}
+protected:
+ LLMeshBridgeAction(const LLUUID& id,LLInventoryModel* model):LLInvFVBridgeAction(id,model){}
+
+};
+
+
// Overridden version of the Inventory-Folder-View-Bridge for Folders
class LLRecentItemsFolderBridge : public LLFolderBridge
{
+ friend class LLInvFVBridgeAction;
public:
// Creates context menu for Folders related to Recent Inventory Panel.
// Uses base logic and than removes from visible items "New..." menu items.
@@ -599,12 +636,8 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id,
void* user_data = NULL);
// Utility function to hide all entries except those in the list
-// Can be called multiple times on the same menu (e.g. if multiple items
-// are selected). If "append" is false, then only common enabled items
-// are set as enabled.
void hide_context_entries(LLMenuGL& menu,
const menuentry_vec_t &entries_to_show,
- const menuentry_vec_t &disabled_entries,
- BOOL append = FALSE);
+ const menuentry_vec_t &disabled_entries);
#endif // LL_LLINVENTORYBRIDGE_H