/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. #ifndef LL_LLAGENTWEARABLESINITIALFETCH_H
  27. #define LL_LLAGENTWEARABLESINITIALFETCH_H
  28. #include "llinventoryobserver.h"
  29. #include "llwearabletype.h"
  30. #include "lluuid.h"
  31. //--------------------------------------------------------------------
  32. // InitialWearablesFetch
  33. //
  34. // This grabs contents from the COF and processes them.
  35. // The processing is handled in idle(), i.e. outside of done(),
  36. // to avoid gInventory.notifyObservers recursion.
  37. //--------------------------------------------------------------------
  38. class LLInitialWearablesFetch : public LLInventoryFetchDescendentsObserver
  39. {
  40. public:
  41. LLInitialWearablesFetch(const LLUUID& cof_id);
  42. ~LLInitialWearablesFetch();
  43. virtual void done();
  44. struct InitialWearableData
  45. {
  46. LLWearableType::EType mType;
  47. LLUUID mItemID;
  48. LLUUID mAssetID;
  49. InitialWearableData(LLWearableType::EType type, LLUUID& itemID, LLUUID& assetID) :
  50. mType(type),
  51. mItemID(itemID),
  52. mAssetID(assetID)
  53. {}
  54. };
  55. void add(InitialWearableData &data);
  56. protected:
  57. void processWearablesMessage();
  58. void processContents();
  59. private:
  60. typedef std::vector<InitialWearableData> initial_wearable_data_vec_t;
  61. initial_wearable_data_vec_t mAgentInitialWearables; // Wearables from the old agent wearables msg
  62. };
  63. //--------------------------------------------------------------------
  64. // InitialWearablesFetch
  65. //
  66. // This grabs outfits from the Library and copies those over to the user's
  67. // outfits folder, typically during first-ever login.
  68. //--------------------------------------------------------------------
  69. class LLLibraryOutfitsFetch : public LLInventoryFetchDescendentsObserver
  70. {
  71. public:
  72. enum ELibraryOutfitFetchStep
  73. {
  74. LOFS_FOLDER = 0,
  75. LOFS_OUTFITS,
  76. LOFS_LIBRARY,
  77. LOFS_IMPORTED,
  78. LOFS_CONTENTS
  79. };
  80. LLLibraryOutfitsFetch(const LLUUID& my_outfits_id);
  81. ~LLLibraryOutfitsFetch();
  82. virtual void done();
  83. void doneIdle();
  84. LLUUID mMyOutfitsID;
  85. void importedFolderFetch();
  86. protected:
  87. void folderDone();
  88. void outfitsDone();
  89. void libraryDone();
  90. void importedFolderDone();
  91. void contentsDone();
  92. enum ELibraryOutfitFetchStep mCurrFetchStep;
  93. uuid_vec_t mLibraryClothingFolders;
  94. uuid_vec_t mImportedClothingFolders;
  95. bool mOutfitsPopulated;
  96. LLUUID mClothingID;
  97. LLUUID mLibraryClothingID;
  98. LLUUID mImportedClothingID;
  99. std::string mImportedClothingName;
  100. };
  101. #endif // LL_AGENTWEARABLESINITIALFETCH_H