PageRenderTime 233ms CodeModel.GetById 130ms app.highlight 4ms RepoModel.GetById 97ms 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
 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
28#ifndef LL_LLFLOATERSEARCH_H
29#define LL_LLFLOATERSEARCH_H
30
31#include "llfloaterwebcontent.h"
32#include "llviewermediaobserver.h"
33
34#include <string>
35
36class LLMediaCtrl;
37
38///
39/// The search floater allows users to perform all search operations.
40/// All search functionality is now implemented via web services and
41/// so this floater simply embeds a web view and displays the search
42/// web page. The browser control is explicitly marked as "trusted"
43/// so that the user can click on teleport links in search results.
44///
45class LLFloaterSearch : 
46	public LLFloaterWebContent
47{
48public:
49	struct SearchQuery : public LLInitParam::Block<SearchQuery>
50	{
51		Optional<std::string> category;
52		Optional<std::string> query;
53
54		SearchQuery();
55	};
56
57	struct _Params : public LLInitParam::Block<_Params, LLFloaterWebContent::Params>
58	{
59		Optional<SearchQuery> search;
60	};
61
62	typedef LLSDParamAdapter<_Params> Params;
63
64	LLFloaterSearch(const Params& key);
65
66	/// show the search floater with a new search
67	/// see search() for details on the key parameter.
68	/*virtual*/ void onOpen(const LLSD& key);
69
70	/*virtual*/ void onClose(bool app_quitting);
71
72	/// perform a search with the specific search term.
73	/// The key should be a map that can contain the following keys:
74	///  - "id": specifies the text phrase to search for
75	///  - "category": one of "all" (default), "people", "places",
76	///    "events", "groups", "wiki", "destinations", "classifieds"
77	void search(const SearchQuery &query);
78
79	/// changing godmode can affect the search results that are
80	/// returned by the search website - use this method to tell the
81	/// search floater that the user has changed god level.
82	void godLevelChanged(U8 godlevel);
83
84private:
85	/*virtual*/ BOOL postBuild();
86
87	LLSD        mCategoryPaths;
88	U8          mSearchGodLevel;
89};
90
91#endif  // LL_LLFLOATERSEARCH_H
92