PageRenderTime 25ms CodeModel.GetById 8ms app.highlight 5ms RepoModel.GetById 10ms app.codeStats 1ms

/indra/newview/llagentwearablesfetch.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 112 lines | 63 code | 11 blank | 38 comment | 0 complexity | dea2fb2675dd0139046367969b6a08a1 MD5 | raw file
  1/** 
  2 * @file llagentwearablesinitialfetch.h
  3 * @brief LLAgentWearablesInitialFetch class header file
  4 *
  5 * $LicenseInfo:firstyear=2000&license=viewerlgpl$
  6 * Second Life Viewer Source Code
  7 * Copyright (C) 2010, Linden Research, Inc.
  8 * 
  9 * This library is free software; you can redistribute it and/or
 10 * modify it under the terms of the GNU Lesser General Public
 11 * License as published by the Free Software Foundation;
 12 * version 2.1 of the License only.
 13 * 
 14 * This library is distributed in the hope that it will be useful,
 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 17 * Lesser General Public License for more details.
 18 * 
 19 * You should have received a copy of the GNU Lesser General Public
 20 * License along with this library; if not, write to the Free Software
 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 22 * 
 23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
 24 * $/LicenseInfo$
 25 */
 26
 27#ifndef LL_LLAGENTWEARABLESINITIALFETCH_H
 28#define LL_LLAGENTWEARABLESINITIALFETCH_H
 29
 30#include "llinventoryobserver.h"
 31#include "llwearabletype.h"
 32#include "lluuid.h"
 33
 34//--------------------------------------------------------------------
 35// InitialWearablesFetch
 36// 
 37// This grabs contents from the COF and processes them.
 38// The processing is handled in idle(), i.e. outside of done(),
 39// to avoid gInventory.notifyObservers recursion.
 40//--------------------------------------------------------------------
 41class LLInitialWearablesFetch : public LLInventoryFetchDescendentsObserver
 42{
 43public:
 44	LLInitialWearablesFetch(const LLUUID& cof_id);
 45	~LLInitialWearablesFetch();
 46	virtual void done();
 47
 48	struct InitialWearableData
 49	{
 50		LLWearableType::EType mType;
 51		LLUUID mItemID;
 52		LLUUID mAssetID;
 53		InitialWearableData(LLWearableType::EType type, LLUUID& itemID, LLUUID& assetID) :
 54			mType(type),
 55			mItemID(itemID),
 56			mAssetID(assetID)
 57		{}
 58	};
 59
 60	void add(InitialWearableData &data);
 61
 62protected:
 63	void processWearablesMessage();
 64	void processContents();
 65
 66private:
 67	typedef std::vector<InitialWearableData> initial_wearable_data_vec_t;
 68	initial_wearable_data_vec_t mAgentInitialWearables; // Wearables from the old agent wearables msg
 69};
 70
 71//--------------------------------------------------------------------
 72// InitialWearablesFetch
 73// 
 74// This grabs outfits from the Library and copies those over to the user's
 75// outfits folder, typically during first-ever login.
 76//--------------------------------------------------------------------
 77class LLLibraryOutfitsFetch : public LLInventoryFetchDescendentsObserver
 78{
 79public:
 80	enum ELibraryOutfitFetchStep
 81	{
 82		LOFS_FOLDER = 0,
 83		LOFS_OUTFITS,
 84		LOFS_LIBRARY,
 85		LOFS_IMPORTED,
 86		LOFS_CONTENTS
 87	};
 88
 89	LLLibraryOutfitsFetch(const LLUUID& my_outfits_id);
 90	~LLLibraryOutfitsFetch();
 91
 92	virtual void done();
 93	void doneIdle();
 94	LLUUID mMyOutfitsID;
 95	void importedFolderFetch();
 96protected:
 97	void folderDone();
 98	void outfitsDone();
 99	void libraryDone();
100	void importedFolderDone();
101	void contentsDone();
102	enum ELibraryOutfitFetchStep mCurrFetchStep;
103	uuid_vec_t mLibraryClothingFolders;
104	uuid_vec_t mImportedClothingFolders;
105	bool mOutfitsPopulated;
106	LLUUID mClothingID;
107	LLUUID mLibraryClothingID;
108	LLUUID mImportedClothingID;
109	std::string mImportedClothingName;
110};
111
112#endif // LL_AGENTWEARABLESINITIALFETCH_H