From 559ad8baa411b6f8bec8e41254a1ee0098c792b8 Mon Sep 17 00:00:00 2001 From: abcd Date: Mon, 10 Oct 2011 19:48:20 +1000 Subject: Add Supported Features handling Change-Id: Ie2518c349fc551756f78a963417cceb93c81a3a8 Reviewed-on: http://codereview.qt-project.org/6407 Sanity-Review: Qt Sanity Bot Reviewed-by: Aaron McCarthy --- src/location/places/qplacemanager.cpp | 8 ++++++++ src/location/places/qplacemanager.h | 23 ++++++++++++++++------- src/location/places/qplacemanagerengine.h | 1 + 3 files changed, 25 insertions(+), 7 deletions(-) (limited to 'src/location') diff --git a/src/location/places/qplacemanager.cpp b/src/location/places/qplacemanager.cpp index 9dbc9e13..2658cd22 100644 --- a/src/location/places/qplacemanager.cpp +++ b/src/location/places/qplacemanager.cpp @@ -277,6 +277,14 @@ QUrl QPlaceManager::constructIconUrl(const QPlaceIcon &icon, const QSize &size, return d->constructIconUrl(icon, size, flags); } +/*! + Returns a set of flags indicating what particular features this manager instance supports. +*/ +QPlaceManager::ManagerFeatures QPlaceManager::supportedFeatures() const +{ + return d->supportedFeatures(); +} + /*! \fn void QPlaceManager::finished(QPlaceReply* reply) diff --git a/src/location/places/qplacemanager.h b/src/location/places/qplacemanager.h index 13d1dffa..b4f7d606 100644 --- a/src/location/places/qplacemanager.h +++ b/src/location/places/qplacemanager.h @@ -72,15 +72,20 @@ class Q_LOCATION_EXPORT QPlaceManager : public QObject Q_OBJECT public: enum ManagerFeature { - SuggestionFeature, - AuthenticationFeature, - PlaceEditingFeature, - SavePlaceFeature, - SaveCategoryFeature, - RecommendationsFeature, - LocaleFeature + NoFeatures = 0x0, + SavePlaceFeature = 0x1, + RemovePlaceFeature = 0x2, + SaveCategoryFeature = 0x4, + RemoveCategoryFeature = 0x8, + RecommendationsFeature = 0x10, + TextPredictionsFeature = 0x20, + CorrectionsFeature = 0x40, + LocaleFeature = 0x80 }; + Q_DECLARE_FLAGS(ManagerFeatures, ManagerFeature) + Q_FLAGS(ManagerFeatures) + ~QPlaceManager(); QString managerName() const; @@ -114,6 +119,8 @@ public: QUrl constructIconUrl(const QPlaceIcon &icon, const QSize &size, QPlaceIcon::IconFlags flags); + ManagerFeatures supportedFeatures() const; + Q_SIGNALS: void finished(QPlaceReply *reply); void error(QPlaceReply *, QPlaceReply::Error error, const QString &errorString = QString()); @@ -141,4 +148,6 @@ QT_END_NAMESPACE QT_END_HEADER +Q_DECLARE_OPERATORS_FOR_FLAGS(QT_PREPEND_NAMESPACE(QPlaceManager::ManagerFeatures)) + #endif // QPLACEMANAGER_H diff --git a/src/location/places/qplacemanagerengine.h b/src/location/places/qplacemanagerengine.h index 49f3eeb3..38b031d5 100644 --- a/src/location/places/qplacemanagerengine.h +++ b/src/location/places/qplacemanagerengine.h @@ -89,6 +89,7 @@ public: virtual void setLocale(const QLocale &locale) = 0; virtual QUrl constructIconUrl(const QPlaceIcon &icon, const QSize &size, QPlaceIcon::IconFlags flags) = 0; + virtual QPlaceManager::ManagerFeatures supportedFeatures() const = 0; Q_SIGNALS: void finished(QPlaceReply *reply); -- cgit v1.2.1