diff options
62 files changed, 849 insertions, 778 deletions
diff --git a/src/imports/location/declarativeplaces/qdeclarativeresultmodelbase.cpp b/src/imports/location/declarativeplaces/qdeclarativeresultmodelbase.cpp index 6338ea63..ab678af1 100644 --- a/src/imports/location/declarativeplaces/qdeclarativeresultmodelbase.cpp +++ b/src/imports/location/declarativeplaces/qdeclarativeresultmodelbase.cpp @@ -41,6 +41,8 @@ #include "qdeclarativeresultmodelbase_p.h" +#include <QtLocation/QPlaceManager> + QDeclarativeResultModelBase::QDeclarativeResultModelBase(QObject *parent) : QDeclarativeSearchModelBase(parent), m_favoritesPlugin(0) { diff --git a/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h b/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h index cd793e65..ad59980f 100644 --- a/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h +++ b/src/imports/location/declarativeplaces/qdeclarativesupportedcategoriesmodel_p.h @@ -46,6 +46,7 @@ #include <QObject> #include <QtCore/QStringList> +#include <QtCore/QSharedPointer> #include <QAbstractListModel> #include <QQmlListProperty> #include <QtQml/QQmlParserStatus> diff --git a/src/imports/location/location.pro b/src/imports/location/location.pro index e72eacd6..068980c0 100644 --- a/src/imports/location/location.pro +++ b/src/imports/location/location.pro @@ -3,7 +3,7 @@ TARGETPATH = QtLocation include(qlocationimport.pri) -QT += quick-private network location qml-private 3d core-private gui-private +QT += quick-private network location-private qml-private 3d core-private gui-private DESTDIR = $$QT.location.imports/$$TARGETPATH target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH diff --git a/src/imports/location/qdeclarativegeomap.cpp b/src/imports/location/qdeclarativegeomap.cpp index aaf3264e..613358f8 100644 --- a/src/imports/location/qdeclarativegeomap.cpp +++ b/src/imports/location/qdeclarativegeomap.cpp @@ -58,8 +58,8 @@ #include "mapnode_p.h" #include <cmath> -#include <qgeoserviceprovider.h> -#include "qgeomappingmanager.h" +#include <QtLocation/QGeoServiceProvider> +#include <QtLocation/private/qgeomappingmanager_p.h> #include <QtQml/QQmlContext> #include <QtQml/qqmlinfo.h> diff --git a/src/imports/location/qdeclarativegeomaptype_p.h b/src/imports/location/qdeclarativegeomaptype_p.h index d685a12d..394f59ea 100644 --- a/src/imports/location/qdeclarativegeomaptype_p.h +++ b/src/imports/location/qdeclarativegeomaptype_p.h @@ -42,9 +42,9 @@ #ifndef QDECLARATIVEGEOMAPTYPE_H #define QDECLARATIVEGEOMAPTYPE_H +#include <QtCore/QObject> #include <QtQml/qqml.h> -#include "qgeomaptype.h" -#include <QObject> +#include <QtLocation/private/qgeomaptype_p.h> QT_BEGIN_NAMESPACE diff --git a/src/imports/location/qdeclarativegeoserviceprovider.cpp b/src/imports/location/qdeclarativegeoserviceprovider.cpp index 0cdda470..d32f993a 100644 --- a/src/imports/location/qdeclarativegeoserviceprovider.cpp +++ b/src/imports/location/qdeclarativegeoserviceprovider.cpp @@ -40,20 +40,11 @@ ****************************************************************************/ #include "qdeclarativegeoserviceprovider_p.h" -#include "qgeoserviceprovider.h" -#include "qgeocodingmanager.h" -#include "qgeomappingmanager.h" -#include "qgeoroutingmanager.h" -#include <QtCore/QStringList> #include <QtQml/QQmlInfo> -#include <QDebug> - QT_BEGIN_NAMESPACE - - /*! \qmlclass Plugin QDeclarativeGeoServiceProvider \inqmlmodule QtLocation 5 diff --git a/src/imports/location/qdeclarativegeoserviceprovider_p.h b/src/imports/location/qdeclarativegeoserviceprovider_p.h index 46a02bc9..1c4c3b98 100644 --- a/src/imports/location/qdeclarativegeoserviceprovider_p.h +++ b/src/imports/location/qdeclarativegeoserviceprovider_p.h @@ -42,15 +42,14 @@ #ifndef QDECLARATIVEQGEOSERVICEPROVIDER_H #define QDECLARATIVEQGEOSERVICEPROVIDER_H -#include <qgeocoordinate.h> -#include <QtQuick/QQuickItem> +#include <QtCore/QMap> +#include <QtCore/QString> +#include <QtCore/QStringList> +#include <QtCore/QVariant> +#include <QtQml/qqml.h> #include <QtQml/QQmlParserStatus> +#include <QtQml/QQmlListProperty> #include <QtLocation/QGeoServiceProvider> -#include <QtLocation/QPlaceManager> - -#include <QMap> -#include <QString> -#include <QVariant> QT_BEGIN_NAMESPACE diff --git a/src/location/maps/maps.pri b/src/location/maps/maps.pri index a44e129d..d6712587 100644 --- a/src/location/maps/maps.pri +++ b/src/location/maps/maps.pri @@ -4,16 +4,10 @@ INCLUDEPATH += maps QT += 3d PUBLIC_HEADERS += \ - maps/qgeocameracapabilities_p.h \ maps/qgeocodereply.h \ maps/qgeocodingmanagerengine.h \ maps/qgeocodingmanager.h \ maps/qgeomaneuver.h \ - maps/qgeotilefetcher.h \ - maps/qgeomappingmanager.h \ - maps/qgeomappingmanagerengine.h \ - maps/qgeotiledmappingmanagerengine.h \ - maps/qgeomaptype.h \ maps/qgeoroute.h \ maps/qgeoroutereply.h \ maps/qgeorouterequest.h \ @@ -21,13 +15,12 @@ PUBLIC_HEADERS += \ maps/qgeoroutingmanagerengine.h \ maps/qgeoroutingmanager.h \ maps/qgeoserviceproviderfactory.h \ - maps/qgeoserviceprovider.h \ - maps/qgeotiledmapreply.h \ - maps/qgeotilespec.h + maps/qgeoserviceprovider.h PRIVATE_HEADERS += \ maps/qdoublevector2d_p.h \ maps/qdoublevector3d_p.h \ + maps/qgeocameracapabilities_p.h \ maps/qgeocameradata_p.h \ maps/qgeocameratiles_p.h \ maps/qgeocodereply_p.h \ @@ -44,10 +37,15 @@ PRIVATE_HEADERS += \ maps/qgeotiledmapdata_p.h \ maps/qgeotiledmapdata_p_p.h \ maps/qgeotilefetcher_p.h \ + maps/qgeotilefetcher_p_p.h \ maps/qgeomappingmanager_p.h \ + maps/qgeomappingmanager_p_p.h \ maps/qgeomappingmanagerengine_p.h \ + maps/qgeomappingmanagerengine_p_p.h \ maps/qgeotiledmappingmanagerengine_p.h \ + maps/qgeotiledmappingmanagerengine_p_p.h \ maps/qgeomaptype_p.h \ + maps/qgeomaptype_p_p.h \ maps/qgeoprojection_p.h \ maps/qgeoroute_p.h \ maps/qgeoroutereply_p.h \ @@ -58,7 +56,9 @@ PRIVATE_HEADERS += \ maps/qgeoserviceprovider_p.h \ maps/qgeotilecache_p.h \ maps/qgeotiledmapreply_p.h \ + maps/qgeotiledmapreply_p_p.h \ maps/qgeotilespec_p.h \ + maps/qgeotilespec_p_p.h \ maps/qcache3q_p.h SOURCES += \ diff --git a/src/location/maps/qgeocameracapabilities.cpp b/src/location/maps/qgeocameracapabilities.cpp index 0e6494b8..8b9abc52 100644 --- a/src/location/maps/qgeocameracapabilities.cpp +++ b/src/location/maps/qgeocameracapabilities.cpp @@ -113,6 +113,7 @@ QGeoCameraCapabilitiesPrivate &QGeoCameraCapabilitiesPrivate::operator = (const \inmodule QtLocation \ingroup QtLocation-impl \since Qt Location 5.0 + \internal \brief The QGeoCameraCapabilities class describes the limitations on camera settings imposed by a mapping plugin. diff --git a/src/location/maps/qgeocameracapabilities_p.h b/src/location/maps/qgeocameracapabilities_p.h index ef7ef8bf..b949d3f9 100644 --- a/src/location/maps/qgeocameracapabilities_p.h +++ b/src/location/maps/qgeocameracapabilities_p.h @@ -38,6 +38,7 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + #ifndef QGEOCAMERACAPABILITIES_P_H #define QGEOCAMERACAPABILITIES_P_H diff --git a/src/location/maps/qgeocameratiles.cpp b/src/location/maps/qgeocameratiles.cpp index a63420ed..6ee6593f 100644 --- a/src/location/maps/qgeocameratiles.cpp +++ b/src/location/maps/qgeocameratiles.cpp @@ -42,12 +42,12 @@ #include "qgeocameradata_p.h" #include "qgeoprojection_p.h" -#include "qgeotilespec.h" +#include "qgeotilespec_p.h" #include "qdoublevector2d_p.h" #include "qdoublevector3d_p.h" -#include "qgeomaptype.h" +#include "qgeomaptype_p.h" #include <QVector> #include <QMap> diff --git a/src/location/maps/qgeomap.cpp b/src/location/maps/qgeomap.cpp index ad81fd13..8a65c0db 100644 --- a/src/location/maps/qgeomap.cpp +++ b/src/location/maps/qgeomap.cpp @@ -43,7 +43,7 @@ #include "qgeomapdata_p.h" #include "qgeotilecache_p.h" -#include "qgeotilespec.h" +#include "qgeotilespec_p.h" #include "qgeoprojection_p.h" #include "qgeocameracapabilities_p.h" #include "qgeomapcontroller_p.h" @@ -54,7 +54,7 @@ #include "qgeotilerequestmanager_p.h" #include "qgeomapscene_p.h" -#include "qgeomappingmanager.h" +#include "qgeomappingmanager_p.h" #include <QMutex> #include <QMap> diff --git a/src/location/maps/qgeomap_p.h b/src/location/maps/qgeomap_p.h index a16ad7d6..3ef02599 100644 --- a/src/location/maps/qgeomap_p.h +++ b/src/location/maps/qgeomap_p.h @@ -55,7 +55,7 @@ #include <QObject> #include "qgeocameradata_p.h" -#include "qgeomaptype.h" +#include "qgeomaptype_p.h" #include "qgeocoordinateinterpolator_p.h" QT_BEGIN_NAMESPACE diff --git a/src/location/maps/qgeomapdata.cpp b/src/location/maps/qgeomapdata.cpp index 1f0d5cc6..353b5144 100644 --- a/src/location/maps/qgeomapdata.cpp +++ b/src/location/maps/qgeomapdata.cpp @@ -43,7 +43,7 @@ #include "qgeomap_p.h" #include "qgeotilecache_p.h" -#include "qgeotilespec.h" +#include "qgeotilespec_p.h" #include "qgeoprojection_p.h" #include "qgeocameracapabilities_p.h" #include "qgeomapcontroller_p.h" @@ -54,7 +54,7 @@ #include "qgeotilerequestmanager_p.h" #include "qgeomapscene_p.h" -#include "qgeomappingmanager.h" +#include "qgeomappingmanager_p.h" #include <QMutex> #include <QMap> diff --git a/src/location/maps/qgeomapdata_p.h b/src/location/maps/qgeomapdata_p.h index 4be785d6..540b1638 100644 --- a/src/location/maps/qgeomapdata_p.h +++ b/src/location/maps/qgeomapdata_p.h @@ -55,7 +55,7 @@ #include <QObject> #include "qgeocameradata_p.h" -#include "qgeomaptype.h" +#include "qgeomaptype_p.h" #include "qgeocoordinateinterpolator_p.h" #include "qgeocoordinateinterpolator_p.h" diff --git a/src/location/maps/qgeomapdata_p_p.h b/src/location/maps/qgeomapdata_p_p.h index cf6d2909..5cfe9bc5 100644 --- a/src/location/maps/qgeomapdata_p_p.h +++ b/src/location/maps/qgeomapdata_p_p.h @@ -63,7 +63,7 @@ #include <QSharedPointer> #include "qgeocameradata_p.h" -#include "qgeomaptype.h" +#include "qgeomaptype_p.h" #include "qdoublevector3d_p.h" diff --git a/src/location/maps/qgeomappingmanager.cpp b/src/location/maps/qgeomappingmanager.cpp index 5d2f77dd..2fc5cc84 100644 --- a/src/location/maps/qgeomappingmanager.cpp +++ b/src/location/maps/qgeomappingmanager.cpp @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#include "qgeomappingmanager.h" #include "qgeomappingmanager_p.h" -#include "qgeomappingmanagerengine.h" -#include "qgeotiledmapreply.h" +#include "qgeomappingmanager_p_p.h" +#include "qgeomappingmanagerengine_p.h" +#include "qgeotiledmapreply_p.h" #include "qgeocameracapabilities_p.h" @@ -58,6 +58,7 @@ QT_BEGIN_NAMESPACE \inmodule QtLocation \ingroup QtLocation-maps \since Qt Location 5.0 + \internal \brief The QGeoMappingManager class provides support for displaying and interacting with maps. @@ -190,6 +191,6 @@ QGeoMappingManagerPrivate::~QGeoMappingManagerPrivate() engine = 0; } -#include "moc_qgeomappingmanager.cpp" +#include "moc_qgeomappingmanager_p.cpp" QT_END_NAMESPACE diff --git a/src/location/maps/qgeomappingmanager_p.h b/src/location/maps/qgeomappingmanager_p.h index df61fb0d..2b04a0e7 100644 --- a/src/location/maps/qgeomappingmanager_p.h +++ b/src/location/maps/qgeomappingmanager_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QGEOMAPPINGMANAGER_P_H -#define QGEOMAPPINGMANAGER_P_H +#ifndef QGEOMAPPINGMANAGER_H +#define QGEOMAPPINGMANAGER_H // // W A R N I N G @@ -53,26 +53,63 @@ // We mean it. // +#include <QObject> #include <QSize> -#include <QList> -#include <QHash> -#include <QSet> -#include <QThread> +#include <QPair> +#include <QtLocation/qlocationglobal.h> +#include "qgeomaptype_p.h" + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QGeoMappingManagerPrivate +class QGeoMap; +class QLocale; +class QGeoBoundingBox; +class QGeoCoordinate; +class QGeoMappingManagerPrivate; +class QGeoMapRequestOptions; +class QGeoMappingManagerEngine; +class QGeoCameraCapabilities; + + +class Q_LOCATION_EXPORT QGeoMappingManager : public QObject { + Q_OBJECT + public: - QGeoMappingManagerPrivate(); - ~QGeoMappingManagerPrivate(); + ~QGeoMappingManager(); + + QString managerName() const; + int managerVersion() const; + + QGeoMap *createMap(QObject *parent); + + QList<QGeoMapType> supportedMapTypes() const; - QGeoMappingManagerEngine *engine; + bool isInitialized() const; + + QGeoCameraCapabilities cameraCapabilities() const; + + void setLocale(const QLocale &locale); + QLocale locale() const; + +Q_SIGNALS: + void initialized(); + +protected: + QGeoMappingManager(QGeoMappingManagerEngine *engine, QObject *parent = 0); private: - Q_DISABLE_COPY(QGeoMappingManagerPrivate) + QGeoMappingManagerPrivate *d_ptr; + Q_DISABLE_COPY(QGeoMappingManager) + + friend class QGeoServiceProvider; + friend class QGeoServiceProviderPrivate; }; QT_END_NAMESPACE +QT_END_HEADER + #endif diff --git a/src/location/maps/qgeomappingmanager_p_p.h b/src/location/maps/qgeomappingmanager_p_p.h new file mode 100644 index 00000000..df61fb0d --- /dev/null +++ b/src/location/maps/qgeomappingmanager_p_p.h @@ -0,0 +1,78 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtLocation module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QGEOMAPPINGMANAGER_P_H +#define QGEOMAPPINGMANAGER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QSize> +#include <QList> +#include <QHash> +#include <QSet> +#include <QThread> + +QT_BEGIN_NAMESPACE + +class QGeoMappingManagerPrivate +{ +public: + QGeoMappingManagerPrivate(); + ~QGeoMappingManagerPrivate(); + + QGeoMappingManagerEngine *engine; + +private: + Q_DISABLE_COPY(QGeoMappingManagerPrivate) +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/location/maps/qgeomappingmanagerengine.cpp b/src/location/maps/qgeomappingmanagerengine.cpp index 895ce2f4..5b2932e0 100644 --- a/src/location/maps/qgeomappingmanagerengine.cpp +++ b/src/location/maps/qgeomappingmanagerengine.cpp @@ -39,10 +39,10 @@ ** ****************************************************************************/ -#include "qgeomappingmanagerengine.h" #include "qgeomappingmanagerengine_p.h" -#include "qgeotiledmapreply.h" -#include "qgeotilespec.h" +#include "qgeomappingmanagerengine_p_p.h" +#include "qgeotiledmapreply_p.h" +#include "qgeotilespec_p.h" #include <QThread> @@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE \inmodule QtLocation \ingroup QtLocation-impl \since Qt Location 5.0 + \internal \brief Provides support functionality for map display with QGeoServiceProvider. @@ -206,6 +207,6 @@ QGeoMappingManagerEnginePrivate::QGeoMappingManagerEnginePrivate() QGeoMappingManagerEnginePrivate::~QGeoMappingManagerEnginePrivate() {} -#include "moc_qgeomappingmanagerengine.cpp" +#include "moc_qgeomappingmanagerengine_p.cpp" QT_END_NAMESPACE diff --git a/src/location/maps/qgeomappingmanagerengine.h b/src/location/maps/qgeomappingmanagerengine.h deleted file mode 100644 index 773cd3d5..00000000 --- a/src/location/maps/qgeomappingmanagerengine.h +++ /dev/null @@ -1,123 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtLocation module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QGEOMAPPINGMANAGERENGINE_H -#define QGEOMAPPINGMANAGERENGINE_H - -#include <QObject> -#include <QSize> -#include <QPair> -#include <QSet> -#include <QList> -#include <QMap> -#include <QString> -#include <QVariant> -#include <QtLocation/qlocationglobal.h> -#include "qgeomaptype.h" -#include "qgeomappingmanager.h" - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - - - -class QLocale; - -class QGeoBoundingBox; -class QGeoCoordinate; -class QGeoMappingManagerPrivate; -class QGeoMapRequestOptions; - -class QGeoMappingManagerEnginePrivate; -class QGeoMapData; - -class Q_LOCATION_EXPORT QGeoMappingManagerEngine : public QObject -{ - Q_OBJECT - -public: - explicit QGeoMappingManagerEngine(QObject *parent = 0); - virtual ~QGeoMappingManagerEngine(); - - virtual QGeoMapData *createMapData() = 0; - - QMap<QString, QVariant> parameters() const; - - QString managerName() const; - int managerVersion() const; - - QList<QGeoMapType> supportedMapTypes() const; - - QGeoCameraCapabilities cameraCapabilities(); - - void setLocale(const QLocale &locale); - QLocale locale() const; - - bool isInitialized() const; - -Q_SIGNALS: - void initialized(); - -protected: - void setSupportedMapTypes(const QList<QGeoMapType> &supportedMapTypes); - void setCameraCapabilities(const QGeoCameraCapabilities &capabilities); - - void engineInitialized(); - -private: - QGeoMappingManagerEnginePrivate *d_ptr; - - void setManagerName(const QString &managerName); - void setManagerVersion(int managerVersion); - - Q_DECLARE_PRIVATE(QGeoMappingManagerEngine) - Q_DISABLE_COPY(QGeoMappingManagerEngine) - - friend class QGeoServiceProvider; - friend class QGeoServiceProviderPrivate; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/location/maps/qgeomappingmanagerengine_p.h b/src/location/maps/qgeomappingmanagerengine_p.h index 93187073..bb9f2471 100644 --- a/src/location/maps/qgeomappingmanagerengine_p.h +++ b/src/location/maps/qgeomappingmanagerengine_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QGEOMAPPINGMANAGERENGINE_P_H -#define QGEOMAPPINGMANAGERENGINE_P_H +#ifndef QGEOMAPPINGMANAGERENGINE_H +#define QGEOMAPPINGMANAGERENGINE_H // // W A R N I N G @@ -53,40 +53,82 @@ // We mean it. // +#include <QObject> #include <QSize> +#include <QPair> +#include <QSet> #include <QList> #include <QMap> -#include <QLocale> -#include <QTimer> -#include <QHash> -#include "qgeomaptype.h" -#include "qgeomappingmanager.h" -#include "qgeocameracapabilities_p.h" +#include <QString> +#include <QVariant> +#include <QtLocation/qlocationglobal.h> +#include "qgeomaptype_p.h" +#include "qgeomappingmanager_p.h" + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QGeoTileSpec; -class QGeoTiledMapReply; -class QGeoMappingManagerEnginePrivate + +class QLocale; + +class QGeoBoundingBox; +class QGeoCoordinate; +class QGeoMappingManagerPrivate; +class QGeoMapRequestOptions; + +class QGeoMappingManagerEnginePrivate; +class QGeoMapData; + +class Q_LOCATION_EXPORT QGeoMappingManagerEngine : public QObject { + Q_OBJECT + public: - QGeoMappingManagerEnginePrivate(); - ~QGeoMappingManagerEnginePrivate(); + explicit QGeoMappingManagerEngine(QObject *parent = 0); + virtual ~QGeoMappingManagerEngine(); + + virtual QGeoMapData *createMapData() = 0; + + QMap<QString, QVariant> parameters() const; + + QString managerName() const; + int managerVersion() const; - QString managerName; - int managerVersion; + QList<QGeoMapType> supportedMapTypes() const; - QList<QGeoMapType> supportedMapTypes; - QGeoCameraCapabilities capabilities_; + QGeoCameraCapabilities cameraCapabilities(); - QLocale locale; - bool initialized; + void setLocale(const QLocale &locale); + QLocale locale() const; + + bool isInitialized() const; + +Q_SIGNALS: + void initialized(); + +protected: + void setSupportedMapTypes(const QList<QGeoMapType> &supportedMapTypes); + void setCameraCapabilities(const QGeoCameraCapabilities &capabilities); + + void engineInitialized(); private: - Q_DISABLE_COPY(QGeoMappingManagerEnginePrivate) + QGeoMappingManagerEnginePrivate *d_ptr; + + void setManagerName(const QString &managerName); + void setManagerVersion(int managerVersion); + + Q_DECLARE_PRIVATE(QGeoMappingManagerEngine) + Q_DISABLE_COPY(QGeoMappingManagerEngine) + + friend class QGeoServiceProvider; + friend class QGeoServiceProviderPrivate; }; QT_END_NAMESPACE +QT_END_HEADER + #endif diff --git a/src/location/maps/qgeomappingmanager.h b/src/location/maps/qgeomappingmanagerengine_p_p.h index 49fde85f..95301dfd 100644 --- a/src/location/maps/qgeomappingmanager.h +++ b/src/location/maps/qgeomappingmanagerengine_p_p.h @@ -39,66 +39,54 @@ ** ****************************************************************************/ -#ifndef QGEOMAPPINGMANAGER_H -#define QGEOMAPPINGMANAGER_H +#ifndef QGEOMAPPINGMANAGERENGINE_P_H +#define QGEOMAPPINGMANAGERENGINE_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// -#include <QObject> #include <QSize> -#include <QPair> -#include <QtLocation/qlocationglobal.h> -#include "qgeomaptype.h" - -QT_BEGIN_HEADER +#include <QList> +#include <QMap> +#include <QLocale> +#include <QTimer> +#include <QHash> +#include "qgeomaptype_p.h" +#include "qgeomappingmanager_p.h" +#include "qgeocameracapabilities_p.h" QT_BEGIN_NAMESPACE -class QGeoMap; -class QLocale; -class QGeoBoundingBox; -class QGeoCoordinate; -class QGeoMappingManagerPrivate; -class QGeoMapRequestOptions; -class QGeoMappingManagerEngine; -class QGeoCameraCapabilities; - +class QGeoTileSpec; +class QGeoTiledMapReply; -class Q_LOCATION_EXPORT QGeoMappingManager : public QObject +class QGeoMappingManagerEnginePrivate { - Q_OBJECT - public: - ~QGeoMappingManager(); - - QString managerName() const; - int managerVersion() const; - - QGeoMap *createMap(QObject *parent); + QGeoMappingManagerEnginePrivate(); + ~QGeoMappingManagerEnginePrivate(); - QList<QGeoMapType> supportedMapTypes() const; + QString managerName; + int managerVersion; - bool isInitialized() const; + QList<QGeoMapType> supportedMapTypes; + QGeoCameraCapabilities capabilities_; - QGeoCameraCapabilities cameraCapabilities() const; - - void setLocale(const QLocale &locale); - QLocale locale() const; - -Q_SIGNALS: - void initialized(); - -protected: - QGeoMappingManager(QGeoMappingManagerEngine *engine, QObject *parent = 0); + QLocale locale; + bool initialized; private: - QGeoMappingManagerPrivate *d_ptr; - Q_DISABLE_COPY(QGeoMappingManager) - - friend class QGeoServiceProvider; - friend class QGeoServiceProviderPrivate; + Q_DISABLE_COPY(QGeoMappingManagerEnginePrivate) }; QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/location/maps/qgeomapscene.cpp b/src/location/maps/qgeomapscene.cpp index 7aea014d..9ba9ed9c 100644 --- a/src/location/maps/qgeomapscene.cpp +++ b/src/location/maps/qgeomapscene.cpp @@ -43,7 +43,7 @@ #include "qgeocameradata_p.h" #include "qgeoprojection_p.h" #include "qgeotilecache_p.h" -#include "qgeotilespec.h" +#include "qgeotilespec_p.h" #include "qdoublevector2d_p.h" #include "qdoublevector3d_p.h" diff --git a/src/location/maps/qgeomaptype.cpp b/src/location/maps/qgeomaptype.cpp index bfa99100..21cf059a 100644 --- a/src/location/maps/qgeomaptype.cpp +++ b/src/location/maps/qgeomaptype.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qgeomaptype.h" #include "qgeomaptype_p.h" +#include "qgeomaptype_p_p.h" QT_BEGIN_NAMESPACE diff --git a/src/location/maps/qgeomaptype_p.h b/src/location/maps/qgeomaptype_p.h index 26cbb798..93c9aab8 100644 --- a/src/location/maps/qgeomaptype_p.h +++ b/src/location/maps/qgeomaptype_p.h @@ -38,8 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#ifndef QGEOMAPTYPE_P_H -#define QGEOMAPTYPE_P_H + +#ifndef QGEOMAPTYPE_H +#define QGEOMAPTYPE_H // // W A R N I N G @@ -52,36 +53,54 @@ // We mean it. // -#include <QMetaType> +#include <QtLocation/qlocationglobal.h> #include <QString> -#include <QSharedData> +#include <QSharedDataPointer> -#include "qgeomaptype.h" +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QGeoMapTypePrivate : public QSharedData +class QGeoMapTypePrivate; + +class Q_LOCATION_EXPORT QGeoMapType { public: - QGeoMapTypePrivate(); - QGeoMapTypePrivate(QGeoMapType::MapStyle style, const QString &name, const QString &description, bool mobile, int mapId); - QGeoMapTypePrivate(const QGeoMapTypePrivate &other); - ~QGeoMapTypePrivate(); + enum MapStyle { + NoMap = 0, + StreetMap, + SatelliteMapDay, + SatelliteMapNight, + TerrainMap, + HybridMap, + TransitMap, + GrayStreetMap, + CustomMap = 100 + }; + + QGeoMapType(); + QGeoMapType(const QGeoMapType &other); + QGeoMapType(MapStyle style, const QString &name, const QString &description, bool mobile, int mapId); + ~QGeoMapType(); + + QGeoMapType &operator = (const QGeoMapType &other); - QGeoMapTypePrivate &operator = (const QGeoMapTypePrivate &other); + bool operator == (const QGeoMapType &other) const; + bool operator != (const QGeoMapType &other) const; - bool operator == (const QGeoMapTypePrivate &other) const; + MapStyle style() const; + QString name() const; + QString description() const; + bool mobile() const; + int mapId() const; - QGeoMapType::MapStyle style_; - QString name_; - QString description_; - bool mobile_; - int mapId_; +private: + QSharedDataPointer<QGeoMapTypePrivate> d_ptr; }; QT_END_NAMESPACE -Q_DECLARE_METATYPE(QGeoMapTypePrivate) +QT_END_HEADER -#endif // QGEOMAPTYPE_P_H +#endif // QGEOMAPTYPE_H diff --git a/src/location/maps/qgeomaptype.h b/src/location/maps/qgeomaptype_p_p.h index 82e21d6e..7dd0fd4c 100644 --- a/src/location/maps/qgeomaptype.h +++ b/src/location/maps/qgeomaptype_p_p.h @@ -38,58 +38,50 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ +#ifndef QGEOMAPTYPE_P_H +#define QGEOMAPTYPE_P_H -#ifndef QGEOMAPTYPE_H -#define QGEOMAPTYPE_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// -#include <QtLocation/qlocationglobal.h> +#include <QMetaType> #include <QString> -#include <QSharedDataPointer> +#include <QSharedData> -QT_BEGIN_HEADER +#include "qgeomaptype_p.h" QT_BEGIN_NAMESPACE -class QGeoMapTypePrivate; - -class Q_LOCATION_EXPORT QGeoMapType +class QGeoMapTypePrivate : public QSharedData { public: - enum MapStyle { - NoMap = 0, - StreetMap, - SatelliteMapDay, - SatelliteMapNight, - TerrainMap, - HybridMap, - TransitMap, - GrayStreetMap, - CustomMap = 100 - }; - - QGeoMapType(); - QGeoMapType(const QGeoMapType &other); - QGeoMapType(MapStyle style, const QString &name, const QString &description, bool mobile, int mapId); - ~QGeoMapType(); - - QGeoMapType &operator = (const QGeoMapType &other); + QGeoMapTypePrivate(); + QGeoMapTypePrivate(QGeoMapType::MapStyle style, const QString &name, const QString &description, bool mobile, int mapId); + QGeoMapTypePrivate(const QGeoMapTypePrivate &other); + ~QGeoMapTypePrivate(); - bool operator == (const QGeoMapType &other) const; - bool operator != (const QGeoMapType &other) const; + QGeoMapTypePrivate &operator = (const QGeoMapTypePrivate &other); - MapStyle style() const; - QString name() const; - QString description() const; - bool mobile() const; - int mapId() const; + bool operator == (const QGeoMapTypePrivate &other) const; -private: - QSharedDataPointer<QGeoMapTypePrivate> d_ptr; + QGeoMapType::MapStyle style_; + QString name_; + QString description_; + bool mobile_; + int mapId_; }; QT_END_NAMESPACE -QT_END_HEADER +Q_DECLARE_METATYPE(QGeoMapTypePrivate) -#endif // QGEOMAPTYPE_H +#endif // QGEOMAPTYPE_P_H diff --git a/src/location/maps/qgeoserviceprovider.cpp b/src/location/maps/qgeoserviceprovider.cpp index 85c7a7cc..12d4104d 100644 --- a/src/location/maps/qgeoserviceprovider.cpp +++ b/src/location/maps/qgeoserviceprovider.cpp @@ -44,11 +44,11 @@ #include "qgeoserviceproviderfactory.h" #include "qgeocodingmanager.h" -#include "qgeomappingmanager.h" +#include "qgeomappingmanager_p.h" #include "qgeoroutingmanager.h" #include "qplacemanager.h" #include "qgeocodingmanagerengine.h" -#include "qgeomappingmanagerengine.h" +#include "qgeomappingmanagerengine_p.h" #include "qgeoroutingmanagerengine.h" #include "qplacemanagerengine.h" #include "qplacemanagerengine_p.h" @@ -336,6 +336,8 @@ QGeocodingManager *QGeoServiceProvider::geocodingManager() const After this function has been called, error() and errorString() will report any errors which occurred during the construction of the QGeoMappingManager. + + \internal */ QGeoMappingManager *QGeoServiceProvider::mappingManager() const { diff --git a/src/location/maps/qgeotilecache.cpp b/src/location/maps/qgeotilecache.cpp index 608110be..00401e9a 100644 --- a/src/location/maps/qgeotilecache.cpp +++ b/src/location/maps/qgeotilecache.cpp @@ -40,9 +40,9 @@ ****************************************************************************/ #include "qgeotilecache_p.h" -#include "qgeotilespec.h" +#include "qgeotilespec_p.h" -#include "qgeomappingmanager.h" +#include "qgeomappingmanager_p.h" #include <QDir> #include <QMetaType> diff --git a/src/location/maps/qgeotilecache_p.h b/src/location/maps/qgeotilecache_p.h index 774f0a0b..ded4eeb7 100644 --- a/src/location/maps/qgeotilecache_p.h +++ b/src/location/maps/qgeotilecache_p.h @@ -61,8 +61,8 @@ #include <QMutex> #include <QTimer> -#include "qgeotilespec.h" -#include "qgeotiledmappingmanagerengine.h" +#include "qgeotilespec_p.h" +#include "qgeotiledmappingmanagerengine_p.h" QT_BEGIN_NAMESPACE diff --git a/src/location/maps/qgeotiledmapdata.cpp b/src/location/maps/qgeotiledmapdata.cpp index 4e2911d2..558566ac 100644 --- a/src/location/maps/qgeotiledmapdata.cpp +++ b/src/location/maps/qgeotiledmapdata.cpp @@ -41,9 +41,9 @@ #include "qgeotiledmapdata_p.h" #include "qgeotiledmapdata_p_p.h" -#include "qgeotiledmappingmanagerengine.h" +#include "qgeotiledmappingmanagerengine_p.h" #include "qgeotilecache_p.h" -#include "qgeotilespec.h" +#include "qgeotilespec_p.h" #include "qgeoprojection_p.h" #include "qgeocameratiles_p.h" diff --git a/src/location/maps/qgeotiledmapdata_p.h b/src/location/maps/qgeotiledmapdata_p.h index db160fe9..cfacc519 100644 --- a/src/location/maps/qgeotiledmapdata_p.h +++ b/src/location/maps/qgeotiledmapdata_p.h @@ -57,7 +57,7 @@ #include "qgeomapdata_p.h" #include "qgeocameradata_p.h" -#include "qgeomaptype.h" +#include "qgeomaptype_p.h" QT_BEGIN_NAMESPACE diff --git a/src/location/maps/qgeotiledmapdata_p_p.h b/src/location/maps/qgeotiledmapdata_p_p.h index a235e2b0..dc20338c 100644 --- a/src/location/maps/qgeotiledmapdata_p_p.h +++ b/src/location/maps/qgeotiledmapdata_p_p.h @@ -63,7 +63,7 @@ #include <QSharedPointer> #include "qgeocameradata_p.h" -#include "qgeomaptype.h" +#include "qgeomaptype_p.h" #include "qdoublevector3d_p.h" diff --git a/src/location/maps/qgeotiledmappingmanagerengine.cpp b/src/location/maps/qgeotiledmappingmanagerengine.cpp index 653b30e1..a17ace03 100644 --- a/src/location/maps/qgeotiledmappingmanagerengine.cpp +++ b/src/location/maps/qgeotiledmappingmanagerengine.cpp @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#include "qgeotiledmappingmanagerengine.h" #include "qgeotiledmappingmanagerengine_p.h" -#include "qgeotilefetcher.h" +#include "qgeotiledmappingmanagerengine_p_p.h" +#include "qgeotilefetcher_p.h" #include "qgeotiledmapdata_p.h" #include "qgeotilerequestmanager_p.h" #include "qgeotilecache_p.h" -#include "qgeotilespec.h" +#include "qgeotilespec_p.h" #include <QTimer> #include <QLocale> @@ -336,6 +336,6 @@ QGeoTiledMappingManagerEnginePrivate::~QGeoTiledMappingManagerEnginePrivate() thread_->exit(); } -#include "moc_qgeotiledmappingmanagerengine.cpp" +#include "moc_qgeotiledmappingmanagerengine_p.cpp" QT_END_NAMESPACE diff --git a/src/location/maps/qgeotiledmappingmanagerengine.h b/src/location/maps/qgeotiledmappingmanagerengine.h deleted file mode 100644 index 01b2677f..00000000 --- a/src/location/maps/qgeotiledmappingmanagerengine.h +++ /dev/null @@ -1,135 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtLocation module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -** This file is part of the Nokia services plugin for the Maps and -** Navigation API. The use of these services, whether by use of the -** plugin or by other means, is governed by the terms and conditions -** described by the file NOKIA_TERMS_AND_CONDITIONS.txt in -** this package, located in the directory containing the Nokia services -** plugin source code. -** -****************************************************************************/ - -#ifndef QGEOTILEDMAPPINGMANAGERENGINE_H -#define QGEOTILEDMAPPINGMANAGERENGINE_H - -#include <QObject> -#include <QSize> -#include <QPair> -#include <QtLocation/qlocationglobal.h> -#include "qgeomaptype.h" -#include "qgeomappingmanagerengine.h" - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QGeoTiledMappingManagerEnginePrivate; -class QGeoMapRequestOptions; -class QGeoTileFetcher; -class QGeoTileTexture; - -class QGeoTileSpec; -class QGeoTiledMapData; -class QGeoTileCache; - -class Q_LOCATION_EXPORT QGeoTiledMappingManagerEngine : public QGeoMappingManagerEngine -{ - Q_OBJECT - -public: - enum CacheArea { - DiskCache = 0x01, - MemoryCache = 0x02, - AllCaches = 0xFF - }; - Q_DECLARE_FLAGS(CacheAreas, CacheArea) - - explicit QGeoTiledMappingManagerEngine(QObject *parent = 0); - virtual ~QGeoTiledMappingManagerEngine(); - - QGeoTileFetcher *tileFetcher(); - - virtual QGeoMap *createMap(QObject *parent); - - void registerMap(QGeoTiledMapData *map); - void deregisterMap(QGeoTiledMapData *map); - - QSize tileSize() const; - - void updateTileRequests(QGeoTiledMapData *map, - const QSet<QGeoTileSpec> &tilesAdded, - const QSet<QGeoTileSpec> &tilesRemoved); - - QGeoTileCache *tileCache(); // TODO: check this is still used - QSharedPointer<QGeoTileTexture> getTileTexture(const QGeoTileSpec &spec); - - - QGeoTiledMappingManagerEngine::CacheAreas cacheHint() const; - -private Q_SLOTS: - void engineTileFinished(const QGeoTileSpec &spec, const QByteArray &bytes, const QString &format); - void engineTileError(const QGeoTileSpec &spec, const QString &errorString); - -Q_SIGNALS: - void tileError(const QGeoTileSpec &spec, const QString &errorString); - -protected: - void setTileFetcher(QGeoTileFetcher *fetcher); - void setTileSize(const QSize &tileSize); - void setCacheHint(QGeoTiledMappingManagerEngine::CacheAreas cacheHint); - - QGeoTileCache *createTileCacheWithDir(const QString &cacheDirectory); - -private: - QGeoTiledMappingManagerEnginePrivate *d_ptr; - - Q_DECLARE_PRIVATE(QGeoTiledMappingManagerEngine) - Q_DISABLE_COPY(QGeoTiledMappingManagerEngine) - - friend class QGeoTileFetcher; -}; - -Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoTiledMappingManagerEngine::CacheAreas) - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/location/maps/qgeotiledmappingmanagerengine_p.h b/src/location/maps/qgeotiledmappingmanagerengine_p.h index 07b2d5d4..2d38481c 100644 --- a/src/location/maps/qgeotiledmappingmanagerengine_p.h +++ b/src/location/maps/qgeotiledmappingmanagerengine_p.h @@ -37,56 +37,99 @@ ** ** $QT_END_LICENSE$ ** +** This file is part of the Nokia services plugin for the Maps and +** Navigation API. The use of these services, whether by use of the +** plugin or by other means, is governed by the terms and conditions +** described by the file NOKIA_TERMS_AND_CONDITIONS.txt in +** this package, located in the directory containing the Nokia services +** plugin source code. +** ****************************************************************************/ +#ifndef QGEOTILEDMAPPINGMANAGERENGINE_H +#define QGEOTILEDMAPPINGMANAGERENGINE_H -#ifndef QGEOTILEDMAPPINGMANAGER_P_H -#define QGEOTILEDMAPPINGMANAGER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - +#include <QObject> #include <QSize> -#include <QList> -#include <QHash> -#include <QSet> -#include <QThread> -#include "qgeotiledmappingmanagerengine.h" +#include <QPair> +#include <QtLocation/qlocationglobal.h> +#include "qgeomaptype_p.h" +#include "qgeomappingmanagerengine_p.h" + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE +class QGeoTiledMappingManagerEnginePrivate; +class QGeoMapRequestOptions; +class QGeoTileFetcher; +class QGeoTileTexture; + +class QGeoTileSpec; class QGeoTiledMapData; class QGeoTileCache; -class QGeoTileSpec; -class QGeoTileFetcher; -class QGeoTiledMappingManagerEnginePrivate +class Q_LOCATION_EXPORT QGeoTiledMappingManagerEngine : public QGeoMappingManagerEngine { + Q_OBJECT + public: - QGeoTiledMappingManagerEnginePrivate(); - ~QGeoTiledMappingManagerEnginePrivate(); - - QThread *thread_; - QSize tileSize_; - QSet<QGeoTiledMapData *> tileMaps_; - QHash<QGeoTiledMapData *, QSet<QGeoTileSpec> > mapHash_; - QHash<QGeoTileSpec, QSet<QGeoTiledMapData *> > tileHash_; - QGeoTiledMappingManagerEngine::CacheAreas cacheHint_; - QGeoTileCache *tileCache_; - QGeoTileFetcher *fetcher_; + enum CacheArea { + DiskCache = 0x01, + MemoryCache = 0x02, + AllCaches = 0xFF + }; + Q_DECLARE_FLAGS(CacheAreas, CacheArea) + + explicit QGeoTiledMappingManagerEngine(QObject *parent = 0); + virtual ~QGeoTiledMappingManagerEngine(); + + QGeoTileFetcher *tileFetcher(); + + virtual QGeoMap *createMap(QObject *parent); + + void registerMap(QGeoTiledMapData *map); + void deregisterMap(QGeoTiledMapData *map); + + QSize tileSize() const; + + void updateTileRequests(QGeoTiledMapData *map, + const QSet<QGeoTileSpec> &tilesAdded, + const QSet<QGeoTileSpec> &tilesRemoved); + + QGeoTileCache *tileCache(); // TODO: check this is still used + QSharedPointer<QGeoTileTexture> getTileTexture(const QGeoTileSpec &spec); + + + QGeoTiledMappingManagerEngine::CacheAreas cacheHint() const; + +private Q_SLOTS: + void engineTileFinished(const QGeoTileSpec &spec, const QByteArray &bytes, const QString &format); + void engineTileError(const QGeoTileSpec &spec, const QString &errorString); + +Q_SIGNALS: + void tileError(const QGeoTileSpec &spec, const QString &errorString); + +protected: + void setTileFetcher(QGeoTileFetcher *fetcher); + void setTileSize(const QSize &tileSize); + void setCacheHint(QGeoTiledMappingManagerEngine::CacheAreas cacheHint); + + QGeoTileCache *createTileCacheWithDir(const QString &cacheDirectory); private: - Q_DISABLE_COPY(QGeoTiledMappingManagerEnginePrivate) + QGeoTiledMappingManagerEnginePrivate *d_ptr; + + Q_DECLARE_PRIVATE(QGeoTiledMappingManagerEngine) + Q_DISABLE_COPY(QGeoTiledMappingManagerEngine) + + friend class QGeoTileFetcher; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoTiledMappingManagerEngine::CacheAreas) + QT_END_NAMESPACE +QT_END_HEADER + #endif diff --git a/src/location/maps/qgeotiledmapreply.h b/src/location/maps/qgeotiledmappingmanagerengine_p_p.h index 88c5e9e4..b9f7943c 100644 --- a/src/location/maps/qgeotiledmapreply.h +++ b/src/location/maps/qgeotiledmappingmanagerengine_p_p.h @@ -39,71 +39,54 @@ ** ****************************************************************************/ -#ifndef QGEOTILEDMAPREPLY_H -#define QGEOTILEDMAPREPLY_H -#include <QtLocation/qlocationglobal.h> - -#include <QObject> - -QT_BEGIN_HEADER +#ifndef QGEOTILEDMAPPINGMANAGER_P_H +#define QGEOTILEDMAPPINGMANAGER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QSize> +#include <QList> +#include <QHash> +#include <QSet> +#include <QThread> +#include "qgeotiledmappingmanagerengine_p.h" QT_BEGIN_NAMESPACE - - +class QGeoTiledMapData; +class QGeoTileCache; class QGeoTileSpec; -class QGeoTiledMapReplyPrivate; +class QGeoTileFetcher; -class Q_LOCATION_EXPORT QGeoTiledMapReply : public QObject +class QGeoTiledMappingManagerEnginePrivate { - Q_OBJECT - public: - enum Error { - NoError, - CommunicationError, - ParseError, - UnknownError - }; - - QGeoTiledMapReply(const QGeoTileSpec &spec, QObject *parent = 0); - QGeoTiledMapReply(Error error, const QString &errorString, QObject *parent = 0); - virtual ~QGeoTiledMapReply(); - - bool isFinished() const; - Error error() const; - QString errorString() const; - - bool isCached() const; - - QGeoTileSpec tileSpec() const; - - QByteArray mapImageData() const; - QString mapImageFormat() const; - - virtual void abort(); - -Q_SIGNALS: - void finished(); - void error(QGeoTiledMapReply::Error error, const QString &errorString = QString()); - -protected: - void setError(Error error, const QString &errorString); - void setFinished(bool finished); - - void setCached(bool cached); - - void setMapImageData(const QByteArray &data); - void setMapImageFormat(const QString &format); + QGeoTiledMappingManagerEnginePrivate(); + ~QGeoTiledMappingManagerEnginePrivate(); + + QThread *thread_; + QSize tileSize_; + QSet<QGeoTiledMapData *> tileMaps_; + QHash<QGeoTiledMapData *, QSet<QGeoTileSpec> > mapHash_; + QHash<QGeoTileSpec, QSet<QGeoTiledMapData *> > tileHash_; + QGeoTiledMappingManagerEngine::CacheAreas cacheHint_; + QGeoTileCache *tileCache_; + QGeoTileFetcher *fetcher_; private: - QGeoTiledMapReplyPrivate *d_ptr; - Q_DISABLE_COPY(QGeoTiledMapReply) + Q_DISABLE_COPY(QGeoTiledMappingManagerEnginePrivate) }; QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/location/maps/qgeotiledmapreply.cpp b/src/location/maps/qgeotiledmapreply.cpp index 56e7ad91..9b6c58fc 100644 --- a/src/location/maps/qgeotiledmapreply.cpp +++ b/src/location/maps/qgeotiledmapreply.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qgeotiledmapreply.h" #include "qgeotiledmapreply_p.h" +#include "qgeotiledmapreply_p_p.h" #include <qdebug.h> @@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE \inmodule QtLocation \ingroup QtLocation-impl \since Qt Location 5.0 + \internal \brief The QGeoTiledMapReply class manages a tile fetch operation started by an instance of QGeoTiledManagerEngine. @@ -318,6 +319,6 @@ QGeoTiledMapReplyPrivate::QGeoTiledMapReplyPrivate(QGeoTiledMapReply::Error erro QGeoTiledMapReplyPrivate::~QGeoTiledMapReplyPrivate() {} -#include "moc_qgeotiledmapreply.cpp" +#include "moc_qgeotiledmapreply_p.cpp" QT_END_NAMESPACE diff --git a/src/location/maps/qgeotiledmapreply_p.h b/src/location/maps/qgeotiledmapreply_p.h index 8584465e..8544227f 100644 --- a/src/location/maps/qgeotiledmapreply_p.h +++ b/src/location/maps/qgeotiledmapreply_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QGEOTILEDMAPREPLY_P_H -#define QGEOTILEDMAPREPLY_P_H +#ifndef QGEOTILEDMAPREPLY_H +#define QGEOTILEDMAPREPLY_H // // W A R N I N G @@ -53,28 +53,68 @@ // We mean it. // -#include "qgeotiledmapreply.h" -#include "qgeotilespec.h" +#include <QtLocation/qlocationglobal.h> + +#include <QObject> + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QGeoTiledMapReplyPrivate + + +class QGeoTileSpec; +class QGeoTiledMapReplyPrivate; + +class Q_LOCATION_EXPORT QGeoTiledMapReply : public QObject { + Q_OBJECT + public: - QGeoTiledMapReplyPrivate(const QGeoTileSpec &spec); - QGeoTiledMapReplyPrivate(QGeoTiledMapReply::Error error, const QString &errorString); - ~QGeoTiledMapReplyPrivate(); - - QGeoTiledMapReply::Error error; - QString errorString; - bool isFinished; - bool isCached; - - QGeoTileSpec spec; - QByteArray mapImageData; - QString mapImageFormat; + enum Error { + NoError, + CommunicationError, + ParseError, + UnknownError + }; + + QGeoTiledMapReply(const QGeoTileSpec &spec, QObject *parent = 0); + QGeoTiledMapReply(Error error, const QString &errorString, QObject *parent = 0); + virtual ~QGeoTiledMapReply(); + + bool isFinished() const; + Error error() const; + QString errorString() const; + + bool isCached() const; + + QGeoTileSpec tileSpec() const; + + QByteArray mapImageData() const; + QString mapImageFormat() const; + + virtual void abort(); + +Q_SIGNALS: + void finished(); + void error(QGeoTiledMapReply::Error error, const QString &errorString = QString()); + +protected: + void setError(Error error, const QString &errorString); + void setFinished(bool finished); + + void setCached(bool cached); + + void setMapImageData(const QByteArray &data); + void setMapImageFormat(const QString &format); + +private: + QGeoTiledMapReplyPrivate *d_ptr; + Q_DISABLE_COPY(QGeoTiledMapReply) }; QT_END_NAMESPACE +QT_END_HEADER + #endif diff --git a/src/location/maps/qgeotiledmapreply_p_p.h b/src/location/maps/qgeotiledmapreply_p_p.h new file mode 100644 index 00000000..62cebb7f --- /dev/null +++ b/src/location/maps/qgeotiledmapreply_p_p.h @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtLocation module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QGEOTILEDMAPREPLY_P_H +#define QGEOTILEDMAPREPLY_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include "qgeotiledmapreply_p.h" +#include "qgeotilespec_p.h" + +QT_BEGIN_NAMESPACE + +class QGeoTiledMapReplyPrivate +{ +public: + QGeoTiledMapReplyPrivate(const QGeoTileSpec &spec); + QGeoTiledMapReplyPrivate(QGeoTiledMapReply::Error error, const QString &errorString); + ~QGeoTiledMapReplyPrivate(); + + QGeoTiledMapReply::Error error; + QString errorString; + bool isFinished; + bool isCached; + + QGeoTileSpec spec; + QByteArray mapImageData; + QString mapImageFormat; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/location/maps/qgeotilefetcher.cpp b/src/location/maps/qgeotilefetcher.cpp index d27964ee..e8cca712 100644 --- a/src/location/maps/qgeotilefetcher.cpp +++ b/src/location/maps/qgeotilefetcher.cpp @@ -39,11 +39,11 @@ ** ****************************************************************************/ -#include "qgeomappingmanagerengine.h" -#include "qgeotilefetcher.h" +#include "qgeomappingmanagerengine_p.h" #include "qgeotilefetcher_p.h" -#include "qgeotiledmapreply.h" -#include "qgeotilespec.h" +#include "qgeotilefetcher_p_p.h" +#include "qgeotiledmapreply_p.h" +#include "qgeotilespec_p.h" #include "qgeotiledmapdata_p.h" QT_BEGIN_NAMESPACE diff --git a/src/location/maps/qgeotilefetcher.h b/src/location/maps/qgeotilefetcher.h deleted file mode 100644 index d87bd4e3..00000000 --- a/src/location/maps/qgeotilefetcher.h +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/ -** -** This file is part of the QtLocation module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this -** file. Please review the following information to ensure the GNU Lesser -** General Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU General -** Public License version 3.0 as published by the Free Software Foundation -** and appearing in the file LICENSE.GPL included in the packaging of this -** file. Please review the following information to ensure the GNU General -** Public License version 3.0 requirements will be met: -** http://www.gnu.org/copyleft/gpl.html. -** -** Other Usage -** Alternatively, this file may be used in accordance with the terms and -** conditions contained in a signed written agreement between you and Nokia. -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QGEOTILEFETCHER_H -#define QGEOTILEFETCHER_H - -#include <QObject> -#include <qlocationglobal.h> -#include "qgeomaptype.h" -#include "qgeotiledmappingmanagerengine.h" - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -class QGeoMapRequestOptions; - -class QGeoTileFetcherPrivate; -class QGeoTiledMappingManagerEngine; -class QGeoTiledMapReply; -class QGeoTileSpec; - -class Q_LOCATION_EXPORT QGeoTileFetcher : public QObject -{ - Q_OBJECT - -public: - QGeoTileFetcher(QGeoTiledMappingManagerEngine *engine, QObject *parent = 0); - virtual ~QGeoTileFetcher(); - void stopTimer(); - -public Q_SLOTS: - void threadStarted(); - void threadFinished(); - void updateTileRequests(const QSet<QGeoTileSpec> &tilesAdded, const QSet<QGeoTileSpec> &tilesRemoved); - -private Q_SLOTS: - void cancelTileRequests(const QSet<QGeoTileSpec> &tiles); - void requestNextTile(); - void finished(); - -Q_SIGNALS: - void tileFinished(const QGeoTileSpec &spec, const QByteArray &bytes, const QString &format); - void tileError(const QGeoTileSpec &spec, const QString &errorString); - -protected: - virtual bool init(); - QGeoTiledMappingManagerEngine::CacheAreas cacheHint() const; - -private: - QGeoTileFetcherPrivate *d_ptr; - - virtual QGeoTiledMapReply *getTileImage(const QGeoTileSpec &spec) = 0; - void handleReply(QGeoTiledMapReply *reply, const QGeoTileSpec &spec); - - Q_DECLARE_PRIVATE(QGeoTileFetcher) - Q_DISABLE_COPY(QGeoTileFetcher) - - friend class QGeoTiledMappingManagerEngine; -}; - -QT_END_NAMESPACE - -QT_END_HEADER - -#endif diff --git a/src/location/maps/qgeotilefetcher_p.h b/src/location/maps/qgeotilefetcher_p.h index 68d73233..a2a98aab 100644 --- a/src/location/maps/qgeotilefetcher_p.h +++ b/src/location/maps/qgeotilefetcher_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QGEOTILEFETCHER_P_H -#define QGEOTILEFETCHER_P_H +#ifndef QGEOTILEFETCHER_H +#define QGEOTILEFETCHER_H // // W A R N I N G @@ -53,42 +53,63 @@ // We mean it. // -#include <QSize> -#include <QList> -#include <QMap> -#include <QLocale> -#include <QTimer> -#include <QMutex> -#include <QMutexLocker> -#include <QHash> -#include "qgeomaptype.h" +#include <QObject> +#include <qlocationglobal.h> +#include "qgeomaptype_p.h" +#include "qgeotiledmappingmanagerengine_p.h" + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QGeoTileSpec; -class QGeoTiledMapReply; -class QGeoTileCache; +class QGeoMapRequestOptions; + +class QGeoTileFetcherPrivate; class QGeoTiledMappingManagerEngine; +class QGeoTiledMapReply; +class QGeoTileSpec; -class QGeoTileFetcherPrivate +class Q_LOCATION_EXPORT QGeoTileFetcher : public QObject { + Q_OBJECT + public: - explicit QGeoTileFetcherPrivate(QGeoTiledMappingManagerEngine *engine); - virtual ~QGeoTileFetcherPrivate(); + QGeoTileFetcher(QGeoTiledMappingManagerEngine *engine, QObject *parent = 0); + virtual ~QGeoTileFetcher(); + void stopTimer(); - QGeoTiledMappingManagerEngine *engine_; +public Q_SLOTS: + void threadStarted(); + void threadFinished(); + void updateTileRequests(const QSet<QGeoTileSpec> &tilesAdded, const QSet<QGeoTileSpec> &tilesRemoved); - bool started_; - bool stopped_; - QTimer *timer_; - QMutex queueMutex_; - QList<QGeoTileSpec> queue_; - QHash<QGeoTileSpec, QGeoTiledMapReply *> invmap_; +private Q_SLOTS: + void cancelTileRequests(const QSet<QGeoTileSpec> &tiles); + void requestNextTile(); + void finished(); + +Q_SIGNALS: + void tileFinished(const QGeoTileSpec &spec, const QByteArray &bytes, const QString &format); + void tileError(const QGeoTileSpec &spec, const QString &errorString); + +protected: + virtual bool init(); + QGeoTiledMappingManagerEngine::CacheAreas cacheHint() const; private: - Q_DISABLE_COPY(QGeoTileFetcherPrivate) + QGeoTileFetcherPrivate *d_ptr; + + virtual QGeoTiledMapReply *getTileImage(const QGeoTileSpec &spec) = 0; + void handleReply(QGeoTiledMapReply *reply, const QGeoTileSpec &spec); + + Q_DECLARE_PRIVATE(QGeoTileFetcher) + Q_DISABLE_COPY(QGeoTileFetcher) + + friend class QGeoTiledMappingManagerEngine; }; QT_END_NAMESPACE +QT_END_HEADER + #endif diff --git a/src/location/maps/qgeotilefetcher_p_p.h b/src/location/maps/qgeotilefetcher_p_p.h new file mode 100644 index 00000000..0966a110 --- /dev/null +++ b/src/location/maps/qgeotilefetcher_p_p.h @@ -0,0 +1,94 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/ +** +** This file is part of the QtLocation module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QGEOTILEFETCHER_P_H +#define QGEOTILEFETCHER_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include <QSize> +#include <QList> +#include <QMap> +#include <QLocale> +#include <QTimer> +#include <QMutex> +#include <QMutexLocker> +#include <QHash> +#include "qgeomaptype_p.h" + +QT_BEGIN_NAMESPACE + +class QGeoTileSpec; +class QGeoTiledMapReply; +class QGeoTileCache; +class QGeoTiledMappingManagerEngine; + +class QGeoTileFetcherPrivate +{ +public: + explicit QGeoTileFetcherPrivate(QGeoTiledMappingManagerEngine *engine); + virtual ~QGeoTileFetcherPrivate(); + + QGeoTiledMappingManagerEngine *engine_; + + bool started_; + bool stopped_; + QTimer *timer_; + QMutex queueMutex_; + QList<QGeoTileSpec> queue_; + QHash<QGeoTileSpec, QGeoTiledMapReply *> invmap_; + +private: + Q_DISABLE_COPY(QGeoTileFetcherPrivate) +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/location/maps/qgeotilerequestmanager.cpp b/src/location/maps/qgeotilerequestmanager.cpp index bcce4a22..e4b99cf0 100644 --- a/src/location/maps/qgeotilerequestmanager.cpp +++ b/src/location/maps/qgeotilerequestmanager.cpp @@ -42,9 +42,9 @@ #include <QSharedPointer> #include <QDebug> -#include "qgeotilespec.h" +#include "qgeotilespec_p.h" #include "qgeotiledmapdata_p.h" -#include "qgeotiledmappingmanagerengine.h" +#include "qgeotiledmappingmanagerengine_p.h" #include "qgeotilecache_p.h" QT_BEGIN_NAMESPACE diff --git a/src/location/maps/qgeotilespec.cpp b/src/location/maps/qgeotilespec.cpp index 272d8b1d..d81cd91e 100644 --- a/src/location/maps/qgeotilespec.cpp +++ b/src/location/maps/qgeotilespec.cpp @@ -38,9 +38,11 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#include "qgeotilespec.h" + #include "qgeotilespec_p.h" -#include <QDebug> +#include "qgeotilespec_p_p.h" + +#include <QtCore/QDebug> QT_BEGIN_NAMESPACE diff --git a/src/location/maps/qgeotilespec_p.h b/src/location/maps/qgeotilespec_p.h index 8392e617..065cebe0 100644 --- a/src/location/maps/qgeotilespec_p.h +++ b/src/location/maps/qgeotilespec_p.h @@ -38,8 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#ifndef QGEOTILESPEC_P_H -#define QGEOTILESPEC_P_H + +#ifndef QGEOTILESPEC_H +#define QGEOTILESPEC_H // // W A R N I N G @@ -52,31 +53,57 @@ // We mean it. // +#include <QtLocation/qlocationglobal.h> +#include <QtCore/QMetaType> #include <QString> -#include <QSharedData> + +#include <QSharedDataPointer> + +QT_BEGIN_HEADER QT_BEGIN_NAMESPACE -class QGeoTileSpecPrivate : public QSharedData +class QGeoTileSpecPrivate; + +class Q_LOCATION_EXPORT QGeoTileSpec { public: - QGeoTileSpecPrivate(); - QGeoTileSpecPrivate(const QGeoTileSpecPrivate &other); - QGeoTileSpecPrivate(const QString &plugin, int mapId, int zoom, int x, int y); - ~QGeoTileSpecPrivate(); + QGeoTileSpec(); + QGeoTileSpec(const QGeoTileSpec &other); + QGeoTileSpec(const QString &plugin, int mapId, int zoom, int x, int y); + ~QGeoTileSpec(); + + QGeoTileSpec &operator = (const QGeoTileSpec &other); + + QString plugin() const; + + void setZoom(int zoom); + int zoom() const; - QGeoTileSpecPrivate &operator = (const QGeoTileSpecPrivate &other); + void setX(int x); + int x() const; - bool operator == (const QGeoTileSpecPrivate &rhs) const; - bool operator < (const QGeoTileSpecPrivate &rhs) const; + void setY(int y); + int y() const; - QString plugin_; - int mapId_; - int zoom_; - int x_; - int y_; + void setMapId(int mapId); + int mapId() const; + + bool operator == (const QGeoTileSpec &rhs) const; + bool operator < (const QGeoTileSpec &rhs) const; + +private: + QSharedDataPointer<QGeoTileSpecPrivate> d; }; +Q_LOCATION_EXPORT unsigned int qHash(const QGeoTileSpec &spec); + +Q_LOCATION_EXPORT QDebug operator<<(QDebug, const QGeoTileSpec &); + QT_END_NAMESPACE -#endif // QGEOTILESPEC_P_H +Q_DECLARE_METATYPE(QGeoTileSpec) + +QT_END_HEADER + +#endif // QGEOTILESPEC_H diff --git a/src/location/maps/qgeotilespec.h b/src/location/maps/qgeotilespec_p_p.h index 10be4294..8392e617 100644 --- a/src/location/maps/qgeotilespec.h +++ b/src/location/maps/qgeotilespec_p_p.h @@ -38,60 +38,45 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#ifndef QGEOTILESPEC_H -#define QGEOTILESPEC_H +#ifndef QGEOTILESPEC_P_H +#define QGEOTILESPEC_P_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// -#include <QtLocation/qlocationglobal.h> -#include <QtCore/QMetaType> #include <QString> - -#include <QSharedDataPointer> - -QT_BEGIN_HEADER +#include <QSharedData> QT_BEGIN_NAMESPACE -class QGeoTileSpecPrivate; - -class Q_LOCATION_EXPORT QGeoTileSpec +class QGeoTileSpecPrivate : public QSharedData { public: - QGeoTileSpec(); - QGeoTileSpec(const QGeoTileSpec &other); - QGeoTileSpec(const QString &plugin, int mapId, int zoom, int x, int y); - ~QGeoTileSpec(); - - QGeoTileSpec &operator = (const QGeoTileSpec &other); - - QString plugin() const; - - void setZoom(int zoom); - int zoom() const; + QGeoTileSpecPrivate(); + QGeoTileSpecPrivate(const QGeoTileSpecPrivate &other); + QGeoTileSpecPrivate(const QString &plugin, int mapId, int zoom, int x, int y); + ~QGeoTileSpecPrivate(); - void setX(int x); - int x() const; + QGeoTileSpecPrivate &operator = (const QGeoTileSpecPrivate &other); - void setY(int y); - int y() const; + bool operator == (const QGeoTileSpecPrivate &rhs) const; + bool operator < (const QGeoTileSpecPrivate &rhs) const; - void setMapId(int mapId); - int mapId() const; - - bool operator == (const QGeoTileSpec &rhs) const; - bool operator < (const QGeoTileSpec &rhs) const; - -private: - QSharedDataPointer<QGeoTileSpecPrivate> d; + QString plugin_; + int mapId_; + int zoom_; + int x_; + int y_; }; -Q_LOCATION_EXPORT unsigned int qHash(const QGeoTileSpec &spec); - -Q_LOCATION_EXPORT QDebug operator<<(QDebug, const QGeoTileSpec &); - QT_END_NAMESPACE -Q_DECLARE_METATYPE(QGeoTileSpec) - -QT_END_HEADER - -#endif // QGEOTILESPEC_H +#endif // QGEOTILESPEC_P_H diff --git a/src/plugins/geoservices/nokia/nokia.pro b/src/plugins/geoservices/nokia/nokia.pro index 88394c7d..f96c3638 100644 --- a/src/plugins/geoservices/nokia/nokia.pro +++ b/src/plugins/geoservices/nokia/nokia.pro @@ -1,7 +1,7 @@ load(qt_module) TARGET = qtgeoservices_nokia -QT += location network +QT += location-private network contains(QT_CONFIG, location-china-support) { # China support diff --git a/src/plugins/geoservices/nokia/qgeomapreply_nokia.h b/src/plugins/geoservices/nokia/qgeomapreply_nokia.h index 587d255b..9d036278 100644 --- a/src/plugins/geoservices/nokia/qgeomapreply_nokia.h +++ b/src/plugins/geoservices/nokia/qgeomapreply_nokia.h @@ -49,9 +49,9 @@ #ifndef QGEOMAPREPLY_NOKIA_H #define QGEOMAPREPLY_NOKIA_H -#include <qgeotilespec.h> -#include <qgeotiledmapreply.h> -#include <QNetworkReply> +#include <QtNetwork/QNetworkReply> +#include <QtLocation/private/qgeotilespec_p.h> +#include <QtLocation/private/qgeotiledmapreply_p.h> QT_BEGIN_NAMESPACE diff --git a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp index 1a72f52c..f17be015 100644 --- a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp @@ -50,7 +50,7 @@ #include "qgeotiledmappingmanagerengine_nokia.h" #include "qgeotiledmapdata_nokia.h" #include "qgeotilefetcher_nokia.h" -#include "qgeotilespec.h" +#include "qgeotilespec_p.h" #include "qgeoprojection_p.h" #include "qdoublevector2d_p.h" #include "qgeotilecache_p.h" diff --git a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.h b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.h index 3b518084..693b9266 100644 --- a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.h +++ b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.h @@ -49,9 +49,9 @@ #ifndef QGEOTILEDMAPPINGMANAGERENGINE_NOKIA_H #define QGEOTILEDMAPPINGMANAGERENGINE_NOKIA_H -#include "qgeotiledmappingmanagerengine.h" +#include "qgeotiledmappingmanagerengine_p.h" #include "qgeoboundingbox.h" -#include "qgeomaptype.h" +#include "qgeomaptype_p.h" #include <QGeoServiceProvider> diff --git a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp index f90b1c4a..eb991f7d 100644 --- a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp @@ -54,7 +54,7 @@ #include "qgeouriprovider.h" #include "uri_constants.h" -#include <qgeotilespec.h> +#include <QtLocation/private/qgeotilespec_p.h> #include <QDebug> #include <QSize> diff --git a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.h b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.h index eb5f02b7..578cf551 100644 --- a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.h +++ b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.h @@ -50,7 +50,8 @@ #define QGEOTILEFETCHER_NOKIA_H #include "qgeoserviceproviderplugin_nokia.h" -#include "qgeotilefetcher.h" + +#include <QtLocation/private/qgeotilefetcher_p.h> QT_BEGIN_NAMESPACE diff --git a/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h b/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h index 9fccf9de..36280a2e 100644 --- a/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h +++ b/tests/auto/geotestplugin/qgeotiledmappingmanagerengine_test.h @@ -43,10 +43,10 @@ #define QGEOTILEDMAPPINGMANAGERENGINE_TEST_H #include <qgeoserviceprovider.h> -#include <qgeotiledmappingmanagerengine.h> +#include "qgeotiledmappingmanagerengine_p.h" #include <QLocale> -#include <qgeotiledmapreply.h> -#include "qgeomaptype.h" +#include "qgeotiledmapreply_p.h" +#include "qgeomaptype_p.h" #include "qgeocameracapabilities_p.h" #include "qgeotiledmapdata_test.h" diff --git a/tests/auto/geotestplugin/qgeotilefetcher_test.h b/tests/auto/geotestplugin/qgeotilefetcher_test.h index 09337bad..92fa56d0 100644 --- a/tests/auto/geotestplugin/qgeotilefetcher_test.h +++ b/tests/auto/geotestplugin/qgeotilefetcher_test.h @@ -42,10 +42,9 @@ #ifndef QGEOTILEFETCHER_TEST_H #define QGEOTILEFETCHER_TEST_H -#include <qgeotiledmapreply.h> - -#include "qgeotilefetcher.h" -#include "qgeotilespec.h" +#include "qgeotiledmapreply_p.h" +#include "qgeotilefetcher_p.h" +#include "qgeotilespec_p.h" #include <QLocale> #include <QPainter> diff --git a/tests/auto/maptype/maptype.pro b/tests/auto/maptype/maptype.pro index ff68a2e1..1622dc5b 100644 --- a/tests/auto/maptype/maptype.pro +++ b/tests/auto/maptype/maptype.pro @@ -4,4 +4,4 @@ TARGET = tst_maptype SOURCES += tst_maptype.cpp -QT += location testlib +QT += location-private testlib diff --git a/tests/auto/maptype/tst_maptype.cpp b/tests/auto/maptype/tst_maptype.cpp index 0e84b1dc..c6ce9413 100644 --- a/tests/auto/maptype/tst_maptype.cpp +++ b/tests/auto/maptype/tst_maptype.cpp @@ -42,7 +42,7 @@ #include <QtCore/QString> #include <QtTest/QtTest> -#include <qgeomaptype.h> +#include <QtLocation/private/qgeomaptype_p.h> QT_USE_NAMESPACE diff --git a/tests/auto/qgeocameratiles/tst_qgeocameratiles.cpp b/tests/auto/qgeocameratiles/tst_qgeocameratiles.cpp index 079eb706..a1b5b047 100644 --- a/tests/auto/qgeocameratiles/tst_qgeocameratiles.cpp +++ b/tests/auto/qgeocameratiles/tst_qgeocameratiles.cpp @@ -41,12 +41,12 @@ //TESTED_COMPONENT=src/location/maps -#include "qgeotilespec.h" +#include "qgeotilespec_p.h" #include "qgeocameratiles_p.h" #include "qgeocameradata_p.h" #include "qgeoprojection_p.h" #include "qdoublevector2d_p.h" -#include "qgeomaptype.h" +#include "qgeomaptype_p.h" #include <qtest.h> diff --git a/tests/auto/qgeomapscene/tst_qgeomapscene.cpp b/tests/auto/qgeomapscene/tst_qgeomapscene.cpp index c14dc4ab..e0697399 100644 --- a/tests/auto/qgeomapscene/tst_qgeomapscene.cpp +++ b/tests/auto/qgeomapscene/tst_qgeomapscene.cpp @@ -41,7 +41,7 @@ //TESTED_COMPONENT=src/location/maps -#include "qgeotilespec.h" +#include "qgeotilespec_p.h" #include "qgeomapscene_p.h" #include "qgeocameratiles_p.h" #include "qgeocameradata_p.h" diff --git a/tests/auto/qgeotilespec/qgeotilespec.pro b/tests/auto/qgeotilespec/qgeotilespec.pro index d92e5975..eb48aea6 100644 --- a/tests/auto/qgeotilespec/qgeotilespec.pro +++ b/tests/auto/qgeotilespec/qgeotilespec.pro @@ -2,6 +2,8 @@ TEMPLATE = app CONFIG += testcase TARGET = tst_qgeotilespec +INCLUDEPATH += ../../../src/location/maps + SOURCES += tst_qgeotilespec.cpp QT += location testlib diff --git a/tests/auto/qgeotilespec/tst_qgeotilespec.cpp b/tests/auto/qgeotilespec/tst_qgeotilespec.cpp index 54e13407..314667e6 100644 --- a/tests/auto/qgeotilespec/tst_qgeotilespec.cpp +++ b/tests/auto/qgeotilespec/tst_qgeotilespec.cpp @@ -42,7 +42,7 @@ #include <QtCore/QString> #include <QtTest/QtTest> -#include <qgeotilespec.h> +#include "qgeotilespec_p.h" QT_USE_NAMESPACE |