diff options
Diffstat (limited to 'indra/newview/llinventorypanel.h')
-rw-r--r-- | indra/newview/llinventorypanel.h | 88 |
1 files changed, 76 insertions, 12 deletions
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 2c782a5ea7..341be0cf86 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); @@ -241,10 +246,10 @@ public: static void openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, - BOOL main_panel = FALSE, + BOOL use_main_panel = FALSE, BOOL take_keyboard_focus = TAKE_FOCUS_YES, 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,55 @@ private: std::deque<LLUUID> mBuildViewsQueue; }; + +class LLInventorySingleFolderPanel : public LLInventoryPanel +{ +public: + struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params> + {}; + + void initFromParams(const Params& p); + 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 */ @@ -400,7 +464,7 @@ public: void initFromParams(const Params& p); protected: - LLAssetFilteredInventoryPanel(const Params& p) : LLInventoryPanel(p) {} + LLAssetFilteredInventoryPanel(const Params& p); friend class LLUICtrlFactory; public: ~LLAssetFilteredInventoryPanel() {} |