summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorypanel.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventorypanel.h')
-rw-r--r--indra/newview/llinventorypanel.h103
1 files changed, 85 insertions, 18 deletions
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 2c782a5ea7..97300596f9 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -107,6 +107,7 @@ public:
Optional<LLFolderView::Params> folder_view;
Optional<LLFolderViewFolder::Params> folder;
Optional<LLFolderViewItem::Params> item;
+ Optional<bool> open_first_folder;
// All item and folder views will be initialized on init if true (default)
// Will initialize on visibility change otherwise.
@@ -126,6 +127,7 @@ public:
show_root_folder("show_root_folder", false),
allow_drop_on_root("allow_drop_on_root", true),
use_marketplace_folders("use_marketplace_folders", false),
+ open_first_folder("open_first_folder", true),
scroll("scroll"),
accepts_drag_and_drop("accepts_drag_and_drop"),
folder_view("folder_view"),
@@ -159,22 +161,23 @@ public:
LLFolderViewModelInventory& getRootViewModel() { return mInventoryViewModel; }
// LLView methods
- /*virtual*/ void onVisibilityChange(BOOL new_visibility);
- void draw();
- /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask );
- BOOL handleHover(S32 x, S32 y, MASK mask);
+ /*virtual*/ void onVisibilityChange(BOOL new_visibility) override;
+ void draw() override;
+ /*virtual*/ BOOL handleKeyHere( KEY key, MASK mask ) override;
+ BOOL handleHover(S32 x, S32 y, MASK mask) override;
/*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
- std::string& tooltip_msg);
+ std::string& tooltip_msg) override;
+ BOOL handleToolTip(S32 x, S32 y, MASK mask) override;
// LLUICtrl methods
- /*virtual*/ void onFocusLost();
- /*virtual*/ void onFocusReceived();
+ /*virtual*/ void onFocusLost() override;
+ /*virtual*/ void onFocusReceived() override;
void onFolderOpening(const LLUUID &id);
// LLBadgeHolder methods
- bool addBadge(LLBadge * badge);
+ bool addBadge(LLBadge * badge) override;
// Call this method to set the selection.
void openAllFolders();
@@ -211,6 +214,7 @@ public:
LLUUID getRootFolderID();
LLScrollContainer* getScrollableContainer() { return mScroller; }
bool getAllowDropOnRoot() { return mParams.allow_drop_on_root; }
+ bool areViewsInitialized() { return mViewsInitialized == VIEWS_INITIALIZED && mFolderRoot.get() && !mFolderRoot.get()->needsArrange(); }
void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action);
@@ -221,6 +225,7 @@ public:
void doCreate(const LLSD& userdata);
bool beginIMSession();
void fileUploadLocation(const LLSD& userdata);
+ void openSingleViewInventory(LLUUID folder_id = LLUUID());
void purgeSelectedItems();
bool attachObject(const LLSD& userdata);
static void idle(void* user_data);
@@ -239,12 +244,12 @@ public:
// "Auto_open" determines if we open an inventory panel if none are open.
static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE);
- static void openInventoryPanelAndSetSelection(BOOL auto_open,
+ static void openInventoryPanelAndSetSelection(bool auto_open,
const LLUUID& obj_id,
- BOOL main_panel = FALSE,
- BOOL take_keyboard_focus = TAKE_FOCUS_YES,
- BOOL reset_filter = FALSE);
-
+ bool use_main_panel = false,
+ bool take_keyboard_focus = true,
+ bool reset_filter = false);
+ static void setSFViewAndOpenFolder(const LLInventoryPanel* panel, const LLUUID& folder_id);
void addItemID(const LLUUID& id, LLFolderViewItem* itemp);
void removeItemID(const LLUUID& id);
LLFolderViewItem* getItemByID(const LLUUID& id);
@@ -262,6 +267,10 @@ public:
static void callbackPurgeSelectedItems(const LLSD& notification, const LLSD& response, const std::vector<LLUUID> inventory_selected);
+ void changeFolderRoot(const LLUUID& new_id) {};
+ void initFolderRoot();
+ void initializeViewBuilding();
+
protected:
void openStartFolderOrMyInventory(); // open the first level of inventory
void onItemsCompletion(); // called when selected items are complete
@@ -298,6 +307,9 @@ protected:
*/
const LLInventoryFolderViewModelBuilder* mInvFVBridgeBuilder;
+ bool mBuildChildrenViews; // build root and children
+ bool mRootInited;
+
//--------------------------------------------------------------------
// Sorting
@@ -357,6 +369,8 @@ protected:
virtual LLFolderView * createFolderRoot(LLUUID root_id );
virtual LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge, bool allow_drop);
virtual LLFolderViewItem* createFolderViewItem(LLInvFVBridge * bridge);
+
+ boost::function<void(const std::deque<LLFolderViewItem*>& items, BOOL user_action)> mSelectionCallback;
private:
// buildViewsTree does not include some checks and is meant
// for recursive use, use buildNewViews() for first call
@@ -365,7 +379,8 @@ private:
LLInventoryObject const* objectp,
LLFolderViewItem *target_view,
LLFolderViewFolder *parent_folder_view,
- const EBuildModes &mode);
+ const EBuildModes &mode,
+ S32 depth = -1);
typedef enum e_views_initialization_state
{
@@ -381,6 +396,57 @@ private:
std::deque<LLUUID> mBuildViewsQueue;
};
+
+class LLInventorySingleFolderPanel : public LLInventoryPanel
+{
+public:
+ struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params>
+ {};
+
+ void initFromParams(const Params& p);
+ void onFocusReceived() override;
+
+ bool isSelectionRemovable() { return false; }
+
+ void initFolderRoot(const LLUUID& start_folder_id = LLUUID::null);
+
+ void changeFolderRoot(const LLUUID& new_id);
+ void onForwardFolder();
+ void onBackwardFolder();
+ void clearNavigationHistory();
+ LLUUID getSingleFolderRoot() { return mFolderID; }
+
+ void doCreate(const LLSD& userdata);
+ void doToSelected(const LLSD& userdata);
+ void doShare();
+
+ bool isBackwardAvailable();
+ bool isForwardAvailable();
+
+ bool hasVisibleItems();
+
+ void setNavBackwardList(std::list<LLUUID> backward_list) { mBackwardFolders = backward_list; }
+ void setNavForwardList(std::list<LLUUID> forward_list) { mForwardFolders = forward_list; }
+ std::list<LLUUID> getNavBackwardList() { return mBackwardFolders; }
+ std::list<LLUUID> getNavForwardList() { return mForwardFolders; }
+
+ typedef boost::function<void()> root_changed_callback_t;
+ boost::signals2::connection setRootChangedCallback(root_changed_callback_t cb);
+
+protected:
+ LLInventorySingleFolderPanel(const Params& params);
+ ~LLInventorySingleFolderPanel();
+ void updateSingleFolderRoot();
+
+ friend class LLUICtrlFactory;
+
+ LLUUID mFolderID;
+ std::list<LLUUID> mBackwardFolders;
+ std::list<LLUUID> mForwardFolders;
+
+ boost::signals2::signal<void()> mRootChangedSignal;
+};
+
/************************************************************************/
/* Asset Pre-Filtered Inventory Panel related class */
/* Exchanges filter's flexibility for speed of generation and */
@@ -393,14 +459,14 @@ public:
struct Params
: public LLInitParam::Block<Params, LLInventoryPanel::Params>
{
- Mandatory<std::string> filter_asset_type;
+ Mandatory<std::string> filter_asset_types;
- Params() : filter_asset_type("filter_asset_type") {}
+ Params() : filter_asset_types("filter_asset_types") {}
};
void initFromParams(const Params& p);
protected:
- LLAssetFilteredInventoryPanel(const Params& p) : LLInventoryPanel(p) {}
+ LLAssetFilteredInventoryPanel(const Params& p);
friend class LLUICtrlFactory;
public:
~LLAssetFilteredInventoryPanel() {}
@@ -416,7 +482,8 @@ protected:
/*virtual*/ void itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item) override;
private:
- LLAssetType::EType mAssetType;
+ bool mAssetTypes[LLAssetType::AT_COUNT];
+ bool mDragTypes[EDragAndDropType::DAD_COUNT];
};
#endif // LL_LLINVENTORYPANEL_H