1/****************************************************************************
2**
3** Copyright (C) 2015 The Qt Company Ltd.
4** Contact: http://www.qt.io/licensing/
5**
6** This file is part of the QtLocation module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL3$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see http://www.qt.io/terms-conditions. For further
15** information use the contact form at http://www.qt.io/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 3 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPLv3 included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 3 requirements
23** will be met: https://www.gnu.org/licenses/lgpl.html.
24**
25** GNU General Public License Usage
26** Alternatively, this file may be used under the terms of the GNU
27** General Public License version 2.0 or later as published by the Free
28** Software Foundation and appearing in the file LICENSE.GPL included in
29** the packaging of this file. Please review the following information to
30** ensure the GNU General Public License version 2.0 requirements will be
31** met: http://www.gnu.org/licenses/gpl-2.0.html.
32**
33** $QT_END_LICENSE$
34**
35****************************************************************************/
36#ifndef QPLACECONTENT_H
37#define QPLACECONTENT_H
38
39#include <QtLocation/qlocationglobal.h>
40
41#include <QtCore/QMap>
42#include <QtCore/QMetaType>
43#include <QtCore/QSharedDataPointer>
44
45QT_BEGIN_NAMESPACE
46
47#define Q_DECLARE_CONTENT_D_FUNC(Class) \
48 inline Class##Private *d_func(); \
49 inline const Class##Private *d_func() const;\
50 friend class Class##Private;
51
52#define Q_DECLARE_CONTENT_COPY_CTOR(Class) \
53 Class(const QPlaceContent &other);
54
55class QPlaceUser;
56class QPlaceSupplier;
57class QPlaceContentPrivate;
58class Q_LOCATION_EXPORT QPlaceContent
59{
60public:
61 typedef QMap<int, QPlaceContent> Collection;
62
63 enum Type {
64 NoType = 0,
65 ImageType,
66 ReviewType,
67 EditorialType,
68 CustomType = 0x0100
69 };
70
71 QPlaceContent();
72 QPlaceContent(const QPlaceContent &other);
73 virtual ~QPlaceContent();
74
75 QPlaceContent &operator=(const QPlaceContent &other);
76
77 bool operator==(const QPlaceContent &other) const;
78 bool operator!=(const QPlaceContent &other) const;
79
80 QPlaceContent::Type type() const;
81
82 QPlaceSupplier supplier() const;
83 void setSupplier(const QPlaceSupplier &supplier);
84
85 QPlaceUser user() const;
86 void setUser(const QPlaceUser &user);
87
88 QString attribution() const;
89 void setAttribution(const QString &attribution);
90
91protected:
92 explicit QPlaceContent(QPlaceContentPrivate *d);
93 QSharedDataPointer<QPlaceContentPrivate> d_ptr;
94
95private:
96 inline QPlaceContentPrivate *d_func();
97 inline const QPlaceContentPrivate *d_func() const;
98
99 friend class QPlaceContentPrivate;
100};
101
102QT_END_NAMESPACE
103
104Q_DECLARE_METATYPE(QPlaceContent)
105Q_DECLARE_METATYPE(QPlaceContent::Type)
106
107#endif
108
109

source code of qtlocation/src/location/places/qplacecontent.h