Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SearchQueryBase.h
1 /*
2  * Copyright (C) 2013 Canonical Ltd
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License version 3 as
6  * published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Michi Henning <michi.henning@canonical.com>
17  */
18 
19 #ifndef UNITY_SCOPES_SEARCHQUERYBASE_H
20 #define UNITY_SCOPES_SEARCHQUERYBASE_H
21 
22 #include <unity/scopes/QueryBase.h>
23 #include <unity/scopes/QueryCtrlProxyFwd.h>
24 #include <unity/scopes/ScopeProxyFwd.h>
25 #include <unity/scopes/SearchReplyProxyFwd.h>
26 #include <unity/scopes/Variant.h>
27 #include <unity/scopes/SearchListenerBase.h>
28 
29 #include <unity/util/DefinesPtrs.h>
30 #include <unity/util/NonCopyable.h>
31 
32 namespace unity
33 {
34 
35 namespace scopes
36 {
37 
38 class SearchMetadata;
39 
40 namespace internal
41 {
42 
43 class QueryBaseImpl;
44 class QueryObject;
45 
46 } // namespace internal
47 
57 class SearchQueryBase : public QueryBase
58 {
59 public:
61  NONCOPYABLE(SearchQueryBase);
62  UNITY_DEFINES_PTRS(SearchQueryBase);
64 
82  virtual void run(SearchReplyProxy const& reply) = 0;
83 
95  //{@
96  QueryCtrlProxy subsearch(ScopeProxy const& scope,
97  std::string const& query_string,
98  SearchListenerBase::SPtr const& reply);
99  QueryCtrlProxy subsearch(ScopeProxy const& scope,
100  std::string const& query_string,
101  FilterState const& filter_state,
102  SearchListenerBase::SPtr const& reply);
103  QueryCtrlProxy subsearch(ScopeProxy const& scope,
104  std::string const& query_string,
105  std::string const& department_id,
106  FilterState const& filter_state,
107  SearchListenerBase::SPtr const& reply);
108  QueryCtrlProxy subsearch(ScopeProxy const& scope,
109  std::string const& query_string,
110  std::string const& department_id,
111  FilterState const& filter_state,
112  SearchMetadata const& hints,
113  SearchListenerBase::SPtr const& reply);
115 
117  virtual ~SearchQueryBase();
119 
120 protected:
122  SearchQueryBase();
124 };
125 
126 } // namespace scopes
127 
128 } // namespace unity
129 
130 #endif
virtual void run(SearchReplyProxy const &reply)=0
Called by scopes run time to start the query.
std::shared_ptr< Scope > ScopeProxy
Convenience type definition.
Definition: ScopeProxyFwd.h:35
Abstract server-side base interface for a query that is executed inside a scope.
Definition: QueryBase.h:60
Metadata passed with search requests.
Definition: SearchMetadata.h:41
Captures state of multiple filters.
Definition: FilterState.h:47
Abstract base class to represent a particular query.
Definition: SearchQueryBase.h:57
std::shared_ptr< QueryCtrl > QueryCtrlProxy
Convenience type definition.
Definition: QueryCtrlProxyFwd.h:34
std::shared_ptr< SearchReply > SearchReplyProxy
Convenience type definition.
Definition: SearchReplyProxyFwd.h:35