2
* Copyright (C) 2015 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: Xavi Garcia <xavi.garcia.mena@canonical.com>
19
#include <unity/scopes/qt/internal/QSearchQueryBaseImpl.h>
21
#include <unity/scopes/qt/QCannedQuery.h>
22
#include <unity/scopes/qt/QSearchQueryBaseAPI.h>
24
#include <unity/scopes/SearchMetadata.h>
25
#include <unity/scopes/SearchQueryBase.h>
29
using namespace unity::scopes::qt;
30
using namespace unity::scopes::qt::internal;
31
using namespace unity::scopes;
33
QSearchQueryBaseImpl::QSearchQueryBaseImpl()
38
QCannedQuery QSearchQueryBaseImpl::query() const
41
return QCannedQuery(query_api_->query());
44
// TODO change to QSearchMetadata
45
SearchMetadata QSearchQueryBaseImpl::search_metadata() const
48
return query_api_->search_metadata();
51
void QSearchQueryBaseImpl::init(QSearchQueryBaseAPI* query_api)
53
query_api_ = query_api;
56
QueryCtrlProxy QSearchQueryBaseImpl::subsearch(ScopeProxy const& scope,
57
std::string const& query_string,
58
SearchListenerBase::SPtr const& reply)
60
return query_api_->subsearch(scope, query_string, reply);
63
QueryCtrlProxy QSearchQueryBaseImpl::subsearch(ScopeProxy const& scope,
64
std::string const& query_string,
65
FilterState const& filter_state,
66
SearchListenerBase::SPtr const& reply)
68
return query_api_->subsearch(scope, query_string, filter_state, reply);
71
QueryCtrlProxy QSearchQueryBaseImpl::subsearch(ScopeProxy const& scope,
72
std::string const& query_string,
73
std::string const& department_id,
74
FilterState const& filter_state,
75
SearchListenerBase::SPtr const& reply)
77
return query_api_->subsearch(scope, query_string, department_id, filter_state, reply);
80
QueryCtrlProxy QSearchQueryBaseImpl::subsearch(ScopeProxy const& scope,
81
std::string const& query_string,
82
std::string const& department_id,
83
FilterState const& filter_state,
84
SearchMetadata const& hints,
85
SearchListenerBase::SPtr const& reply)
87
return query_api_->subsearch(scope, query_string, department_id, filter_state, hints, reply);