llinventorytype.h

Go to the documentation of this file.
00001 
00032 #ifndef LLINVENTORYTYPE_H
00033 #define LLINVENTORYTYPE_H
00034 
00035 #include "llassettype.h"
00036 
00037 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00038 // Class LLInventoryType
00039 //
00040 // Class used to encapsulate operations around inventory type.
00041 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00042 
00043 class LLInventoryType
00044 {
00045 public:
00046         enum EType
00047         {
00048                 IT_TEXTURE = 0,
00049                 IT_SOUND = 1, 
00050                 IT_CALLINGCARD = 2,
00051                 IT_LANDMARK = 3,
00052                 //IT_SCRIPT = 4,
00053                 //IT_CLOTHING = 5,
00054                 IT_OBJECT = 6,
00055                 IT_NOTECARD = 7,
00056                 IT_CATEGORY = 8,
00057                 IT_ROOT_CATEGORY = 9,
00058                 IT_LSL = 10,
00059                 //IT_LSL_BYTECODE = 11,
00060                 //IT_TEXTURE_TGA = 12,
00061                 //IT_BODYPART = 13,
00062                 //IT_TRASH = 14,
00063                 IT_SNAPSHOT = 15,
00064                 //IT_LOST_AND_FOUND = 16,
00065                 IT_ATTACHMENT = 17,
00066                 IT_WEARABLE = 18,
00067                 IT_ANIMATION = 19,
00068                 IT_GESTURE = 20,
00069                 IT_COUNT = 21,
00070 
00071                 IT_NONE = -1
00072         };
00073 
00074         // machine transation between type and strings
00075         static EType lookup(const char* name);
00076         static const char* lookup(EType type);
00077 
00078         // translation from a type to a human readable form.
00079         static const char* lookupHumanReadable(EType type);
00080 
00081         // return the default inventory for the given asset type.
00082         static EType defaultForAssetType(LLAssetType::EType asset_type);
00083 
00084 private:
00085         // don't instantiate or derive one of these objects
00086         LLInventoryType( void );
00087         ~LLInventoryType( void );
00088 };
00089 
00090 // helper function which returns true if inventory type and asset type
00091 // are potentially compatible. For example, an attachment must be an
00092 // object, but a wearable can be a bodypart or clothing asset.
00093 bool inventory_and_asset_types_match(
00094         LLInventoryType::EType inventory_type,
00095         LLAssetType::EType asset_type);
00096 
00097 #endif

Generated on Thu Jul 1 06:08:46 2010 for Second Life Viewer by  doxygen 1.4.7