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