summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorypanel.h
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-06-15 09:44:27 -0700
committerRichard Linden <none@none>2012-06-15 09:44:27 -0700
commit9940ca5ae7698e89c0587733f7ab922027c8ddcc (patch)
treefbcff53be4b3bc7823dbe30df0446ebe8f872044 /indra/newview/llinventorypanel.h
parent8a2b6f7d2e56625c59c3e40d4a23942a91b824a1 (diff)
CHUI-101 WIP Make LLFolderView general purpose
llfolderview refactornig
Diffstat (limited to 'indra/newview/llinventorypanel.h')
-rw-r--r--indra/newview/llinventorypanel.h54
1 files changed, 49 insertions, 5 deletions
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 7d805f6862..787cacba43 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -30,6 +30,7 @@
#include "llassetstorage.h"
#include "lldarray.h"
+#include "llfolderviewitem.h"
#include "llfloater.h"
#include "llinventory.h"
#include "llinventoryfilter.h"
@@ -55,6 +56,18 @@ class LLFilterEditor;
class LLTabContainer;
class LLInvPanelComplObserver;
+class LLFolderViewModelInventory
+: public LLFolderViewModel<LLInventorySort, LLFolderViewModelItemInventory, LLFolderViewModelItemInventory, LLInventoryFilter>
+{
+ typedef LLFolderViewModel<LLInventorySort, LLFolderViewModelItemInventory, LLFolderViewModelItemInventory, LLInventoryFilter> base_t;
+
+ virtual ~LLFolderViewModelInventory() {}
+
+ void sort(LLFolderViewFolder* folder);
+ void requestSort(LLFolderViewFolder* folder);
+};
+
+
class LLInventoryPanel : public LLPanel
{
//--------------------------------------------------------------------
@@ -85,7 +98,6 @@ public:
Optional<std::string> start_folder;
Optional<bool> use_label_suffix;
Optional<bool> show_empty_message;
- Optional<bool> show_load_status;
Optional<LLScrollContainer::Params> scroll;
Optional<bool> accepts_drag_and_drop;
@@ -98,7 +110,6 @@ public:
start_folder("start_folder"),
use_label_suffix("use_label_suffix", true),
show_empty_message("show_empty_message", true),
- show_load_status("show_load_status"),
scroll("scroll"),
accepts_drag_and_drop("accepts_drag_and_drop")
{}
@@ -182,22 +193,35 @@ public:
static void openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id);
+ void addItemID(const LLUUID& id, LLFolderViewItem* itemp);
+ void removeItemID(const LLUUID& id);
+ LLFolderViewItem* getItemByID(const LLUUID& id);
+ LLFolderViewFolder* getFolderByID(const LLUUID& id);
+ void setSelectionByID(const LLUUID& obj_id, BOOL take_keyboard_focus);
+ void updateSelection();
+
+ LLFolderViewModelInventory* getViewModel() { return &mViewModel; }
+ const LLFolderViewModelInventory* getViewModel() const { return &mViewModel; }
+
protected:
void openStartFolderOrMyInventory(); // open the first level of inventory
void onItemsCompletion(); // called when selected items are complete
- LLInventoryModel* mInventory;
+ LLUUID mSelectThisID;
+ LLInventoryModel* mInventory;
LLInventoryObserver* mInventoryObserver;
LLInvPanelComplObserver* mCompletionObserver;
BOOL mAcceptsDragAndDrop;
BOOL mAllowMultiSelect;
BOOL mShowItemLinkOverlays; // Shows link graphic over inventory item icons
BOOL mShowEmptyMessage;
- BOOL mShowLoadStatus;
LLFolderView* mFolderRoot;
LLScrollContainer* mScroller;
+ LLFolderViewModelInventory mViewModel;
+
+ std::map<LLUUID, LLFolderViewItem*> mItemMap;
/**
* Pointer to LLInventoryFVBridgeBuilder.
*
@@ -218,7 +242,6 @@ public:
void setSortOrder(U32 order);
U32 getSortOrder() const;
- void requestSort();
private:
std::string mSortOrderSetting;
@@ -252,4 +275,25 @@ private:
LLUUID mStartFolderID;
};
+class LLFolderViewModelItemInventory
+ : public LLFolderViewModelItemCommon
+{
+public:
+ virtual const LLUUID& getUUID() const = 0;
+ virtual time_t getCreationDate() const = 0; // UTC seconds
+ virtual void setCreationDate(time_t creation_date_utc) = 0;
+ virtual PermissionMask getPermissionMask() const = 0;
+ virtual LLFolderType::EType getPreferredType() const = 0;
+ virtual void previewItem( void ) = 0;
+ virtual void showProperties(void) = 0;
+ virtual BOOL isItemInTrash( void) const { return FALSE; } // TODO: make into pure virtual.
+ virtual BOOL isUpToDate() const = 0;
+ virtual BOOL hasChildren() const = 0;
+ virtual LLInventoryType::EType getInventoryType() const = 0;
+ virtual void performAction(LLInventoryModel* model, std::string action) = 0;
+ virtual LLWearableType::EType getWearableType() const = 0;
+ virtual EInventorySortGroup getSortGroup() const;
+ virtual void requestSort(const LLInventorySort& sorter);
+};
+
#endif // LL_LLINVENTORYPANEL_H