summaryrefslogtreecommitdiff
path: root/src/location/places/qplacecontentrequest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/location/places/qplacecontentrequest.cpp')
-rw-r--r--src/location/places/qplacecontentrequest.cpp74
1 files changed, 49 insertions, 25 deletions
diff --git a/src/location/places/qplacecontentrequest.cpp b/src/location/places/qplacecontentrequest.cpp
index 1353ada4..9ad82149 100644
--- a/src/location/places/qplacecontentrequest.cpp
+++ b/src/location/places/qplacecontentrequest.cpp
@@ -46,14 +46,13 @@
QT_BEGIN_NAMESPACE
QPlaceContentRequestPrivate::QPlaceContentRequestPrivate()
- : QSharedData(), contentType(QPlaceContent::NoType),
- limit(-1), offset(0)
+: QSharedData(), contentType(QPlaceContent::NoType), limit(-1)
{
}
QPlaceContentRequestPrivate::QPlaceContentRequestPrivate(const QPlaceContentRequestPrivate &other)
- : QSharedData(other), contentType(other.contentType),
- limit(other.limit), offset(other.offset)
+: QSharedData(other), contentType(other.contentType), placeId(other.placeId),
+ contentContext(other.contentContext), limit(other.limit)
{
}
@@ -64,15 +63,13 @@ QPlaceContentRequestPrivate::~QPlaceContentRequestPrivate()
bool QPlaceContentRequestPrivate::operator==(const QPlaceContentRequestPrivate &other) const
{
return contentType == other.contentType
- && limit == other.limit
- && offset == other.offset;
+ && limit == other.limit;
}
void QPlaceContentRequestPrivate::clear()
{
contentType = QPlaceContent::NoType;
limit = -1;
- offset = 0;
}
/*!
@@ -171,48 +168,75 @@ void QPlaceContentRequest::setContentType(QPlaceContent::Type type)
}
/*!
- Returns the maximum number of content items to retrieve.
+ Returns the identifier of the place content is to be fetched for.
+*/
+QString QPlaceContentRequest::placeId() const
+{
+ Q_D(const QPlaceContentRequest);
+ return d->placeId;
+}
- A negative value for limit means that it is undefined. It is left up to the backend
- provider to choose an appropriate number of items to return.
+/*!
+ Sets the identifier of the place to fetch content for to \a identifier.
+*/
+void QPlaceContentRequest::setPlaceId(const QString &identifier)
+{
+ Q_D(QPlaceContentRequest);
+ d->placeId = identifier;
+}
- The default limit is -1.
+/*!
+ Returns backend specific additional content context associated with this place content request.
*/
-int QPlaceContentRequest::limit() const
+QVariant QPlaceContentRequest::contentContext() const
{
Q_D(const QPlaceContentRequest);
- return d->limit;
+ return d->contentContext;
}
/*!
- Set the maximum number of content items to retrieve to
- \a limit.
+ Sets the content context to \a context.
+
+ \note This method is intended to be used by geo service plugins when returning place content
+ results.
+
+ The content context is used by backends to store additional content context related to the
+ content request. Other relevant fields should also be filled in. For example, if the content
+ request is for image content the content type should also be set with \l setContentType(). The
+ content context allows additional context to be kept which is not directly accessible via the
+ Qt Location API.
+
+ The content context can be of any type storable in a QVariant. The value of the content context
+ is not intended to be used directly by applications.
*/
-void QPlaceContentRequest::setLimit(int limit)
+void QPlaceContentRequest::setContentContext(const QVariant &context)
{
Q_D(QPlaceContentRequest);
- d->limit = limit;
+ d->contentContext = context;
}
/*!
- Returns the offset index of the first item that is to be retrieved.
+ Returns the maximum number of content items to retrieve.
- The default offset is 0.
+ A negative value for limit means that it is undefined. It is left up to the backend
+ provider to choose an appropriate number of items to return.
+
+ The default limit is -1.
*/
-int QPlaceContentRequest::offset() const
+int QPlaceContentRequest::limit() const
{
Q_D(const QPlaceContentRequest);
- return d->offset;
+ return d->limit;
}
/*!
- Sets the starting index of the first item to be retrieved
- to \a offset.
+ Set the maximum number of content items to retrieve to
+ \a limit.
*/
-void QPlaceContentRequest::setOffset(int offset)
+void QPlaceContentRequest::setLimit(int limit)
{
Q_D(QPlaceContentRequest);
- d->offset = offset;
+ d->limit = limit;
}
/*!