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
qplaceidreply.cpp
Go to the documentation of this file.
1// Copyright (C) 2015 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
6
17
18QT_END_NAMESPACE
19
20QT_USE_NAMESPACE
21
22/*!
23 \class QPlaceIdReply
24 \inmodule QtLocation
25 \ingroup QtLocation-places
26 \ingroup QtLocation-places-replies
27 \since 5.6
28
29 \brief The QPlaceIdReply class manages operations which return an identifier such as
30 saving and removal operations of places and categories.
31
32 The QPlaceIdReply can be considered a multipurpose reply in that it can
33 be used to save places, save categories, remove places and remove categories.
34 In each case it returns an identifier of the place or category that was added, modified or removed.
35
36 See \l {Saving a place cpp}{Saving a place} for an example of how to use an identifier reply.
37 \sa QPlaceManager
38*/
39
40/*!
41 \enum QPlaceIdReply::OperationType
42 Defines the type of operation that was used to generate this reply.
43 \value SavePlace The reply was created for a save place operation
44 \value RemovePlace The reply was created for a remove place operation.
45 \value SaveCategory The reply was created for a save category operation
46 \value RemoveCategory The reply was created for a remove category operation.
47*/
48
49/*!
50 Constructs a reply which contains the identifier of the object operated upon. The reply is for the given \a operationType and with \a parent.
51*/
52QPlaceIdReply::QPlaceIdReply(QPlaceIdReply::OperationType operationType, QObject *parent)
53 : QPlaceReply(new QPlaceIdReplyPrivate(operationType), parent) {}
54
55/*!
56 Destroys the reply.
57*/
58QPlaceIdReply::~QPlaceIdReply()
59{
60}
61
62/*!
63 Returns the type of reply.
64*/
65QPlaceReply::Type QPlaceIdReply::type() const
66{
67 return QPlaceReply::IdReply;
68}
69
70/*!
71 Returns the operation type of the reply. This means whether this
72 identifier reply was for a save place operation,
73 remove category operation and so on.
74*/
75QPlaceIdReply::OperationType QPlaceIdReply::operationType() const
76{
77 Q_D(const QPlaceIdReply);
78 return d->operationType;
79}
80
81/*!
82 Returns the relevant identifier for the operation. For example for a save place operation,
83 the identifier is that of the saved place. For a category removal operation,
84 it is the identifier of the category that was removed.
85*/
86QString QPlaceIdReply::id() const
87{
88 Q_D(const QPlaceIdReply);
89 return d->id;
90}
91
92/*!
93 Sets the \a identifier of the reply.
94*/
95void QPlaceIdReply::setId(const QString &identifier)
96{
97 Q_D(QPlaceIdReply);
98 d->id = identifier;
99}
QPlaceIdReplyPrivate(QPlaceIdReply::OperationType operationType)