summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryobserver.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventoryobserver.h')
-rw-r--r--indra/newview/llinventoryobserver.h69
1 files changed, 41 insertions, 28 deletions
diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h
index 420afdfadc..7480b7e7af 100644
--- a/indra/newview/llinventoryobserver.h
+++ b/indra/newview/llinventoryobserver.h
@@ -73,57 +73,70 @@ public:
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// Class LLInventoryFetchItemsObserver
+// Class LLInventoryFetchObserver
//
-// Fetches inventory items, calls done() when all inventory has arrived.
+// Abstract class to handle fetching items, folders, etc.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-class LLInventoryFetchItemsObserver : public LLInventoryObserver
+class LLInventoryFetchObserver : public LLInventoryObserver
{
public:
- LLInventoryFetchItemsObserver(bool retry_if_missing = false); // deprecated
- LLInventoryFetchItemsObserver(const LLUUID& item_id, bool retry_if_missing = false); // single item
- LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids, bool retry_if_missing = false); // multiple items
- virtual void changed(U32 mask);
+ LLInventoryFetchObserver(const LLUUID& id = LLUUID::null); // single item
+ LLInventoryFetchObserver(const uuid_vec_t& ids); // multiple items
+ void setFetchID(const LLUUID& id);
+ void setFetchIDs(const uuid_vec_t& ids);
- bool isEverythingComplete() const;
- void setItems(const uuid_vec_t& ids) { mIDs = ids; }
- void startFetch();
+ BOOL isFinished() const;
- virtual void done() {};
+ virtual void startFetch() = 0;
+ virtual void done() = 0;
+ virtual void changed(U32 mask) = 0;
protected:
- bool mRetryIfMissing;
uuid_vec_t mComplete;
uuid_vec_t mIncomplete;
uuid_vec_t mIDs;
};
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// Class LLInventoryFetchItemsObserver
+//
+// Fetches inventory items, calls done() when all inventory has arrived.
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+class LLInventoryFetchItemsObserver : public LLInventoryFetchObserver
+{
+public:
+ // LLInventoryFetchItemsObserver(BOOL retry_if_missing = FALSE);
+ LLInventoryFetchItemsObserver(const LLUUID& item_id = LLUUID::null,
+ BOOL retry_if_missing = FALSE);
+ LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids,
+ BOOL retry_if_missing = FALSE);
+
+ /*virtual*/ void startFetch();
+ /*virtual*/ void changed(U32 mask);
+ /*virtual*/ void done();
+
+protected:
+ BOOL mRetryIfMissing;
+};
+
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLInventoryFetchDescendentsObserver
//
// Fetches children of a category/folder, calls done() when all
// inventory has arrived.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-class LLInventoryFetchDescendentsObserver : public LLInventoryObserver
+class LLInventoryFetchDescendentsObserver : public LLInventoryFetchObserver
{
public:
- LLInventoryFetchDescendentsObserver();
- LLInventoryFetchDescendentsObserver(const LLUUID& cat_id);
+ // LLInventoryFetchDescendentsObserver();
+ LLInventoryFetchDescendentsObserver(const LLUUID& cat_id = LLUUID::null);
LLInventoryFetchDescendentsObserver(const uuid_vec_t& cat_ids);
- virtual void changed(U32 mask);
-
- void setFolders(const uuid_vec_t& cat_ids) { mIDs = cat_ids; }
- void setFolders(const LLUUID& cat_id) { mIDs.clear(); mIDs.push_back(cat_id); }
- void startFetch();
- bool isEverythingComplete() const;
- virtual void done() = 0;
+ /*virtual*/ void startFetch();
+ /*virtual*/ void changed(U32 mask);
protected:
- bool isComplete(LLViewerInventoryCategory* cat);
- uuid_vec_t mIncomplete;
- uuid_vec_t mComplete;
- uuid_vec_t mIDs;
+ BOOL isCategoryComplete(const LLViewerInventoryCategory* cat) const;
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -137,7 +150,7 @@ protected:
class LLInventoryFetchComboObserver : public LLInventoryObserver
{
public:
- LLInventoryFetchComboObserver() : mDone(false) {}
+ LLInventoryFetchComboObserver() : mDone(FALSE) {}
virtual void changed(U32 mask);
void startFetch(const uuid_vec_t& folder_ids, const uuid_vec_t& item_ids);