PageRenderTime 40ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/llcommon/llassettype.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 159 lines | 53 code | 36 blank | 70 comment | 0 complexity | d0d96a4af0c33b4e0b8984584b34fbc6 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llassettype.h
  3. * @brief Declaration of LLAssetType.
  4. *
  5. * $LicenseInfo:firstyear=2001&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_LLASSETTYPE_H
  27. #define LL_LLASSETTYPE_H
  28. #include <string>
  29. #include "stdenums.h" // for EDragAndDropType
  30. class LL_COMMON_API LLAssetType
  31. {
  32. public:
  33. enum EType
  34. {
  35. AT_TEXTURE = 0,
  36. // Used for painting the faces of geometry.
  37. // Stored in typical j2c stream format.
  38. AT_SOUND = 1,
  39. // Used to fill the aural spectrum.
  40. AT_CALLINGCARD = 2,
  41. // Links instant message access to the user on the card.
  42. // : E.G. A card for yourself, for linden support, for
  43. // : the guy you were talking to in the coliseum.
  44. AT_LANDMARK = 3,
  45. // Links to places in the world with location and a screen shot or image saved.
  46. // : E.G. Home, linden headquarters, the coliseum, destinations where
  47. // : we want to increase traffic.
  48. AT_SCRIPT = 4,
  49. // Valid scripts that can be attached to an object.
  50. // : E.G. Open a door, jump into the air.
  51. AT_CLOTHING = 5,
  52. // A collection of textures and parameters that can be worn by an avatar.
  53. AT_OBJECT = 6,
  54. // Any combination of textures, sounds, and scripts that are
  55. // associated with a fixed piece of geometry.
  56. // : E.G. A hot tub, a house with working door.
  57. AT_NOTECARD = 7,
  58. // Just text.
  59. AT_CATEGORY = 8,
  60. // Holds a collection of inventory items.
  61. // It's treated as an item in the inventory and therefore needs a type.
  62. AT_LSL_TEXT = 10,
  63. AT_LSL_BYTECODE = 11,
  64. // The LSL is the scripting language.
  65. // We've split it into a text and bytecode representation.
  66. AT_TEXTURE_TGA = 12,
  67. // Uncompressed TGA texture.
  68. AT_BODYPART = 13,
  69. // A collection of textures and parameters that can be worn by an avatar.
  70. AT_SOUND_WAV = 17,
  71. // Uncompressed sound.
  72. AT_IMAGE_TGA = 18,
  73. // Uncompressed image, non-square.
  74. // Not appropriate for use as a texture.
  75. AT_IMAGE_JPEG = 19,
  76. // Compressed image, non-square.
  77. // Not appropriate for use as a texture.
  78. AT_ANIMATION = 20,
  79. // Animation.
  80. AT_GESTURE = 21,
  81. // Gesture, sequence of animations, sounds, chat, wait steps.
  82. AT_SIMSTATE = 22,
  83. // Simstate file.
  84. AT_LINK = 24,
  85. // Inventory symbolic link
  86. AT_LINK_FOLDER = 25,
  87. // Inventory folder link
  88. AT_WIDGET = 40,
  89. // UI Widget: this is *not* an inventory asset type, only a viewer side asset (e.g. button, other ui items...)
  90. AT_MESH = 49,
  91. // Mesh data in our proprietary SLM format
  92. AT_COUNT = 50,
  93. // +*********************************************************+
  94. // | TO ADD AN ELEMENT TO THIS ENUM: |
  95. // +*********************************************************+
  96. // | 1. INSERT BEFORE AT_COUNT |
  97. // | 2. INCREMENT AT_COUNT BY 1 |
  98. // | 3. ADD TO LLAssetType.cpp |
  99. // | 4. ADD TO LLViewerAssetType.cpp |
  100. // | 5. ADD TO DEFAULT_ASSET_FOR_INV in LLInventoryType.cpp |
  101. // +*********************************************************+
  102. AT_NONE = -1
  103. };
  104. // machine transation between type and strings
  105. static EType lookup(const char* name); // safe conversion to std::string, *TODO: deprecate
  106. static EType lookup(const std::string& type_name);
  107. static const char* lookup(EType asset_type);
  108. // translation from a type to a human readable form.
  109. static EType lookupHumanReadable(const char* desc_name); // safe conversion to std::string, *TODO: deprecate
  110. static EType lookupHumanReadable(const std::string& readable_name);
  111. static const char* lookupHumanReadable(EType asset_type);
  112. static EType getType(const std::string& desc_name);
  113. static const std::string& getDesc(EType asset_type);
  114. static bool lookupCanLink(EType asset_type);
  115. static bool lookupIsLinkType(EType asset_type);
  116. static bool lookupIsAssetFetchByIDAllowed(EType asset_type); // the asset allows direct download
  117. static bool lookupIsAssetIDKnowable(EType asset_type); // asset data can be known by the viewer
  118. static const std::string& badLookup(); // error string when a lookup fails
  119. protected:
  120. LLAssetType() {}
  121. ~LLAssetType() {}
  122. };
  123. #endif // LL_LLASSETTYPE_H