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