llfoldertype.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /**
  2. * @file llfoldertype.h
  3. * @brief Declaration of LLFolderType.
  4. *
  5. * $LicenseInfo:firstyear=2001&license=viewergpl$
  6. *
  7. * Copyright (c) 2010, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #ifndef LL_LLFOLDERTYPE_H
  33. #define LL_LLFOLDERTYPE_H
  34. #include <string>
  35. #include "llassettype.h"
  36. // This class handles folder types (similar to assettype, except for folders)
  37. // and operations on those.
  38. class LLFolderType
  39. {
  40. protected:
  41. LOG_CLASS(LLFolderType);
  42. public:
  43. // ! BACKWARDS COMPATIBILITY ! Folder type enums must match asset type enums.
  44. enum EType
  45. {
  46. FT_TEXTURE = 0,
  47. FT_SOUND = 1,
  48. FT_CALLINGCARD = 2,
  49. FT_LANDMARK = 3,
  50. FT_CLOTHING = 5,
  51. FT_OBJECT = 6,
  52. FT_NOTECARD = 7,
  53. FT_ROOT_INVENTORY = 8,
  54. // Bogus OpenSim root folder type... See:
  55. // http://opensimulator.org/pipermail/opensim-dev/2015-August/025876.html
  56. FT_ROOT_INVENTORY_OS = 9,
  57. FT_LSL_TEXT = 10,
  58. FT_BODYPART = 13,
  59. FT_TRASH = 14,
  60. FT_SNAPSHOT_CATEGORY = 15,
  61. FT_LOST_AND_FOUND = 16,
  62. FT_ANIMATION = 20,
  63. FT_GESTURE = 21,
  64. #if 0 // Viewer 2 folder: useless for v1 ! HB
  65. FT_FAVORITE = 23,
  66. #endif
  67. FT_CURRENT_OUTFIT = 46,
  68. // Viewer 2 folders: useless for v1; this value is yet needed for
  69. // the new version of AISAPI inventory fetches. HB
  70. FT_OUTFIT = 47,
  71. // In the Cool VL Viewer, we actually use this value as a way to
  72. // differenciate between the folder used for creating clothing items
  73. // and the one (configurable) to store outfits. It is used exclusively
  74. // via LLInventoryModel::findChoosenCategoryUUIDForType() for
  75. // LLAgentWearables::makeNewOutfit(). We do not use this value anywhere
  76. // else, even though some users may have a v2+-like inventory with a
  77. // "My Outfits" folder, which is just considered a normal (and
  78. // deletable) folder by the Cool VL Viewer. HB
  79. FT_MY_OUTFITS = 48,
  80. FT_MESH = 49,
  81. FT_INBOX = 50,
  82. #if 0
  83. // Deprecated in SL, never implemented in OpenSim.
  84. FT_OUTBOX = 51,
  85. // Viewer 2 folder: useless for v1 ! HB
  86. FT_BASIC_ROOT = 52,
  87. #endif
  88. FT_MARKETPLACE_LISTINGS = 53,
  89. FT_MARKETPLACE_STOCK = 54,
  90. // Note: We actually *never* create folders with that type. This is
  91. // used for icon override only.
  92. FT_MARKETPLACE_VERSION = 55,
  93. FT_SETTINGS = 56,
  94. FT_MATERIAL = 57,
  95. // OpenSim only. See:
  96. // http://opensimulator.org/pipermail/opensim-dev/2015-August/025876.html
  97. FT_SUITCASE = 100,
  98. FT_NONE = -1
  99. };
  100. static EType lookup(const std::string& type_name);
  101. static const std::string& lookup(EType folder_type);
  102. static bool lookupIsProtectedType(EType folder_type);
  103. static LLAssetType::EType folderTypeToAssetType(LLFolderType::EType ftype);
  104. static LLFolderType::EType assetTypeToFolderType(LLAssetType::EType atype);
  105. static const std::string& badLookup(); // error string when a lookup fails
  106. static void setCanDeleteCOF(bool allow) { sCanDeleteCOF = allow; }
  107. static bool getCanDeleteCOF() { return sCanDeleteCOF; }
  108. protected:
  109. // Needed (not deleted), even if never used, because LLViewerFolderType is
  110. // derived from us...
  111. LL_INLINE LLFolderType() {}
  112. LL_INLINE virtual ~LLFolderType() {}
  113. private:
  114. static bool sCanDeleteCOF;
  115. };
  116. #endif // LL_LLFOLDERTYPE_H