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 QPLACE_P_H
38#define QPLACE_P_H
39
40//
41// W A R N I N G
42// -------------
43//
44// This file is not part of the Qt API. It exists purely as an
45// implementation detail. This header file may change from version to
46// version without notice, or even be removed.
47//
48// We mean it.
49//
50
51#include <QSharedData>
52#include <QUrl>
53
54#include <QtLocation/private/qlocationglobal_p.h>
55#include <QtLocation/qplace.h>
56#include <QtPositioning/qgeoaddress.h>
57#include <QtPositioning/qgeorectangle.h>
58#include <QtPositioning/qgeocoordinate.h>
59#include <QtLocation/qplacesupplier.h>
60#include <QtLocation/QPlaceIcon>
61
62QT_BEGIN_NAMESPACE
63
64class Q_LOCATION_PRIVATE_EXPORT QPlacePrivate : public QSharedData
65{
66public:
67 QPlacePrivate();
68 QPlacePrivate(const QPlacePrivate &other);
69 virtual ~QPlacePrivate();
70 virtual QPlacePrivate *clone() = 0;
71
72 bool operator==(const QPlacePrivate &other) const;
73
74 virtual bool isEmpty() const;
75 virtual QList<QPlaceCategory> categories() const = 0;
76 virtual void setCategories(const QList<QPlaceCategory> &categories) = 0;
77 virtual QGeoLocation location() const = 0;
78 virtual void setLocation(const QGeoLocation &location) = 0;
79 virtual QPlaceRatings ratings() const = 0;
80 virtual void setRatings(const QPlaceRatings &ratings) = 0;
81 virtual QPlaceSupplier supplier() const = 0;
82 virtual void setSupplier(const QPlaceSupplier &supplier) = 0;
83 virtual QString name() const = 0;
84 virtual void setName(const QString &name) = 0;
85 virtual QString placeId() const = 0;
86 virtual void setPlaceId(const QString &placeIdentifier) = 0;
87 virtual QString attribution() const = 0;
88 virtual void setAttribution(const QString &attribution) = 0;
89 virtual QLocation::Visibility visibility() const = 0;
90 virtual void setVisibility(QLocation::Visibility visibility) = 0;
91 virtual QPlaceIcon icon() const = 0;
92 virtual void setIcon(const QPlaceIcon &icon) = 0;
93 virtual bool detailsFetched() const = 0;
94 virtual void setDetailsFetched(bool fetched) = 0;
95
96 virtual QMap<QString, QPlaceAttribute> extendedAttributes() const = 0;
97 virtual QMap<QString, QPlaceAttribute> &extendedAttributes() = 0;
98 virtual QMap<QString, QList<QPlaceContactDetail> > contacts() const = 0;
99 virtual QMap<QString, QList<QPlaceContactDetail> > &contacts() = 0;
100 virtual QPlaceAttribute extendedAttribute(const QString &attributeType) const;
101
102
103 // The place content, that has to be manually retrieved from the place manager and manually added to the place.
104 // Currently, place content types can be:
105 // ImageType,
106 // ReviewType,
107 // EditorialType,
108 // CustomType = 0x0100
109 QMap<QPlaceContent::Type, QPlaceContent::Collection> m_contentCollections;
110 QMap<QPlaceContent::Type, int> m_contentCounts;
111};
112
113
114class Q_LOCATION_PRIVATE_EXPORT QPlacePrivateDefault : public QPlacePrivate
115{
116public:
117 QPlacePrivateDefault();
118 QPlacePrivateDefault(const QPlacePrivateDefault &other);
119 virtual ~QPlacePrivateDefault();
120 virtual QPlacePrivate *clone() override;
121
122 virtual QList<QPlaceCategory> categories() const override;
123 virtual void setCategories(const QList<QPlaceCategory> &categories) override;
124 virtual QGeoLocation location() const override;
125 virtual void setLocation(const QGeoLocation &location) override;
126 virtual QPlaceRatings ratings() const override;
127 virtual void setRatings(const QPlaceRatings &ratings) override;
128 virtual QPlaceSupplier supplier() const override;
129 virtual void setSupplier(const QPlaceSupplier &supplier) override;
130 virtual QString name() const override;
131 virtual void setName(const QString &name) override;
132 virtual QString placeId() const override;
133 virtual void setPlaceId(const QString &placeIdentifier) override;
134 virtual QString attribution() const override;
135 virtual void setAttribution(const QString &attribution) override;
136 virtual QLocation::Visibility visibility() const override;
137 virtual void setVisibility(QLocation::Visibility visibility) override;
138 virtual QPlaceIcon icon() const override;
139 virtual void setIcon(const QPlaceIcon &icon) override;
140 virtual bool detailsFetched() const override;
141 virtual void setDetailsFetched(bool fetched) override;
142
143 virtual QMap<QString, QPlaceAttribute> extendedAttributes() const override;
144 virtual QMap<QString, QPlaceAttribute> &extendedAttributes() override;
145 virtual QMap<QString, QList<QPlaceContactDetail> > contacts() const override;
146 virtual QMap<QString, QList<QPlaceContactDetail> > &contacts() override;
147
148
149 // data members
150
151 QList<QPlaceCategory> m_categories;
152 QGeoLocation m_location;
153 QPlaceRatings m_ratings;
154 QPlaceSupplier m_supplier;
155 QString m_name;
156 QString m_placeId;
157 QString m_attribution;
158
159 QMap<QString, QPlaceAttribute> m_extendedAttributes;
160 QMap<QString, QList<QPlaceContactDetail> > m_contacts;
161
162 QLocation::Visibility m_visibility;
163 QPlaceIcon m_icon;
164 bool m_detailsFetched;
165};
166
167QT_END_NAMESPACE
168
169#endif
170
171

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