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
qplacecontent.h
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// Qt-Security score:significant reason:default
4#ifndef QPLACECONTENT_H
5#define QPLACECONTENT_H
6
7#include <QtLocation/qlocationglobal.h>
8
9#include <QtCore/QExplicitlySharedDataPointer>
10#include <QtCore/QMap>
11#include <QtCore/QMetaType>
12#include <QtCore/QVariant>
13
14#include <QtLocation/QPlaceUser>
15#include <QtLocation/QPlaceSupplier>
16
17QT_BEGIN_NAMESPACE
18
19class QPlaceContentPrivate;
20QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QPlaceContentPrivate, Q_LOCATION_EXPORT)
21
22class Q_LOCATION_EXPORT QPlaceContent
23{
24public:
25 typedef QMap<int, QPlaceContent> Collection;
26
27 enum Type {
28 NoType = 0,
29 ImageType,
30 ReviewType,
31 EditorialType,
32 CustomType = 0x0100
33 };
34
35 enum DataTag {
36 ContentSupplier,
37 ContentUser,
38 ContentAttribution,
39 ImageId,
40 ImageUrl,
41 ImageMimeType,
42 EditorialTitle,
43 EditorialText,
44 EditorialLanguage,
45 ReviewId,
46 ReviewDateTime,
47 ReviewTitle,
48 ReviewText,
49 ReviewLanguage,
50 ReviewRating,
51 CustomDataTag = 1000
52 };
53
54 QPlaceContent(Type type = NoType);
55 ~QPlaceContent();
56
57 QPlaceContent(const QPlaceContent &other) noexcept;
58 QPlaceContent &operator=(const QPlaceContent &other) noexcept;
59
60 QPlaceContent(QPlaceContent &&other) noexcept = default;
61 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QPlaceContent)
62 void swap(QPlaceContent &other) noexcept
63 { d_ptr.swap(other.d_ptr); }
64 void detach();
65
66 bool operator==(const QPlaceContent &other) const;
67 bool operator!=(const QPlaceContent &other) const;
68
69 QPlaceContent::Type type() const;
70
71 QList<DataTag> dataTags() const;
72 QVariant value(DataTag tag) const;
73 void setValue(DataTag tag, const QVariant &);
74
75#if QT_DEPRECATED_SINCE(6, 0)
76 QT_DEPRECATED_VERSION_X_6_0("Use value()") QPlaceSupplier supplier() const
77 { return value(QPlaceContent::ContentSupplier).value<QPlaceSupplier>(); }
78 QT_DEPRECATED_VERSION_X_6_0("Use setValue()") void setSupplier(const QPlaceSupplier &supplier)
79 { setValue(QPlaceContent::ContentSupplier, QVariant::fromValue(supplier)); }
80
81 QT_DEPRECATED_VERSION_X_6_0("Use value()") QPlaceUser user() const
82 { return value(QPlaceContent::ContentUser).value<QPlaceUser>(); }
83 QT_DEPRECATED_VERSION_X_6_0("Use setValue()") void setUser(const QPlaceUser &user)
84 { setValue(QPlaceContent::ContentUser, QVariant::fromValue(user)); }
85
86 QT_DEPRECATED_VERSION_X_6_0("Use value()") QString attribution() const
87 { return value(QPlaceContent::ContentAttribution).value<QString>(); }
88 QT_DEPRECATED_VERSION_X_6_0("Use setValue()") void setAttribution(const QString &attribution)
89 { setValue(QPlaceContent::ContentAttribution, QVariant::fromValue(attribution)); }
90#endif
91
92protected:
93 inline QPlaceContentPrivate *d_func();
94 inline const QPlaceContentPrivate *d_func() const;
95
96private:
97 QExplicitlySharedDataPointer<QPlaceContentPrivate> d_ptr;
98 friend class QPlaceContentPrivate;
99};
100
101QT_END_NAMESPACE
102
103Q_DECLARE_METATYPE(QPlaceContent)
104Q_DECLARE_METATYPE(QPlaceContent::Type)
105
106#endif
\inmodule QtLocation