1/****************************************************************************
2**
3** Copyright (C) 2015 The Qt Company Ltd.
4** Contact: http://www.qt.io/licensing/
5**
6** This file is part of the QtLocation module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL3$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see http://www.qt.io/terms-conditions. For further
15** information use the contact form at http://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPLv3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or later as published by the Free
28** Software Foundation and appearing in the file LICENSE.GPL included in
29** the packaging of this file. Please review the following information to
30** ensure the GNU General Public License version 2.0 requirements will be
31** met: http://www.gnu.org/licenses/gpl-2.0.html.
32**
33** $QT_END_LICENSE$
34**
35****************************************************************************/
36
37#ifndef QPLACESEARCHRESULT_H
38#define QPLACESEARCHRESULT_H
39
40#include <QtCore/QSharedDataPointer>
41#include <QtCore/QVariant>
42#include <QtCore/QString>
43#include <QtLocation/QPlace>
44
45QT_BEGIN_NAMESPACE
46
47#define Q_DECLARE_SEARCHRESULT_D_FUNC(Class) \
48 inline Class##Private *d_func(); \
49 inline const Class##Private *d_func() const;\
50 friend class Class##Private;
51
52#define Q_DECLARE_SEARCHRESULT_COPY_CTOR(Class) \
53 Class(const QPlaceSearchResult &other);
54
55class QPlaceSearchRequest;
56class QPlaceSearchResultPrivate;
57class QPlaceIcon;
58
59class Q_LOCATION_EXPORT QPlaceSearchResult
60{
61public:
62 QPlaceSearchResult();
63 QPlaceSearchResult(const QPlaceSearchResult &other);
64
65 virtual ~QPlaceSearchResult();
66
67 QPlaceSearchResult &operator=(const QPlaceSearchResult &other);
68
69 bool operator==(const QPlaceSearchResult &other) const;
70 bool operator!=(const QPlaceSearchResult &other) const {
71 return !(other == *this);
72 }
73
74 enum SearchResultType {
75 UnknownSearchResult = 0,
76 PlaceResult,
77 ProposedSearchResult
78 };
79
80 SearchResultType type() const;
81
82 QString title() const;
83 void setTitle(const QString &title);
84
85 QPlaceIcon icon() const;
86 void setIcon(const QPlaceIcon &icon);
87
88protected:
89 explicit QPlaceSearchResult(QPlaceSearchResultPrivate *d);
90 QSharedDataPointer<QPlaceSearchResultPrivate> d_ptr;
91
92private:
93 inline QPlaceSearchResultPrivate *d_func();
94 inline const QPlaceSearchResultPrivate *d_func() const;
95
96 friend class QPlaceSearchResultPrivate;
97};
98
99Q_DECLARE_TYPEINFO(QPlaceSearchResult, Q_MOVABLE_TYPE);
100
101QT_END_NAMESPACE
102
103Q_DECLARE_METATYPE(QPlaceSearchResult)
104Q_DECLARE_METATYPE(QPlaceSearchResult::SearchResultType)
105
106#endif // QPLACESEARCHRESULT_H
107

source code of qtlocation/src/location/places/qplacesearchresult.h