Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SearchListenerBase.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_SEARCHLISTENERBASE_H
20 #define UNITY_SCOPES_SEARCHLISTENERBASE_H
21 
22 #include <unity/scopes/ListenerBase.h>
23 #include <unity/util/DefinesPtrs.h>
24 #include <unity/util/NonCopyable.h>
25 #include <unity/scopes/Category.h>
26 #include <unity/scopes/Annotation.h>
27 #include <unity/scopes/Department.h>
28 #include <unity/scopes/FilterBase.h>
29 
30 #include <string>
31 
32 namespace unity
33 {
34 
35 namespace scopes
36 {
37 
38 class CategorisedResult;
39 class FilterState;
40 
54 {
55 public:
57  NONCOPYABLE(SearchListenerBase);
58  UNITY_DEFINES_PTRS(SearchListenerBase);
59 
60  virtual ~SearchListenerBase();
62 
68  virtual void push(DepartmentList const& departments, std::string const& current_department_id);
69 
73  virtual void push(CategorisedResult result) = 0;
74 
80  virtual void push(Annotation annotation);
81 
89  virtual void push(Category::SCPtr category);
90 
96  virtual void push(Filters const& filters, FilterState const& filter_state);
97 
98 protected:
102 };
103 
104 } // namespace scopes
105 
106 } // namespace unity
107 
108 #endif
Query link(s) that result in a new search query when clicked by the user.
Definition: Annotation.h:45
std::list< FilterBase::SCPtr > Filters
List of filters.
Definition: FilterBase.h:83
std::list< Department > DepartmentList
List of departments (see unity::scopes::Department)
Definition: Department.h:40
Abstract base interface that a scope specializes to receive the results of a query.
Definition: SearchListenerBase.h:53
virtual void push(DepartmentList const &departments, std::string const &current_department_id)
Called at most once by the scopes run time for a list of departments returned by a query...
Captures state of multiple filters.
Definition: FilterState.h:47
A result, including the category it belongs to.
Definition: CategorisedResult.h:41
Abstract base class to be notified of query completion.
Definition: ListenerBase.h:42