2
* Copyright (C) 2014 Canonical Ltd
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.
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.
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/>.
16
* Authored by: Michi Henning <michi.henning@canonical.com>
19
#ifndef UNITY_SCOPES_INTERNAL_SEARCHREPLYIMPL_H
20
#define UNITY_SCOPES_INTERNAL_SEARCHREPLYIMPL_H
22
#include <unity/scopes/Category.h>
23
#include <unity/scopes/Department.h>
24
#include <unity/scopes/FilterBase.h>
25
#include <unity/scopes/FilterState.h>
26
#include <unity/scopes/internal/CategoryRegistry.h>
27
#include <unity/scopes/internal/MWReplyProxyFwd.h>
28
#include <unity/scopes/internal/ObjectImpl.h>
29
#include <unity/scopes/internal/ReplyImpl.h>
30
#include <unity/scopes/SearchReply.h>
38
class CategorisedResult;
39
class CategoryRenderer;
45
class QueryObjectBase;
47
class SearchReplyImpl : public virtual unity::scopes::SearchReply, public virtual ReplyImpl
50
SearchReplyImpl(MWReplyProxy const& mw_proxy, std::shared_ptr<QueryObjectBase>const & qo);
51
virtual ~SearchReplyImpl();
53
virtual void register_departments(DepartmentList const& departments, std::string current_department_id) override;
55
virtual Category::SCPtr register_category(std::string const& id,
56
std::string const& title,
57
std::string const &icon,
58
CategoryRenderer const& renderer_template) override;
59
virtual void register_category(Category::SCPtr category) override;
60
virtual Category::SCPtr lookup_category(std::string const& id) override;
62
virtual bool register_annotation(unity::scopes::Annotation const& annotation) override;
64
virtual bool push(unity::scopes::CategorisedResult const& result) override;
65
virtual bool push(unity::scopes::Filters const& filters, unity::scopes::FilterState const& filter_state) override;
68
bool push(Category::SCPtr category);
70
std::shared_ptr<CategoryRegistry> cat_registry_;
72
std::atomic_int cardinality_;
73
std::atomic_int num_pushes_;
76
} // namespace internal