summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventoryfunctions.h')
-rw-r--r--indra/newview/llinventoryfunctions.h47
1 files changed, 45 insertions, 2 deletions
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index 56ad6f6496..ec5e53f9a6 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -81,13 +81,12 @@ void copy_inventory_category_content(const LLUUID& new_cat_uuid, LLInventoryMode
// Generates a string containing the path to the item specified by item_id.
void append_path(const LLUUID& id, std::string& path);
-typedef boost::function<void(std::string& validation_message, S32 depth, LLError::ELevel log_level)> validation_callback_t;
bool can_move_item_to_marketplace(const LLInventoryCategory* root_folder, LLInventoryCategory* dest_folder, LLInventoryItem* inv_item, std::string& tooltip_msg, S32 bundle_size = 1, bool from_paste = false);
bool can_move_folder_to_marketplace(const LLInventoryCategory* root_folder, LLInventoryCategory* dest_folder, LLInventoryCategory* inv_cat, std::string& tooltip_msg, S32 bundle_size = 1, bool check_items = true, bool from_paste = false);
bool move_item_to_marketplacelistings(LLInventoryItem* inv_item, LLUUID dest_folder, bool copy = false);
bool move_folder_to_marketplacelistings(LLInventoryCategory* inv_cat, const LLUUID& dest_folder, bool copy = false, bool move_no_copy_items = false);
-bool validate_marketplacelistings(LLInventoryCategory* inv_cat, validation_callback_t cb = NULL, bool fix_hierarchy = true, S32 depth = -1, bool notify_observers = true);
+
S32 depth_nesting_in_marketplace(LLUUID cur_uuid);
LLUUID nested_parent_id(LLUUID cur_uuid, S32 depth);
S32 compute_stock_count(LLUUID cat_uuid, bool force_count = false);
@@ -102,6 +101,50 @@ bool is_only_items_selected(const uuid_vec_t& selected_uuids);
** **
*******************************************************************************/
+class LLMarketplaceValidator: public LLSingleton<LLMarketplaceValidator>
+{
+ LLSINGLETON(LLMarketplaceValidator);
+ ~LLMarketplaceValidator();
+ LOG_CLASS(LLMarketplaceValidator);
+public:
+
+ typedef boost::function<void(std::string& validation_message, S32 depth, LLError::ELevel log_level)> validation_msg_callback_t;
+ typedef boost::function<void(bool result)> validation_done_callback_t;
+
+ void validateMarketplaceListings(
+ const LLUUID &category_id,
+ validation_done_callback_t cb_done = NULL,
+ validation_msg_callback_t cb_msg = NULL,
+ bool fix_hierarchy = true,
+ S32 depth = -1);
+
+private:
+ void start();
+
+ class ValidationRequest
+ {
+ public:
+ ValidationRequest(
+ LLUUID category_id,
+ validation_done_callback_t cb_done,
+ validation_msg_callback_t cb_msg,
+ bool fix_hierarchy,
+ S32 depth);
+ LLUUID mCategoryId;
+ validation_done_callback_t mCbDone;
+ validation_msg_callback_t mCbMsg;
+ bool mFixHierarchy;
+ S32 mDepth;
+ };
+
+ bool mValidationInProgress;
+ S32 mPendingCallbacks;
+ bool mPendingResult;
+ // todo: might be a good idea to memorize requests by id and
+ // filter out ones that got multiple validation requests
+ std::queue<ValidationRequest> mValidationQueue;
+};
+
/********************************************************************************
** **
** INVENTORY COLLECTOR FUNCTIONS