00001 00032 #ifndef LL_LLASSETTYPE 00033 #define LL_LLASSETTYPE 00034 00035 #include <string> 00036 00037 #include "stdenums.h" // for EDragAndDropType 00038 00039 class LLAssetType 00040 { 00041 public: 00042 enum EType 00043 { 00044 // Used for painting the faces of geometry. 00045 // Stored in typical j2c stream format 00046 AT_TEXTURE = 0, 00047 00048 // Used to fill the aural spectrum. 00049 AT_SOUND = 1, 00050 00051 // Links instant message access to the user on the card. eg, a 00052 // card for yourself, a card for linden support, a card for 00053 // the guy you were talking to in the coliseum. 00054 AT_CALLINGCARD = 2, 00055 00056 // Links to places in the world with location and a screen 00057 // shot or image saved. eg, home, linden headquarters, the 00058 // coliseum, or destinations where we want to increase 00059 // traffic. 00060 AT_LANDMARK = 3, 00061 00062 // Valid scripts that can be attached to an object. eg. open a 00063 // door, jump into the air. 00064 AT_SCRIPT = 4, 00065 00066 // A collection of textures and parameters that can be worn 00067 // by an avatar. 00068 AT_CLOTHING = 5, 00069 00070 // Any combination of textures, sounds, and scripts that are 00071 // associated with a fixed piece of geometry. eg, a hot tub, a 00072 // house with working door. 00073 AT_OBJECT = 6, 00074 00075 // Just text 00076 AT_NOTECARD = 7, 00077 00078 // A category holds a collection of inventory items. It's 00079 // treated as an item in the inventory, and therefore needs a 00080 // type. 00081 AT_CATEGORY = 8, 00082 00083 // A root category is a user's root inventory category. We 00084 // decided to expose it visually, so it seems logical to fold 00085 // it into the asset types. 00086 AT_ROOT_CATEGORY = 9, 00087 00088 // The LSL is the brand spanking new scripting language. We've 00089 // split it into a text and bytecode representation. 00090 AT_LSL_TEXT = 10, 00091 AT_LSL_BYTECODE = 11, 00092 00093 // uncompressed TGA texture 00094 AT_TEXTURE_TGA = 12, 00095 00096 // A collection of textures and parameters that can be worn 00097 // by an avatar. 00098 AT_BODYPART = 13, 00099 00100 // This asset type is meant to only be used as a marker for a 00101 // category preferred type. Using this, we can throw things in 00102 // the trash before completely deleting. 00103 AT_TRASH = 14, 00104 00105 // This is a marker for a folder meant for snapshots. No 00106 // actual assets will be snapshots, though if there were, you 00107 // could interpret them as textures. 00108 AT_SNAPSHOT_CATEGORY = 15, 00109 00110 // This is used to stuff lost&found items into 00111 AT_LOST_AND_FOUND = 16, 00112 00113 // uncompressed sound 00114 AT_SOUND_WAV = 17, 00115 00116 // uncompressed image, non-square, and not appropriate for use 00117 // as a texture. 00118 AT_IMAGE_TGA = 18, 00119 00120 // compressed image, non-square, and not appropriate for use 00121 // as a texture. 00122 AT_IMAGE_JPEG = 19, 00123 00124 // animation 00125 AT_ANIMATION = 20, 00126 00127 // gesture, sequence of animations, sounds, chat, wait steps 00128 AT_GESTURE = 21, 00129 00130 // simstate file 00131 AT_SIMSTATE = 22, 00132 00133 // +*********************************************+ 00134 // | TO ADD AN ELEMENT TO THIS ENUM: | 00135 // +*********************************************+ 00136 // | 1. INSERT BEFORE AT_COUNT | 00137 // | 2. INCREMENT AT_COUNT BY 1 | 00138 // | 3. ADD TO LLAssetType::mAssetTypeNames | 00139 // | 4. ADD TO LLAssetType::mAssetTypeHumanNames | 00140 // +*********************************************+ 00141 00142 AT_COUNT = 23, 00143 00144 AT_NONE = -1 00145 }; 00146 00147 // machine transation between type and strings 00148 static EType lookup(const char* name); 00149 static const char* lookup(EType type); 00150 00151 // translation from a type to a human readable form. 00152 static EType lookupHumanReadable( const char* name ); 00153 static const char* lookupHumanReadable(EType type); 00154 00155 static EDragAndDropType lookupDragAndDropType( EType ); 00156 00157 // Generate a good default description. You may want to add a verb 00158 // or agent name after this depending on your application. 00159 static void generateDescriptionFor(LLAssetType::EType type, 00160 std::string& desc); 00161 00162 static EType getType(const std::string& sin); 00163 static std::string getDesc(EType type); 00164 00165 private: 00166 // don't instantiate or derive one of these objects 00167 LLAssetType( void ) {} 00168 ~LLAssetType( void ) {} 00169 00170 private: 00171 static const char* mAssetTypeNames[]; 00172 static const char* mAssetTypeHumanNames[]; 00173 }; 00174 00175 #endif // LL_LLASSETTYPE