PageRenderTime 314ms CodeModel.GetById 191ms app.highlight 9ms RepoModel.GetById 112ms app.codeStats 1ms

/indra/newview/llslurl.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 108 lines | 64 code | 16 blank | 28 comment | 6 complexity | 0a9c463918c1317c649d9c910c5d62ba MD5 | raw file
  1/**
  2 * @file llslurl.h
  3 * @brief Handles "SLURL fragments" like Ahern/123/45 for
  4 * startup processing, login screen, prefs, etc.
  5 *
  6 * $LicenseInfo:firstyear=2010&license=viewerlgpl$
  7 * Second Life Viewer Source Code
  8 * Copyright (C) 2010, Linden Research, Inc.
  9 * 
 10 * This library is free software; you can redistribute it and/or
 11 * modify it under the terms of the GNU Lesser General Public
 12 * License as published by the Free Software Foundation;
 13 * version 2.1 of the License only.
 14 * 
 15 * This library is distributed in the hope that it will be useful,
 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 18 * Lesser General Public License for more details.
 19 * 
 20 * You should have received a copy of the GNU Lesser General Public
 21 * License along with this library; if not, write to the Free Software
 22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 23 * 
 24 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
 25 * $/LicenseInfo$
 26 */
 27#ifndef LLSLURL_H
 28#define LLSLURL_H
 29
 30#include "llstring.h"
 31
 32
 33// represents a location in a grid
 34
 35class LLSLURL
 36{
 37public:
 38	static const char* SLURL_HTTPS_SCHEME;
 39	static const char* SLURL_HTTP_SCHEME;
 40	static const char* SLURL_SL_SCHEME;
 41	static const char* SLURL_SECONDLIFE_SCHEME;
 42	static const char* SLURL_SECONDLIFE_PATH;
 43	static const char* SLURL_COM;
 44	static const char* WWW_SLURL_COM;
 45	static const char* SECONDLIFE_COM;
 46	static const char* MAPS_SECONDLIFE_COM;
 47	static const char* SLURL_X_GRID_LOCATION_INFO_SCHEME;
 48	static LLSLURL START_LOCATION;
 49	static const char* SIM_LOCATION_HOME;
 50	static const char* SIM_LOCATION_LAST;
 51	static const char* SLURL_APP_PATH;
 52	static const char* SLURL_REGION_PATH;	
 53	
 54	enum SLURL_TYPE { 
 55		INVALID, 
 56		LOCATION,
 57		HOME_LOCATION,
 58		LAST_LOCATION,
 59		APP,
 60		HELP 
 61	};
 62		
 63	
 64	LLSLURL(): mType(INVALID)  { }
 65	LLSLURL(const std::string& slurl);
 66	LLSLURL(const std::string& grid, const std::string& region);
 67	LLSLURL(const std::string& region, const LLVector3& position);
 68	LLSLURL(const std::string& grid, const std::string& region, const LLVector3& position);
 69	LLSLURL(const std::string& grid, const std::string& region, const LLVector3d& global_position);
 70	LLSLURL(const std::string& region, const LLVector3d& global_position);
 71	LLSLURL(const std::string& command, const LLUUID&id, const std::string& verb);
 72	
 73	SLURL_TYPE getType() const { return mType; }
 74	
 75	std::string getSLURLString() const;
 76	std::string getLoginString() const;
 77	std::string getLocationString() const; 
 78	std::string getGrid() const { return mGrid; }
 79	std::string getRegion() const { return mRegion; }
 80	LLVector3   getPosition() const { return mPosition; }
 81	std::string getAppCmd() const { return mAppCmd; }
 82	std::string getAppQuery() const { return mAppQuery; }
 83	LLSD        getAppQueryMap() const { return mAppQueryMap; }
 84	LLSD        getAppPath() const { return mAppPath; }
 85	
 86	bool        isValid() const { return mType != INVALID; }
 87	bool        isSpatial() const { return (mType == LAST_LOCATION) || (mType == HOME_LOCATION) || (mType == LOCATION); }
 88	
 89	bool operator==(const LLSLURL& rhs);
 90	bool operator!=(const LLSLURL&rhs);
 91
 92    std::string asString() const ;
 93
 94protected:
 95	SLURL_TYPE mType;
 96	
 97	// used for Apps and Help
 98	std::string mAppCmd;
 99	LLSD        mAppPath;
100	LLSD        mAppQueryMap;
101	std::string mAppQuery;
102	
103	std::string mGrid;  // reference to grid manager grid
104	std::string mRegion;
105	LLVector3  mPosition;
106};
107
108#endif // LLSLURL_H