Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qgeomappingmanagerengine.cpp
Go to the documentation of this file.
1// Copyright (C) 2015 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
10#include "qgeomaptype_p.h"
11
13
14/*!
15 \class QGeoMappingManagerEngine
16 \inmodule QtLocation
17 \ingroup QtLocation-impl
18 \since 5.6
19 \internal
20
21 \brief Provides support functionality for map display with QGeoServiceProvider.
22
23 \note There are no source or binary compatibility guarantees for the
24 backend classes. The API is only guaranteed to work with the Qt version it
25 was developed against. API changes will however only be made in minor
26 releases. (6.6, 6.7, and so on.)
27
28 The QGeoMappingManagerEngine class provides an interface and convenience
29 methods to implementors of QGeoServiceProvider plugins who want to
30 provide support for displaying and interacting with maps.
31*/
32
33/*!
34 Constructs a new engine with the specified \a parent.
35*/
36QGeoMappingManagerEngine::QGeoMappingManagerEngine(QObject *parent)
37 : QObject(parent),
38 d_ptr(new QGeoMappingManagerEnginePrivate()) {}
39
40/*!
41 Destroys this engine.
42*/
43QGeoMappingManagerEngine::~QGeoMappingManagerEngine()
44{
45 Q_D(QGeoMappingManagerEngine);
46 delete d;
47}
48
49/*!
50 Marks the engine as initialized. Subclasses of QGeoMappingManagerEngine are to
51 call this method after performing implementation-specific initializatioin within
52 the constructor.
53*/
54void QGeoMappingManagerEngine::engineInitialized()
55{
56 Q_D(QGeoMappingManagerEngine);
57 d->initialized = true;
58 emit initialized();
59}
60
61/*!
62 Sets the name which this engine implementation uses to distinguish itself
63 from the implementations provided by other plugins to \a managerName.
64
65 The combination of managerName() and managerVersion() should be unique
66 amongst plugin implementations.
67*/
68void QGeoMappingManagerEngine::setManagerName(const QString &managerName)
69{
70 d_ptr->managerName = managerName;
71}
72
73/*!
74 Returns the name which this engine implementation uses to distinguish
75 itself from the implementations provided by other plugins.
76
77 The combination of managerName() and managerVersion() should be unique
78 amongst plugin implementations.
79*/
80QString QGeoMappingManagerEngine::managerName() const
81{
82 return d_ptr->managerName;
83}
84
85/*!
86 Sets the version of this engine implementation to \a managerVersion.
87
88 The combination of managerName() and managerVersion() should be unique
89 amongst plugin implementations.
90*/
91void QGeoMappingManagerEngine::setManagerVersion(int managerVersion)
92{
93 d_ptr->managerVersion = managerVersion;
94}
95
96/*!
97 Returns the version of this engine implementation.
98
99 The combination of managerName() and managerVersion() should be unique
100 amongst plugin implementations.
101*/
102int QGeoMappingManagerEngine::managerVersion() const
103{
104 return d_ptr->managerVersion;
105}
106
107QList<QGeoMapType> QGeoMappingManagerEngine::supportedMapTypes() const
108{
109 Q_D(const QGeoMappingManagerEngine);
110 return d->supportedMapTypes;
111}
112
113/*!
114 Sets the list of map types supported by this engine to \a mapTypes.
115
116 Subclasses of QGeoMappingManagerEngine should use this function to ensure
117 that supportedMapTypes() provides accurate information.
118*/
119void QGeoMappingManagerEngine::setSupportedMapTypes(const QList<QGeoMapType> &supportedMapTypes)
120{
121 Q_D(QGeoMappingManagerEngine);
122 d->supportedMapTypes = supportedMapTypes;
123 emit supportedMapTypesChanged();
124}
125
126QGeoCameraCapabilities QGeoMappingManagerEngine::cameraCapabilities(int mapId) const
127{
128 Q_UNUSED(mapId);
129 Q_D(const QGeoMappingManagerEngine);
130
131 if (mapId == 0)
132 return d->capabilities_;
133 int idx = mapId - 1;
134 if (idx >= supportedMapTypes().size())
135 return d->capabilities_;
136 return supportedMapTypes().at(idx).cameraCapabilities();
137}
138
139void QGeoMappingManagerEngine::setCameraCapabilities(const QGeoCameraCapabilities &capabilities)
140{
141 Q_D(QGeoMappingManagerEngine);
142 d->capabilities_ = capabilities;
143}
144
145/*!
146 Return whether the engine has been initialized and is ready to be used.
147*/
148
149bool QGeoMappingManagerEngine::isInitialized() const
150{
151 Q_D(const QGeoMappingManagerEngine);
152 return d->initialized;
153}
154
155/*!
156 Sets the locale to be used by the this manager to \a locale.
157
158 If this mapping manager supports returning map labels
159 in different languages, they will be returned in the language of \a locale.
160
161 The locale used defaults to the system locale if this is not set.
162*/
163void QGeoMappingManagerEngine::setLocale(const QLocale &locale)
164{
165 d_ptr->locale = locale;
166}
167
168/*!
169 Returns the locale used to hint to this mapping manager about what
170 language to use for map labels.
171*/
172QLocale QGeoMappingManagerEngine::locale() const
173{
174 return d_ptr->locale;
175}
176
177/*******************************************************************************
178*******************************************************************************/
179
182
183QT_END_NAMESPACE
Combined button and popup list for selecting options.