PageRenderTime 8ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llweb.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 62 lines | 17 code | 7 blank | 38 comment | 0 complexity | d682f96f7e4e7ddd7bc05ae4f5670078 MD5 | raw file
 1/** 
 2 * @file llweb.h
 3 * @brief Functions dealing with web browsers
 4 * @author James Cook
 5 *
 6 * $LicenseInfo:firstyear=2006&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
28#ifndef LL_LLWEB_H
29#define LL_LLWEB_H
30
31#include <string>
32
33///
34/// The LLWeb class provides various static methods to display the
35/// contents of a Url in a web browser. Variations are provided to 
36/// let you specifically use the Second Life internal browser, the
37/// operating system's default browser, or to respect the user's
38/// setting for which of these two they prefer to use with SL.
39///
40class LLWeb
41{
42public:
43	static void initClass();
44	
45	/// Load the given url in the operating system's web browser, async if we want to return immediately
46	/// before browser has spawned
47	static void loadURLExternal(const std::string& url) {loadURLExternal(url, LLStringUtil::null);}
48	static void loadURLExternal(const std::string& url, const std::string& uuid);
49	static void loadURLExternal(const std::string& url, bool async, const std::string& uuid = LLStringUtil::null);
50
51	static void loadURL(const std::string& url, const std::string& target = LLStringUtil::null, const std::string& uuid = LLStringUtil::null);
52	// load content using built-in browser
53	static void loadURLInternal(const std::string &url, const std::string& target = LLStringUtil::null, const std::string& uuid = LLStringUtil::null);
54
55	/// Returns escaped url (eg, " " to "%20") - used by all loadURL methods
56	static std::string escapeURL(const std::string& url);
57	/// Expands various strings like [LANG], [VERSION], etc. in a URL
58	static std::string expandURLSubstitutions(const std::string &url,
59											  const LLSD &default_subs);
60};
61
62#endif