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#include "qgeomaptype_p.h"
38#include "qgeomaptype_p_p.h"
39
40QT_BEGIN_NAMESPACE
41
42QGeoMapType::QGeoMapType()
43 : d_ptr(new QGeoMapTypePrivate()) {}
44
45QGeoMapType::QGeoMapType(const QGeoMapType &other)
46 : d_ptr(other.d_ptr) {}
47
48QGeoMapType::QGeoMapType(QGeoMapType::MapStyle style, const QString &name,
49 const QString &description, bool mobile, bool night, int mapId,
50 const QByteArray &pluginName,
51 const QGeoCameraCapabilities &cameraCapabilities,
52 const QVariantMap &metadata)
53: d_ptr(new QGeoMapTypePrivate(style, name, description, mobile, night, mapId, pluginName, cameraCapabilities, metadata))
54{
55}
56
57QGeoMapType::~QGeoMapType() {}
58
59QGeoMapType &QGeoMapType::operator = (const QGeoMapType &other)
60{
61 if (this == &other)
62 return *this;
63
64 d_ptr = other.d_ptr;
65 return *this;
66}
67
68bool QGeoMapType::operator == (const QGeoMapType &other) const
69{
70 return (*d_ptr.constData() == *other.d_ptr.constData());
71}
72
73bool QGeoMapType::operator != (const QGeoMapType &other) const
74{
75 return !(operator ==(other));
76}
77
78QGeoMapType::MapStyle QGeoMapType::style() const
79{
80 return d_ptr->style_;
81}
82
83QString QGeoMapType::name() const
84{
85 return d_ptr->name_;
86}
87
88QString QGeoMapType::description() const
89{
90 return d_ptr->description_;
91}
92
93bool QGeoMapType::mobile() const
94{
95 return d_ptr->mobile_;
96}
97
98bool QGeoMapType::night() const
99{
100 return d_ptr->night_;
101}
102
103int QGeoMapType::mapId() const
104{
105 return d_ptr->mapId_;
106}
107
108QByteArray QGeoMapType::pluginName() const
109{
110 return d_ptr->pluginName_;
111}
112
113QGeoCameraCapabilities QGeoMapType::cameraCapabilities() const
114{
115 return d_ptr->cameraCapabilities_;
116}
117
118QVariantMap QGeoMapType::metadata() const
119{
120 return d_ptr->metadata_;
121}
122
123QGeoMapTypePrivate::QGeoMapTypePrivate()
124: style_(QGeoMapType::NoMap), mobile_(false), night_(false), mapId_(0)
125{
126}
127
128QGeoMapTypePrivate::QGeoMapTypePrivate(const QGeoMapTypePrivate &other)
129: QSharedData(other), style_(other.style_), name_(other.name_), description_(other.description_),
130 mobile_(other.mobile_), night_(other.night_), mapId_(other.mapId_), pluginName_(other.pluginName_),
131 cameraCapabilities_(other.cameraCapabilities_), metadata_(other.metadata_)
132{
133}
134
135QGeoMapTypePrivate::QGeoMapTypePrivate(QGeoMapType::MapStyle style, const QString &name,
136 const QString &description, bool mobile, bool night,
137 int mapId, const QByteArray &pluginName,
138 const QGeoCameraCapabilities &cameraCapabilities,
139 const QVariantMap &metadata)
140: style_(style), name_(name), description_(description), mobile_(mobile), night_(night),
141 mapId_(mapId), pluginName_(pluginName), cameraCapabilities_(cameraCapabilities), metadata_(metadata)
142{
143}
144
145QGeoMapTypePrivate::~QGeoMapTypePrivate()
146{
147}
148
149bool QGeoMapTypePrivate::operator==(const QGeoMapTypePrivate &other) const
150{
151 return pluginName_ == other.pluginName_ && style_ == other.style_ && name_ == other.name_ &&
152 description_ == other.description_ && mobile_ == other.mobile_ && night_ == other.night_ &&
153 mapId_ == other.mapId_ && cameraCapabilities_ == other.cameraCapabilities_ &&
154 metadata_ == other.metadata_;
155}
156
157QT_END_NAMESPACE
158

source code of qtlocation/src/location/maps/qgeomaptype.cpp