| 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 | |
| 37 | #ifndef QPLACE_H |
| 38 | #define QPLACE_H |
| 39 | |
| 40 | #include <QtCore/QSharedDataPointer> |
| 41 | #include <QtPositioning/QGeoAddress> |
| 42 | #include <QtPositioning/QGeoRectangle> |
| 43 | #include <QtPositioning/QGeoCoordinate> |
| 44 | #include <QtPositioning/QGeoLocation> |
| 45 | #include <QtLocation/QPlaceCategory> |
| 46 | #include <QtLocation/QPlaceContent> |
| 47 | #include <QtLocation/QPlaceRatings> |
| 48 | #include <QtLocation/QPlaceReview> |
| 49 | #include <QtLocation/QPlaceAttribute> |
| 50 | #include <QtLocation/QPlaceContactDetail> |
| 51 | |
| 52 | QT_BEGIN_NAMESPACE |
| 53 | |
| 54 | class QString; |
| 55 | class QPlaceIcon; |
| 56 | class QPlacePrivate; |
| 57 | |
| 58 | class Q_LOCATION_EXPORT QPlace |
| 59 | { |
| 60 | public: |
| 61 | QPlace(); |
| 62 | QPlace(const QPlace &other); |
| 63 | ~QPlace(); |
| 64 | |
| 65 | QPlace &operator=(const QPlace &other); |
| 66 | |
| 67 | bool operator==(const QPlace &other) const; |
| 68 | bool operator!=(const QPlace &other) const; |
| 69 | |
| 70 | QList<QPlaceCategory> categories() const; |
| 71 | void setCategory(const QPlaceCategory &category); |
| 72 | void setCategories(const QList<QPlaceCategory> &categories); |
| 73 | QGeoLocation location() const; |
| 74 | void setLocation(const QGeoLocation &location); |
| 75 | QPlaceRatings ratings() const; |
| 76 | void setRatings(const QPlaceRatings &ratings); |
| 77 | QPlaceSupplier supplier() const; |
| 78 | void setSupplier(const QPlaceSupplier &supplier); |
| 79 | |
| 80 | QString attribution() const; |
| 81 | void setAttribution(const QString &attribution); |
| 82 | |
| 83 | QPlaceIcon icon() const; |
| 84 | void setIcon(const QPlaceIcon &icon); |
| 85 | |
| 86 | QPlaceContent::Collection content(QPlaceContent::Type type) const; |
| 87 | void setContent(QPlaceContent::Type type, const QPlaceContent::Collection &content); |
| 88 | void insertContent(QPlaceContent::Type type, const QPlaceContent::Collection &content); |
| 89 | |
| 90 | int totalContentCount(QPlaceContent::Type type) const; |
| 91 | void setTotalContentCount(QPlaceContent::Type type, int total); |
| 92 | |
| 93 | QString name() const; |
| 94 | void setName(const QString &name); |
| 95 | QString placeId() const; |
| 96 | void setPlaceId(const QString &identifier); |
| 97 | |
| 98 | QString primaryPhone() const; |
| 99 | QString primaryFax() const; |
| 100 | QString primaryEmail() const; |
| 101 | QUrl primaryWebsite() const; |
| 102 | |
| 103 | bool detailsFetched() const; |
| 104 | void setDetailsFetched(bool fetched); |
| 105 | |
| 106 | QStringList extendedAttributeTypes() const; |
| 107 | QPlaceAttribute extendedAttribute(const QString &attributeType) const; |
| 108 | void setExtendedAttribute(const QString &attributeType, const QPlaceAttribute &attribute); |
| 109 | void removeExtendedAttribute(const QString &attributeType); |
| 110 | |
| 111 | QStringList contactTypes() const; |
| 112 | QList<QPlaceContactDetail> contactDetails(const QString &contactType) const; |
| 113 | void setContactDetails(const QString &contactType, QList<QPlaceContactDetail> details); |
| 114 | void appendContactDetail(const QString &contactType, const QPlaceContactDetail &detail); |
| 115 | void removeContactDetails(const QString &contactType); |
| 116 | |
| 117 | QLocation::Visibility visibility() const; |
| 118 | void setVisibility(QLocation::Visibility visibility); |
| 119 | |
| 120 | bool isEmpty() const; |
| 121 | |
| 122 | protected: |
| 123 | QPlace(const QSharedDataPointer<QPlacePrivate> &dd); |
| 124 | QSharedDataPointer<QPlacePrivate> &d(); |
| 125 | |
| 126 | private: |
| 127 | QSharedDataPointer<QPlacePrivate> d_ptr; |
| 128 | |
| 129 | inline QPlacePrivate *d_func(); |
| 130 | inline const QPlacePrivate *d_func() const; |
| 131 | friend class QDeclarativePlace; |
| 132 | }; |
| 133 | |
| 134 | Q_DECLARE_TYPEINFO(QPlace, Q_MOVABLE_TYPE); |
| 135 | |
| 136 | QT_END_NAMESPACE |
| 137 | |
| 138 | Q_DECLARE_METATYPE(QPlace) |
| 139 | |
| 140 | #endif |
| 141 | |