PageRenderTime 27ms CodeModel.GetById 18ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llurldispatcher.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 59 lines | 14 code | 6 blank | 39 comment | 0 complexity | e45a60f59bed8843275bee250681995a MD5 | raw file
 1/**
 2 * @file llurldispatcher.h
 3 * @brief Central registry for all SL URL handlers
 4 *
 5 * $LicenseInfo:firstyear=2010&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#ifndef LLURLDISPATCHER_H
27#define LLURLDISPATCHER_H
28class LLMediaCtrl;
29
30
31class LLURLDispatcher
32{
33public:
34	
35	static bool dispatch(const std::string& slurl,
36						 const std::string& nav_type,
37						 LLMediaCtrl* web,
38						 bool trusted_browser);	
39		// At startup time and on clicks in internal web browsers,
40		// teleport, open map, or run requested command.
41		// @param url
42		//   secondlife://RegionName/123/45/67/
43		//   secondlife:///app/agent/3d6181b0-6a4b-97ef-18d8-722652995cf1/show
44		//   sl://app/foo/bar
45		// @param nav_type
46		//   type of navigation type (see LLQtWebKit::LLWebPage::acceptNavigationRequest)
47		// @param web
48		//	 Pointer to LLMediaCtrl sending URL, can be NULL
49		// @param trusted_browser
50		//   True if coming inside the app AND from a brower instance
51		//   that navigates to trusted (Linden Lab) pages.
52		// Returns true if someone handled the URL.
53
54	static bool dispatchRightClick(const std::string& slurl);
55
56	static bool dispatchFromTextEditor(const std::string& slurl);
57};
58
59#endif