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/QSearchMetadata.h>
20
#include <unity/scopes/qt/QUtils.h>
22
#include <unity/scopes/qt/internal/QSearchMetadataImpl.h>
24
using namespace unity::scopes;
25
using namespace unity::scopes::qt;
28
QSearchMetadata::QSearchMetadata(QString const& locale, QString const& form_factor)
29
: p(new internal::QSearchMetadataImpl(locale, form_factor))
33
QSearchMetadata::QSearchMetadata(int cardinality, QString const& locale, QString const& form_factor)
34
: p(new internal::QSearchMetadataImpl(cardinality, locale, form_factor))
38
QSearchMetadata::QSearchMetadata(QSearchMetadata const& other)
39
: p(new internal::QSearchMetadataImpl(*other.p))
43
QSearchMetadata::QSearchMetadata(QSearchMetadata&&) = default;
45
QSearchMetadata::~QSearchMetadata() = default;
47
void QSearchMetadata::set_cardinality(int cardinality)
49
p->set_cardinality(cardinality);
52
int QSearchMetadata::cardinality() const
54
return p->cardinality();
57
void QSearchMetadata::set_location(Location const& location)
59
p->set_location(location);
62
Location QSearchMetadata::location() const
67
bool QSearchMetadata::has_location() const
69
return p->has_location();
72
void QSearchMetadata::set_hint(QString const& key, QVariant const& value)
74
p->set_hint(key, value);
77
QVariantMap QSearchMetadata::hints() const
82
bool QSearchMetadata::contains_hint(QString const& key) const
84
return p->contains_hint(key);
87
QScopeVariant& QSearchMetadata::operator[](QString const& key)
92
QVariant const& QSearchMetadata::operator[](QString const& key) const