42 QML_NAMED_ELEMENT(Place)
43 QML_ADDED_IN_VERSION(5, 0)
45 Q_PROPERTY(QPlace place READ place WRITE setPlace)
46 Q_PROPERTY(QDeclarativeGeoServiceProvider *plugin READ plugin WRITE setPlugin NOTIFY pluginChanged)
47 Q_PROPERTY(QQmlListProperty<QDeclarativeCategory> categories READ categories NOTIFY categoriesChanged)
48 Q_PROPERTY(QDeclarativeGeoLocation *location READ location WRITE setLocation NOTIFY locationChanged)
49 Q_PROPERTY(QPlaceRatings ratings READ ratings WRITE setRatings NOTIFY ratingsChanged)
50 Q_PROPERTY(QPlaceSupplier supplier READ supplier WRITE setSupplier NOTIFY supplierChanged)
51 Q_PROPERTY(QPlaceIcon icon READ icon WRITE setIcon NOTIFY iconChanged)
52 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
53 Q_PROPERTY(QString placeId READ placeId WRITE setPlaceId NOTIFY placeIdChanged)
54 Q_PROPERTY(QString attribution READ attribution WRITE setAttribution NOTIFY attributionChanged)
56 Q_PROPERTY(QDeclarativePlaceReviewModel *reviewModel READ reviewModel NOTIFY reviewModelChanged)
57 Q_PROPERTY(QDeclarativePlaceImageModel *imageModel READ imageModel NOTIFY imageModelChanged)
58 Q_PROPERTY(QDeclarativePlaceEditorialModel *editorialModel READ editorialModel NOTIFY editorialModelChanged)
60 Q_PROPERTY(QObject *extendedAttributes READ extendedAttributes NOTIFY extendedAttributesChanged)
61 Q_PROPERTY(QDeclarativeContactDetails *contactDetails READ contactDetails NOTIFY contactDetailsChanged)
62 Q_PROPERTY(
bool detailsFetched READ detailsFetched NOTIFY detailsFetchedChanged)
63 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
65 Q_PROPERTY(QString primaryPhone READ primaryPhone NOTIFY primaryPhoneChanged)
66 Q_PROPERTY(QString primaryFax READ primaryFax NOTIFY primaryFaxChanged)
67 Q_PROPERTY(QString primaryEmail READ primaryEmail NOTIFY primaryEmailChanged)
68 Q_PROPERTY(QUrl primaryWebsite READ primaryWebsite NOTIFY primaryWebsiteChanged)
70 Q_PROPERTY(Visibility visibility READ visibility WRITE setVisibility NOTIFY visibilityChanged)
71 Q_PROPERTY(QDeclarativePlace *favorite READ favorite WRITE setFavorite NOTIFY favoriteChanged)
73 Q_INTERFACES(QQmlParserStatus)
76 explicit QDeclarativePlace(QObject *parent =
nullptr);
77 QDeclarativePlace(
const QPlace &src, QDeclarativeGeoServiceProvider *plugin, QObject *parent =
nullptr);
80 enum Status {Ready, Saving, Fetching, Removing, Error};
84 UnspecifiedVisibility = QLocation::UnspecifiedVisibility,
85 DeviceVisibility = QLocation::DeviceVisibility,
86 PrivateVisibility = QLocation::PrivateVisibility,
87 PublicVisibility = QLocation::PublicVisibility
92 void classBegin() override {}
93 void componentComplete() override;
95 void setPlugin(QDeclarativeGeoServiceProvider *plugin);
96 QDeclarativeGeoServiceProvider *plugin()
const;
98 QDeclarativePlaceReviewModel *reviewModel();
99 QDeclarativePlaceImageModel *imageModel();
100 QDeclarativePlaceEditorialModel *editorialModel();
102 QPlace place()
const;
103 void setPlace(
const QPlace &src);
105 QQmlListProperty<QDeclarativeCategory> categories();
106 static void category_append(QQmlListProperty<QDeclarativeCategory> *prop,
107 QDeclarativeCategory *value);
108 static qsizetype category_count(QQmlListProperty<QDeclarativeCategory> *prop);
109 static QDeclarativeCategory *category_at(QQmlListProperty<QDeclarativeCategory> *prop, qsizetype index);
110 static void category_clear(QQmlListProperty<QDeclarativeCategory> *prop);
112 QDeclarativeGeoLocation *location()
const;
113 void setLocation(QDeclarativeGeoLocation *location);
114 QPlaceRatings ratings()
const;
115 void setRatings(
const QPlaceRatings &ratings);
116 QPlaceSupplier supplier()
const;
117 void setSupplier(
const QPlaceSupplier &supplier);
118 QPlaceIcon icon()
const;
119 void setIcon(
const QPlaceIcon &icon);
120 QString name()
const;
121 void setName(
const QString &name);
122 QString placeId()
const;
123 void setPlaceId(
const QString &placeId);
124 QString attribution()
const;
125 void setAttribution(
const QString &attribution);
126 bool detailsFetched()
const;
128 Status status()
const;
129 void setStatus(Status status,
const QString &errorString = QString());
131 Q_INVOKABLE
void getDetails();
132 Q_INVOKABLE
void save();
133 Q_INVOKABLE
void remove();
134 Q_INVOKABLE QString errorString()
const;
136 QString primaryPhone()
const;
137 QString primaryFax()
const;
138 QString primaryEmail()
const;
139 QUrl primaryWebsite()
const;
141 QQmlPropertyMap *extendedAttributes()
const;
143 QDeclarativeContactDetails *contactDetails()
const;
145 Visibility visibility()
const;
146 void setVisibility(Visibility visibility);
148 QDeclarativePlace *favorite()
const;
149 void setFavorite(QDeclarativePlace *favorite);
151 Q_INVOKABLE
void copyFrom(QDeclarativePlace *original);
152 Q_INVOKABLE
void initializeFavorite(QDeclarativeGeoServiceProvider *plugin);
155 void pluginChanged();
156 void categoriesChanged();
157 void locationChanged();
158 void ratingsChanged();
159 void supplierChanged();
162 void placeIdChanged();
163 void attributionChanged();
164 void detailsFetchedChanged();
165 void reviewModelChanged();
166 void imageModelChanged();
167 void editorialModelChanged();
169 void primaryPhoneChanged();
170 void primaryFaxChanged();
171 void primaryEmailChanged();
172 void primaryWebsiteChanged();
174 void extendedAttributesChanged();
175 void contactDetailsChanged();
176 void statusChanged();
177 void visibilityChanged();
178 void favoriteChanged();
182 void contactsModified(
const QString &,
const QVariant &);
184 void cleanupDeletedCategories();
186 void synchronizeCategories();
187 void pullExtendedAttributes();
188 void synchronizeContacts();
189 void primarySignalsEmission(
const QString &type = QString());
190 QString primaryValue(
const QString &contactType)
const;
193 QPlaceManager *manager();
195 QList<QDeclarativeCategory *> m_categories;
196 QDeclarativeGeoLocation *m_location =
nullptr;
197 QDeclarativePlaceReviewModel *m_reviewModel =
nullptr;
198 QDeclarativePlaceImageModel *m_imageModel =
nullptr;
199 QDeclarativePlaceEditorialModel *m_editorialModel =
nullptr;
200 QQmlPropertyMap *m_extendedAttributes =
nullptr;
201 QDeclarativeContactDetails *m_contactDetails =
nullptr;
205 QPlaceReply *m_reply =
nullptr;
207 QDeclarativeGeoServiceProvider *m_plugin =
nullptr;
208 bool m_complete =
false;
210 QString m_prevPrimaryPhone;
211 QString m_prevPrimaryEmail;
212 QString m_prevPrimaryFax;
213 QUrl m_prevPrimaryWebsite;
215 QDeclarativePlace *m_favorite =
nullptr;
217 Status m_status = Ready;
218 QString m_errorString;
220 QList<QDeclarativeCategory *>m_categoriesToBeDeleted;