/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. #ifndef LL_LLWEB_H
  28. #define LL_LLWEB_H
  29. #include <string>
  30. ///
  31. /// The LLWeb class provides various static methods to display the
  32. /// contents of a Url in a web browser. Variations are provided to
  33. /// let you specifically use the Second Life internal browser, the
  34. /// operating system's default browser, or to respect the user's
  35. /// setting for which of these two they prefer to use with SL.
  36. ///
  37. class LLWeb
  38. {
  39. public:
  40. static void initClass();
  41. /// Load the given url in the operating system's web browser, async if we want to return immediately
  42. /// before browser has spawned
  43. static void loadURLExternal(const std::string& url) {loadURLExternal(url, LLStringUtil::null);}
  44. static void loadURLExternal(const std::string& url, const std::string& uuid);
  45. static void loadURLExternal(const std::string& url, bool async, const std::string& uuid = LLStringUtil::null);
  46. static void loadURL(const std::string& url, const std::string& target = LLStringUtil::null, const std::string& uuid = LLStringUtil::null);
  47. // load content using built-in browser
  48. static void loadURLInternal(const std::string &url, const std::string& target = LLStringUtil::null, const std::string& uuid = LLStringUtil::null);
  49. /// Returns escaped url (eg, " " to "%20") - used by all loadURL methods
  50. static std::string escapeURL(const std::string& url);
  51. /// Expands various strings like [LANG], [VERSION], etc. in a URL
  52. static std::string expandURLSubstitutions(const std::string &url,
  53. const LLSD &default_subs);
  54. };
  55. #endif