~mardy/unity-scopes-api/clientid-1554040

« back to all changes in this revision

Viewing changes to include/unity/scopes/internal/SearchReplyImpl.h

  • Committer: CI bot
  • Author(s): Tarmac
  • Date: 2014-03-12 16:58:32 UTC
  • mfrom: (163.45.63 devel)
  • Revision ID: ps-jenkins@lists.canonical.com-20140312165832-ngmnoud825y533pk
Sync with devel branch - updated scopes API to 0.4.0. See RELEASE_NOTES for list of all changes. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2014 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_INTERNAL_SEARCHREPLYIMPL_H
 
20
#define UNITY_SCOPES_INTERNAL_SEARCHREPLYIMPL_H
 
21
 
 
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>
 
31
 
 
32
namespace unity
 
33
{
 
34
 
 
35
namespace scopes
 
36
{
 
37
 
 
38
class CategorisedResult;
 
39
class CategoryRenderer;
 
40
class Annotation;
 
41
 
 
42
namespace internal
 
43
{
 
44
 
 
45
class QueryObjectBase;
 
46
 
 
47
class SearchReplyImpl : public virtual unity::scopes::SearchReply, public virtual ReplyImpl
 
48
{
 
49
public:
 
50
    SearchReplyImpl(MWReplyProxy const& mw_proxy, std::shared_ptr<QueryObjectBase>const & qo);
 
51
    virtual ~SearchReplyImpl();
 
52
 
 
53
    virtual void register_departments(DepartmentList const& departments, std::string current_department_id) override;
 
54
 
 
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;
 
61
 
 
62
    virtual bool register_annotation(unity::scopes::Annotation const& annotation) override;
 
63
 
 
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;
 
66
 
 
67
private:
 
68
    bool push(Category::SCPtr category);
 
69
 
 
70
    std::shared_ptr<CategoryRegistry> cat_registry_;
 
71
 
 
72
    std::atomic_int cardinality_;
 
73
    std::atomic_int num_pushes_;
 
74
};
 
75
 
 
76
} // namespace internal
 
77
 
 
78
} // namespace scopes
 
79
 
 
80
} // namespace unity
 
81
 
 
82
#endif