Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qplacecontentreply.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
7
8#include <QtLocation/QPlaceContentRequest>
9
12{
13public:
15 int totalCount = 0;
16 QPlaceContentRequest contentRequest;
17 QPlaceContentRequest previousPageRequest;
18 QPlaceContentRequest nextPageRequest;
19};
20
21QT_END_NAMESPACE
22
23QT_USE_NAMESPACE
24
25/*!
26 \class QPlaceContentReply
27 \inmodule QtLocation
28 \ingroup QtLocation-places
29 \ingroup QtLocation-places-replies
30 \since 5.6
31
32 \brief The QPlaceContentReply class manages a content retrieval operation started by an
33 instance of QPlaceManager.
34
35 See \l {Fetching Rich Content} for an example on how to use a content reply.
36 \sa QPlaceContentRequest, QPlaceManager
37*/
38
39/*!
40 Constructs a content reply with a given \a parent.
41*/
42QPlaceContentReply::QPlaceContentReply(QObject *parent)
43 : QPlaceReply(new QPlaceContentReplyPrivate, parent)
44{
45}
46
47/*!
48 Destroys the reply.
49*/
50QPlaceContentReply::~QPlaceContentReply()
51{
52}
53
54 /*!
55 Returns the collection of content retrieved.
56*/
57QPlaceContent::Collection QPlaceContentReply::content() const
58{
59 Q_D(const QPlaceContentReply);
60 return d->contentCollection;
61}
62
63/*!
64 Returns the type of reply.
65*/
66QPlaceReply::Type QPlaceContentReply::type() const
67{
68 return QPlaceReply::ContentReply;
69}
70
71/*!
72 Sets the \a content of the reply.
73*/
74void QPlaceContentReply::setContent(const QPlaceContent::Collection &content)
75{
76 Q_D(QPlaceContentReply);
77 d->contentCollection = content;
78}
79
80/*!
81 Returns the total number of content objects for a place. If the total number of
82 content objects cannot be counted, a value of -1 is returned. This count only
83 refers to the total count for a single content type, that is, the content type that
84 was specified when content was requested with the QPlaceManager.
85*/
86int QPlaceContentReply::totalCount() const
87{
88 Q_D(const QPlaceContentReply);
89 return d->totalCount;
90}
91
92/*!
93 Sets the \a total number of content objects for a place.
94*/
95void QPlaceContentReply::setTotalCount(int total)
96{
97 Q_D(QPlaceContentReply);
98 d->totalCount = total;
99}
100
101/*!
102 Returns the content request that was used to generate this reply.
103*/
104QPlaceContentRequest QPlaceContentReply::request() const
105{
106 Q_D(const QPlaceContentReply);
107 return d->contentRequest;
108}
109
110/*!
111 Returns a place content request that can be used to request the previous batch of place content
112 results.
113*/
114QPlaceContentRequest QPlaceContentReply::previousPageRequest() const
115{
116 Q_D(const QPlaceContentReply);
117 return d->previousPageRequest;
118}
119
120/*!
121 Returns a place content request that can be used to request the next batch of place content
122 results.
123*/
124QPlaceContentRequest QPlaceContentReply::nextPageRequest() const
125{
126 Q_D(const QPlaceContentReply);
127 return d->nextPageRequest;
128}
129
130/*!
131 Sets the content \a request used to generate this this reply.
132*/
133void QPlaceContentReply::setRequest(const QPlaceContentRequest &request)
134{
135 Q_D(QPlaceContentReply);
136 d->contentRequest = request;
137}
138
139/*!
140 Sets the place content request that can be used to request the previous batch of place content
141 results to \a previous.
142*/
143void QPlaceContentReply::setPreviousPageRequest(const QPlaceContentRequest &previous)
144{
145 Q_D(QPlaceContentReply);
146 d->previousPageRequest = previous;
147}
148
149/*!
150 Sets the place content request that can be used to request the next batch of place content
151 results to \a next.
152*/
153void QPlaceContentReply::setNextPageRequest(const QPlaceContentRequest &next)
154{
155 Q_D(QPlaceContentReply);
156 d->nextPageRequest = next;
157}
QPlaceContent::Collection contentCollection
QPlaceContentRequest contentRequest
QPlaceContentRequest nextPageRequest
QPlaceContentRequest previousPageRequest
Combined button and popup list for selecting options.