PageRenderTime 38ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llfloatersearch.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 92 lines | 32 code | 17 blank | 43 comment | 0 complexity | 333b70862ddb2979ae713c6164ddfdf2 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llfloatersearch.h
  3. * @author Martin Reddy
  4. * @brief Search floater - uses an embedded web browser control
  5. *
  6. * $LicenseInfo:firstyear=2009&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_LLFLOATERSEARCH_H
  28. #define LL_LLFLOATERSEARCH_H
  29. #include "llfloaterwebcontent.h"
  30. #include "llviewermediaobserver.h"
  31. #include <string>
  32. class LLMediaCtrl;
  33. ///
  34. /// The search floater allows users to perform all search operations.
  35. /// All search functionality is now implemented via web services and
  36. /// so this floater simply embeds a web view and displays the search
  37. /// web page. The browser control is explicitly marked as "trusted"
  38. /// so that the user can click on teleport links in search results.
  39. ///
  40. class LLFloaterSearch :
  41. public LLFloaterWebContent
  42. {
  43. public:
  44. struct SearchQuery : public LLInitParam::Block<SearchQuery>
  45. {
  46. Optional<std::string> category;
  47. Optional<std::string> query;
  48. SearchQuery();
  49. };
  50. struct _Params : public LLInitParam::Block<_Params, LLFloaterWebContent::Params>
  51. {
  52. Optional<SearchQuery> search;
  53. };
  54. typedef LLSDParamAdapter<_Params> Params;
  55. LLFloaterSearch(const Params& key);
  56. /// show the search floater with a new search
  57. /// see search() for details on the key parameter.
  58. /*virtual*/ void onOpen(const LLSD& key);
  59. /*virtual*/ void onClose(bool app_quitting);
  60. /// perform a search with the specific search term.
  61. /// The key should be a map that can contain the following keys:
  62. /// - "id": specifies the text phrase to search for
  63. /// - "category": one of "all" (default), "people", "places",
  64. /// "events", "groups", "wiki", "destinations", "classifieds"
  65. void search(const SearchQuery &query);
  66. /// changing godmode can affect the search results that are
  67. /// returned by the search website - use this method to tell the
  68. /// search floater that the user has changed god level.
  69. void godLevelChanged(U8 godlevel);
  70. private:
  71. /*virtual*/ BOOL postBuild();
  72. LLSD mCategoryPaths;
  73. U8 mSearchGodLevel;
  74. };
  75. #endif // LL_LLFLOATERSEARCH_H