Unity Scopes API
SearchReply.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 #pragma once
20 
21 #include <unity/scopes/Category.h>
22 #include <unity/scopes/CategoryRenderer.h>
23 #include <unity/scopes/Department.h>
24 #include <unity/scopes/FilterBase.h>
25 #include <unity/scopes/FilterState.h>
26 #include <unity/scopes/Reply.h>
27 
28 namespace unity
29 {
30 
31 namespace scopes
32 {
33 
34 class CategorisedResult;
35 
36 namespace experimental
37 {
38 class Annotation;
39 }
40 
45 class SearchReply : public virtual Reply
46 {
47 public:
81  virtual void register_departments(Department::SCPtr const& parent) = 0;
82 
98  virtual Category::SCPtr register_category(std::string const& id,
99  std::string const& title,
100  std::string const& icon,
101  CategoryRenderer const& renderer_template = CategoryRenderer()) = 0;
102 
111  virtual void register_category(Category::SCPtr category) = 0;
112 
117  virtual Category::SCPtr lookup_category(std::string const& id) = 0;
118 
130  virtual bool push(CategorisedResult const& result) = 0;
131 
139  virtual bool push(experimental::Annotation const& annotation) = 0;
140 
145  virtual bool push(Filters const& filters, FilterState const& filter_state) = 0;
146 
152  virtual ~SearchReply();
153 
166  virtual Category::SCPtr register_category(std::string const& id,
167  std::string const& title,
168  std::string const& icon,
169  CannedQuery const& query,
170  CategoryRenderer const& renderer_template = CategoryRenderer()) = 0;
171 
191  virtual void push_surfacing_results_from_cache() = 0;
192 
193 protected:
195  SearchReply();
197 };
198 
199 } // namespace scopes
200 
201 } // namespace unity
std::list< FilterBase::SCPtr > Filters
List of filters.
Definition: FilterBase.h:131
A category renderer template in JSON format.
Definition: CategoryRenderer.h:83
Allows query termination to be sent to the source of a query.
Definition: Reply.h:37
Allows the results of a search query to be sent to the query source.
Definition: SearchReply.h:45
Top-level namespace for all things Unity-related.
Definition: Version.h:49
Parameters of a search query.
Definition: CannedQuery.h:49
Stores the state of multiple filters.
Definition: FilterState.h:46
A result, including the category it belongs to.
Definition: CategorisedResult.h:41