Unity Scopes API
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 #pragma once
20 
21 #include <unity/scopes/Annotation.h>
22 #include <unity/scopes/CategorisedResult.h>
23 #include <unity/scopes/Category.h>
24 #include <unity/scopes/Department.h>
25 #include <unity/scopes/FilterBase.h>
26 #include <unity/scopes/ListenerBase.h>
27 #include <unity/util/DefinesPtrs.h>
28 #include <unity/util/NonCopyable.h>
29 
30 #include <string>
31 
32 namespace unity
33 {
34 
35 namespace scopes
36 {
37 
38 namespace experimental
39 {
40 class Annotation;
41 }
42 
57 {
58 public:
60  NONCOPYABLE(SearchListenerBase);
61  UNITY_DEFINES_PTRS(SearchListenerBase);
62 
63  virtual ~SearchListenerBase();
65 
71  virtual void push(Department::SCPtr const& parent);
72 
76  virtual void push(CategorisedResult result) = 0;
77 
83  virtual void push(experimental::Annotation annotation);
84 
94  virtual void push(Category::SCPtr const& category);
95 
101  virtual void push(Filters const& filters, FilterState const& filter_state);
102 
103 protected:
107 };
108 
109 } // namespace scopes
110 
111 } // namespace unity
std::list< FilterBase::SCPtr > Filters
List of filters.
Definition: FilterBase.h:106
Top-level namespace for all things Unity-related.
Definition: Version.h:49
Abstract base interface for a client to receive the results of a query.
Definition: SearchListenerBase.h:56
virtual void push(Department::SCPtr const &parent)
Called at most once by the scopes run time for a tree of departments returned by a query...
Captures state of multiple filters.
Definition: FilterState.h:46
A result, including the category it belongs to.
Definition: CategorisedResult.h:41
Abstract base class to be notified of request completion (such as a query or activation request)...
Definition: ListenerBase.h:43