summaryrefslogtreecommitdiff
path: root/src/location
diff options
context:
space:
mode:
authorabcd <qt-info@nokia.com>2011-10-05 14:26:06 +1000
committerQt by Nokia <qt-info@nokia.com>2011-10-11 06:16:59 +0200
commit3dcb12116420cd29580b28c8e976c17ea605d185 (patch)
treedc803abea29a593f402ec81975e32dc8d31855ed /src/location
parentc3b41f8823e9f500bf2fde0213c6302c5ff0d12f (diff)
downloadqtlocation-3dcb12116420cd29580b28c8e976c17ea605d185.tar.gz
Add Icon support to Places
Change-Id: I559c96427db542dd71122f937dff90c900a02241 Reviewed-on: http://codereview.qt-project.org/6041 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Aaron McCarthy <aaron.mccarthy@nokia.com> Reviewed-by: abcd <qt_abcd1@ovi.com>
Diffstat (limited to 'src/location')
-rw-r--r--src/location/maps/qgeoserviceprovider.cpp3
-rw-r--r--src/location/places/places.pri3
-rw-r--r--src/location/places/qplacecategory.cpp34
-rw-r--r--src/location/places/qplacecategory.h6
-rw-r--r--src/location/places/qplacecategory_p.h6
-rw-r--r--src/location/places/qplaceicon.cpp209
-rw-r--r--src/location/places/qplaceicon.h106
-rw-r--r--src/location/places/qplaceicon_p.h80
-rw-r--r--src/location/places/qplacemanager.cpp8
-rw-r--r--src/location/places/qplacemanager.h3
-rw-r--r--src/location/places/qplacemanagerengine.cpp10
-rw-r--r--src/location/places/qplacemanagerengine.h5
-rw-r--r--src/location/places/qplacemanagerengine_p.h1
-rw-r--r--src/location/places/qplacesupplier.cpp16
-rw-r--r--src/location/places/qplacesupplier.h8
-rw-r--r--src/location/places/qplacesupplier_p.h4
-rw-r--r--src/location/qplace.cpp18
-rw-r--r--src/location/qplace.h4
-rw-r--r--src/location/qplace_p.h3
19 files changed, 513 insertions, 14 deletions
diff --git a/src/location/maps/qgeoserviceprovider.cpp b/src/location/maps/qgeoserviceprovider.cpp
index 624ef3c1..0a7bbbf8 100644
--- a/src/location/maps/qgeoserviceprovider.cpp
+++ b/src/location/maps/qgeoserviceprovider.cpp
@@ -51,6 +51,7 @@
#include "qgeomappingmanagerengine.h"
#include "qgeoroutingmanagerengine.h"
#include "qplacemanagerengine.h"
+#include "qplacemanagerengine_p.h"
#include <QList>
#include <QString>
@@ -337,6 +338,8 @@ QPlaceManager *QGeoServiceProvider::placeManager() const
engine->setManagerName(d_ptr->factory->providerName());
engine->setManagerVersion(d_ptr->factory->providerVersion());
d_ptr->placeManager = new QPlaceManager(engine);
+ engine->d_ptr->manager = d_ptr->placeManager;
+
} else {
d_ptr->placeError = QGeoServiceProvider::NotSupportedError;
d_ptr->placeErrorString = QLatin1String("The service provider does not support placeManager().");
diff --git a/src/location/places/places.pri b/src/location/places/places.pri
index 8ac97180..6e0a4896 100644
--- a/src/location/places/places.pri
+++ b/src/location/places/places.pri
@@ -10,6 +10,7 @@ PUBLIC_HEADERS += \
places/qplacecontentreply.h \
places/qplaceeditorial.h \
places/qplaceimage.h \
+ places/qplaceicon.h \
places/qplacerating.h \
places/qplacereview.h \
places/qplacesupplier.h \
@@ -34,6 +35,7 @@ PRIVATE_HEADERS += \
places/qplacecategory_p.h \
places/qplacecontent_p.h \
places/qplaceeditorial_p.h \
+ places/qplaceicon_p.h \
places/qplaceimage_p.h \
places/qplacerating_p.h \
places/qplacereview_p.h \
@@ -52,6 +54,7 @@ SOURCES += \
places/qplacecontentreply.cpp \
places/qplaceeditorial.cpp \
#result
+ places/qplaceicon.cpp \
places/qplaceimage.cpp \
places/qplacerating.cpp \
places/qplacereview.cpp \
diff --git a/src/location/places/qplacecategory.cpp b/src/location/places/qplacecategory.cpp
index e37bc89f..75cfd45a 100644
--- a/src/location/places/qplacecategory.cpp
+++ b/src/location/places/qplacecategory.cpp
@@ -50,7 +50,8 @@ QPlaceCategoryPrivate::QPlaceCategoryPrivate()
}
QPlaceCategoryPrivate::QPlaceCategoryPrivate(const QPlaceCategoryPrivate &other)
-: QSharedData(other), categoryId(other.categoryId), name(other.name), visibility(other.visibility)
+: QSharedData(other), categoryId(other.categoryId), name(other.name), visibility(other.visibility),
+ icon(other.icon)
{
}
@@ -58,6 +59,21 @@ QPlaceCategoryPrivate::~QPlaceCategoryPrivate()
{
}
+QPlaceCategoryPrivate &QPlaceCategoryPrivate::operator=(const QPlaceCategoryPrivate &other)
+{
+ categoryId = other.categoryId;
+ name = other.name;
+ icon = other.icon;
+ return *this;
+}
+
+bool QPlaceCategoryPrivate::operator==(const QPlaceCategoryPrivate &other) const
+{
+ return (categoryId == other.categoryId)
+ && (icon == other.icon)
+ && (name == other.name);
+}
+
/*!
\class QPlaceCategory
@@ -159,4 +175,20 @@ QtLocation::Visibility QPlaceCategory::visibility() const
return d->visibility;
}
+/*!
+ Returns the category icon
+*/
+QPlaceIcon QPlaceCategory::icon() const
+{
+ return d->icon;
+}
+
+/*!
+ Sets the category icon
+*/
+void QPlaceCategory::setIcon(const QPlaceIcon &icon)
+{
+ d->icon = icon;
+}
+
QT_END_NAMESPACE
diff --git a/src/location/places/qplacecategory.h b/src/location/places/qplacecategory.h
index 4a2e88d2..048efa43 100644
--- a/src/location/places/qplacecategory.h
+++ b/src/location/places/qplacecategory.h
@@ -53,6 +53,8 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Location)
+class QPlaceIcon;
+
class QPlaceCategoryPrivate;
class Q_LOCATION_EXPORT QPlaceCategory
{
@@ -71,12 +73,16 @@ public:
QString categoryId() const;
void setCategoryId(const QString &catID);
+
QString name() const;
void setName(const QString &name);
QtLocation::Visibility visibility() const;
void setVisibility(QtLocation::Visibility visibility);
+ QPlaceIcon icon() const;
+ void setIcon(const QPlaceIcon &icon);
+
private:
QSharedDataPointer<QPlaceCategoryPrivate> d;
};
diff --git a/src/location/places/qplacecategory_p.h b/src/location/places/qplacecategory_p.h
index b856435d..2d8d8a4a 100644
--- a/src/location/places/qplacecategory_p.h
+++ b/src/location/places/qplacecategory_p.h
@@ -46,6 +46,8 @@
#include <QtCore/QString>
#include <QtLocation/qtlocation.h>
+#include "qplaceicon.h"
+
QT_BEGIN_NAMESPACE
class QPlaceCategoryPrivate : public QSharedData
@@ -55,10 +57,14 @@ public:
QPlaceCategoryPrivate(const QPlaceCategoryPrivate &other);
~QPlaceCategoryPrivate();
+ QPlaceCategoryPrivate &operator= (const QPlaceCategoryPrivate &other);
+ bool operator==(const QPlaceCategoryPrivate &other) const;
+
QString categoryId;
QString name;
QtLocation::Visibility visibility;
+ QPlaceIcon icon;
};
QT_END_NAMESPACE
diff --git a/src/location/places/qplaceicon.cpp b/src/location/places/qplaceicon.cpp
new file mode 100644
index 00000000..392c661c
--- /dev/null
+++ b/src/location/places/qplaceicon.cpp
@@ -0,0 +1,209 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** 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$
+**
+****************************************************************************/
+
+#include "qplaceicon.h"
+#include "qplaceicon_p.h"
+#include "qplacemanager.h"
+
+QT_USE_NAMESPACE
+
+
+QPlaceIconPrivate::QPlaceIconPrivate()
+ : QSharedData(), manager(0)
+{
+}
+
+QPlaceIconPrivate::QPlaceIconPrivate(const QPlaceIconPrivate&other)
+ : QSharedData(other),
+ manager(other.manager),
+ baseUrl(other.baseUrl),
+ fullUrl(other.fullUrl)
+{
+}
+
+QPlaceIconPrivate::~QPlaceIconPrivate()
+{
+}
+
+QPlaceIconPrivate &QPlaceIconPrivate::operator=(const QPlaceIconPrivate &other)
+{
+ manager = other.manager;
+ baseUrl = other.baseUrl;
+ fullUrl = other.fullUrl;
+ return *this;
+}
+
+bool QPlaceIconPrivate::operator == (const QPlaceIconPrivate &other) const
+{
+ return manager == other.manager
+ && baseUrl == other.baseUrl
+ && fullUrl == other.fullUrl;
+}
+
+/*!
+ Constructs an icon.
+*/
+QPlaceIcon::QPlaceIcon()
+ : d(new QPlaceIconPrivate)
+{
+}
+
+/*!
+ Constructs a copy of \a other.
+*/
+QPlaceIcon::QPlaceIcon(const QPlaceIcon &other)
+ : d(other.d)
+{
+}
+
+/*!
+ Destroys the icon.
+*/
+QPlaceIcon::~QPlaceIcon()
+{
+}
+
+/*!
+ Assigns \a other to this icon and returns a reference to this icon.
+*/
+QPlaceIcon &QPlaceIcon::operator=(const QPlaceIcon &other)
+{
+ d = other.d;
+ return *this;
+}
+
+/*!
+ Returns true if this icon is equal to \a other. Otherwise returns false.
+*/
+bool QPlaceIcon::operator==(const QPlaceIcon &other) const
+{
+ return *d == *(other.d);
+}
+
+/*!
+ Returns an icon url according to the given \a size and \a flags.
+ If a base url has been set by setBaseUrl(), the url to the image that best
+ fits the specified parameters is returned.
+
+ If a full url has been set by setUrl(), the full url is returned.
+
+ If no manager has been assigned to the icon a default constructed QUrl
+ is returned.
+*/
+QUrl QPlaceIcon::url(const QSize &size, QPlaceIcon::IconFlags flags) const
+{
+ if (!d->manager)
+ return QUrl();
+
+ if (!d->fullUrl.isEmpty())
+ return d->fullUrl;
+
+
+ return d->manager->constructIconUrl(*this, size, flags);
+}
+
+/*!
+ Sets a full URL of the resource that represents the image of this
+ icon. Because a full URL is being set, specifying different
+ sizes and flags into the url() function will have no effect.
+
+ When calling the setUrl() function, the base url is implictly
+ cleared.
+*/
+void QPlaceIcon::setFullUrl(const QUrl &url)
+{
+ d->fullUrl = url;
+ d->baseUrl.clear();
+}
+
+QUrl QPlaceIcon::fullUrl() const
+{
+ return d->fullUrl;
+}
+
+/*!
+ Returns a base url that the comlete icon url is based off.
+ E.g. the base url may be http://example.com/icon
+ When calling the url() function the base url may be used as a hint
+ to construct http://example.com/icon_32x32_selected.png
+*/
+QUrl QPlaceIcon::baseUrl() const
+{
+ return d->baseUrl;
+}
+
+/*!
+ Sets a base url that the complete icon url returned by url() is based off.
+
+ When calling setBaseUrl() function, the full url set by
+ setUrl() is implicitly cleared.
+*/
+void QPlaceIcon::setBaseUrl(const QUrl &url)
+{
+ d->baseUrl = url;
+ d->fullUrl.clear();
+}
+
+/*!
+ Returns the manager that this icon is associated with.
+*/
+QPlaceManager *QPlaceIcon::manager() const
+{
+ return d->manager;
+}
+
+/*!
+ Sets the \a manager that this icon is associated with.
+*/
+void QPlaceIcon::setManager(QPlaceManager *manager)
+{
+ d->manager = manager;
+}
+
+/*!
+ Returns a boolean indicating whether the all the fields of the icon are empty or not.
+*/
+bool QPlaceIcon::isEmpty() const
+{
+ return (d->baseUrl.isEmpty()
+ && d->fullUrl.isEmpty()
+ && d->manager == 0);
+}
diff --git a/src/location/places/qplaceicon.h b/src/location/places/qplaceicon.h
new file mode 100644
index 00000000..9b2e94ca
--- /dev/null
+++ b/src/location/places/qplaceicon.h
@@ -0,0 +1,106 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** 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 QPLACEICON_H
+#define QPLACEICON_H
+
+
+#include <QtCore/QUrl>
+#include <QtCore/QFlags>
+#include <QtCore/QMetaType>
+#include <QtCore/QSize>
+#include <QtCore/QSharedDataPointer>
+
+QT_BEGIN_NAMESPACE
+
+class QPlaceManager;
+
+class QPlaceIconPrivate;
+class Q_LOCATION_EXPORT QPlaceIcon
+{
+public:
+ Q_ENUMS(QPlaceIcon::IconType)
+
+ enum IconFlag {
+ Normal = 0,
+ Disabled = 1,
+ Active = 2,
+ Selected = 4,
+
+ Map = 8,
+ List = 16
+ };
+
+ Q_DECLARE_FLAGS(IconFlags, IconFlag)
+
+ QPlaceIcon();
+ QPlaceIcon(const QPlaceIcon &other);
+
+ ~QPlaceIcon();
+
+ QPlaceIcon &operator=(const QPlaceIcon &other);
+ bool operator == (const QPlaceIcon &other) const;
+ bool operator != (const QPlaceIcon &other) const {
+ return !(*this == other);
+ }
+
+ QUrl url(const QSize &size = QSize(), IconFlags flags = 0) const;
+
+ void setFullUrl(const QUrl &url);
+ QUrl fullUrl() const;
+
+ QUrl baseUrl() const;
+ void setBaseUrl(const QUrl &url);
+
+ QPlaceManager *manager() const;
+ void setManager(QPlaceManager *manager);
+
+ bool isEmpty() const;
+
+private:
+ QSharedDataPointer<QPlaceIconPrivate> d;
+};
+
+Q_DECLARE_OPERATORS_FOR_FLAGS(QT_PREPEND_NAMESPACE(QPlaceIcon::IconFlags))
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/location/places/qplaceicon_p.h b/src/location/places/qplaceicon_p.h
new file mode 100644
index 00000000..9d129991
--- /dev/null
+++ b/src/location/places/qplaceicon_p.h
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** 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 QPLACEICON_P_H
+#define QPLACEICON_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 <QMap>
+#include <QUrl>
+#include <QSharedData>
+
+QT_BEGIN_NAMESPACE
+
+class QPlaceManager;
+class QPlaceIconPrivate: public QSharedData
+{
+public:
+ QPlaceIconPrivate();
+ QPlaceIconPrivate(const QPlaceIconPrivate &other);
+ ~QPlaceIconPrivate();
+
+ QPlaceIconPrivate &operator=(const QPlaceIconPrivate &other);
+ bool operator == (const QPlaceIconPrivate &other) const;
+
+ QPlaceManager *manager;
+ QUrl baseUrl;
+ QUrl fullUrl;
+};
+
+QT_END_NAMESPACE
+
+#endif
diff --git a/src/location/places/qplacemanager.cpp b/src/location/places/qplacemanager.cpp
index 69aa3150..9dbc9e13 100644
--- a/src/location/places/qplacemanager.cpp
+++ b/src/location/places/qplacemanager.cpp
@@ -270,6 +270,14 @@ void QPlaceManager::setLocale(const QLocale &locale)
}
/*!
+ Constructs an icon url from a given \a icon, \a size and \a flags.
+*/
+QUrl QPlaceManager::constructIconUrl(const QPlaceIcon &icon, const QSize &size, QPlaceIcon::IconFlags flags)
+{
+ return d->constructIconUrl(icon, size, flags);
+}
+
+/*!
\fn void QPlaceManager::finished(QPlaceReply* reply)
This signal is emitted when \a reply has finished processing.
diff --git a/src/location/places/qplacemanager.h b/src/location/places/qplacemanager.h
index 2840a86b..13d1dffa 100644
--- a/src/location/places/qplacemanager.h
+++ b/src/location/places/qplacemanager.h
@@ -55,6 +55,7 @@
#include <QString>
#include <QObject>
#include <QAuthenticator>
+#include <QtLocation/QPlaceIcon>
QT_BEGIN_HEADER
@@ -111,6 +112,8 @@ public:
QLocale locale() const;
void setLocale(const QLocale &locale);
+ QUrl constructIconUrl(const QPlaceIcon &icon, const QSize &size, QPlaceIcon::IconFlags flags);
+
Q_SIGNALS:
void finished(QPlaceReply *reply);
void error(QPlaceReply *, QPlaceReply::Error error, const QString &errorString = QString());
diff --git a/src/location/places/qplacemanagerengine.cpp b/src/location/places/qplacemanagerengine.cpp
index 78f5d4d3..5574d283 100644
--- a/src/location/places/qplacemanagerengine.cpp
+++ b/src/location/places/qplacemanagerengine.cpp
@@ -130,6 +130,14 @@ int QPlaceManagerEngine::managerVersion() const
}
/*!
+ Returns the manager instance used to create this engine.
+*/
+QPlaceManager *QPlaceManagerEngine::manager() const
+{
+ return d_ptr->manager;
+}
+
+/*!
\fn void QPlaceManagerEngine::authenticationRequired(QAuthenticator *authenticator)
This signal is emitted if authentication details are required by the manager engine
@@ -141,7 +149,7 @@ int QPlaceManagerEngine::managerVersion() const
*/
QPlaceManagerEnginePrivate::QPlaceManagerEnginePrivate()
-: managerVersion(-1)
+ : managerVersion(-1), manager(0)
{
}
diff --git a/src/location/places/qplacemanagerengine.h b/src/location/places/qplacemanagerengine.h
index 251afb9c..49f3eeb3 100644
--- a/src/location/places/qplacemanagerengine.h
+++ b/src/location/places/qplacemanagerengine.h
@@ -88,6 +88,8 @@ public:
virtual QLocale locale() const = 0;
virtual void setLocale(const QLocale &locale) = 0;
+ virtual QUrl constructIconUrl(const QPlaceIcon &icon, const QSize &size, QPlaceIcon::IconFlags flags) = 0;
+
Q_SIGNALS:
void finished(QPlaceReply *reply);
void error(QPlaceReply *, QPlaceReply::Error error, QString errorString = QString());
@@ -101,6 +103,9 @@ Q_SIGNALS:
void categoryUpdated(const QPlaceCategory &category, const QString &parentCategoryId);
void categoryRemoved(const QString &categoryId, const QString &parentCategoryId);
+protected:
+ QPlaceManager *manager() const;
+
private:
void setManagerName(const QString &managerName);
void setManagerVersion(int managerVersion);
diff --git a/src/location/places/qplacemanagerengine_p.h b/src/location/places/qplacemanagerengine_p.h
index 719df151..5b0d140b 100644
--- a/src/location/places/qplacemanagerengine_p.h
+++ b/src/location/places/qplacemanagerengine_p.h
@@ -66,6 +66,7 @@ public:
QString managerName;
int managerVersion;
+ QPlaceManager *manager;
private:
Q_DISABLE_COPY(QPlaceManagerEnginePrivate)
diff --git a/src/location/places/qplacesupplier.cpp b/src/location/places/qplacesupplier.cpp
index c3500f48..24dbb60f 100644
--- a/src/location/places/qplacesupplier.cpp
+++ b/src/location/places/qplacesupplier.cpp
@@ -54,7 +54,7 @@ QPlaceSupplierPrivate::QPlaceSupplierPrivate(const QPlaceSupplierPrivate &other)
this->name = other.name;
this->supplierId = other.supplierId;
this->url = other.url;
- this->supplierIconUrl = other.supplierIconUrl;
+ this->icon = other.icon;
}
QPlaceSupplierPrivate::~QPlaceSupplierPrivate()
@@ -67,7 +67,7 @@ bool QPlaceSupplierPrivate::operator==(const QPlaceSupplierPrivate &other) const
this->name == other.name
&& this->supplierId == other.supplierId
&& this->url == other.url
- && this->supplierIconUrl == other.supplierIconUrl
+ && this->icon == other.icon
);
}
@@ -165,17 +165,17 @@ void QPlaceSupplier::setUrl(const QUrl &url)
}
/*!
- Returns the supplier's icon URL.
+ Returns the supplier icon
*/
-QUrl QPlaceSupplier::supplierIconUrl() const
+QPlaceIcon QPlaceSupplier::icon() const
{
- return d->supplierIconUrl;
+ return d->icon;
}
/*!
- Sets \a url of the icon of the supplier.
+ Sets the supplier icon
*/
-void QPlaceSupplier::setSupplierIconUrl(const QUrl &url)
+void QPlaceSupplier::setIcon(const QPlaceIcon &icon)
{
- d->supplierIconUrl = url;
+ d->icon = icon;
}
diff --git a/src/location/places/qplacesupplier.h b/src/location/places/qplacesupplier.h
index d1d5b30e..c3cbdce6 100644
--- a/src/location/places/qplacesupplier.h
+++ b/src/location/places/qplacesupplier.h
@@ -43,6 +43,7 @@
#define QPLACESUPPLIER_H
#include <QSharedDataPointer>
+#include <QtLocation/QPlaceIcon>
QT_BEGIN_HEADER
@@ -69,12 +70,15 @@ public:
QString name() const;
void setName(const QString &data);
+
QString supplierId() const;
void setSupplierId(const QString &data);
+
QUrl url() const;
void setUrl(const QUrl &data);
- QUrl supplierIconUrl() const;
- void setSupplierIconUrl(const QUrl &data);
+
+ QPlaceIcon icon() const;
+ void setIcon(const QPlaceIcon &icon);
private:
QSharedDataPointer<QPlaceSupplierPrivate> d;
diff --git a/src/location/places/qplacesupplier_p.h b/src/location/places/qplacesupplier_p.h
index c8cf9e4e..7015ae0e 100644
--- a/src/location/places/qplacesupplier_p.h
+++ b/src/location/places/qplacesupplier_p.h
@@ -46,6 +46,8 @@
#include <QSharedData>
#include <QUrl>
+#include "qplaceicon.h"
+
QT_BEGIN_NAMESPACE
class QPlaceSupplierPrivate : public QSharedData
@@ -61,7 +63,7 @@ public:
QString name;
QString supplierId;
QUrl url;
- QUrl supplierIconUrl;
+ QPlaceIcon icon;
};
QT_END_NAMESPACE
diff --git a/src/location/qplace.cpp b/src/location/qplace.cpp
index b0ed80a5..825fb1f8 100644
--- a/src/location/qplace.cpp
+++ b/src/location/qplace.cpp
@@ -310,6 +310,24 @@ void QPlace::setAttribution(const QString &attribution)
}
/*!
+ Returns the icon of the place.
+*/
+QPlaceIcon QPlace::icon() const
+{
+ Q_D(const QPlace);
+ return d->icon;
+}
+
+/*!
+ Sets the icon of the place.
+*/
+void QPlace::setIcon(const QPlaceIcon &icon)
+{
+ Q_D(QPlace);
+ d->icon = icon;
+}
+
+/*!
Returns the primary phone number for this place.
*/
QString QPlace::primaryPhone() const
diff --git a/src/location/qplace.h b/src/location/qplace.h
index 6098c320..3f33ca06 100644
--- a/src/location/qplace.h
+++ b/src/location/qplace.h
@@ -62,6 +62,7 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Location)
class QString;
+class QPlaceIcon;
class QPlacePrivate;
class Q_LOCATION_EXPORT QPlace
@@ -90,6 +91,9 @@ public:
QString attribution() const;
void setAttribution(const QString &attribution);
+ QPlaceIcon icon() const;
+ void setIcon(const QPlaceIcon &icon);
+
QPlaceContent::Collection content(QPlaceContent::Type type) const;
void setContent(QPlaceContent::Type type, const QPlaceContent::Collection &content);
void insertContent(QPlaceContent::Type type, const QPlaceContent::Collection &content);
diff --git a/src/location/qplace_p.h b/src/location/qplace_p.h
index fba03329..00d57a67 100644
--- a/src/location/qplace_p.h
+++ b/src/location/qplace_p.h
@@ -61,6 +61,7 @@
#include "qgeoboundingbox.h"
#include "qgeocoordinate.h"
#include "qplacesupplier.h"
+#include <QtLocation/QPlaceIcon>
QT_BEGIN_NAMESPACE
@@ -94,7 +95,7 @@ public:
QPlace::ExtendedAttributes extendedAttributes;
QtLocation::Visibility visibility;
-
+ QPlaceIcon icon;
bool detailsFetched;
};