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