qplace.h 4.7 KB

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