41 QML_NAMED_ELEMENT(Place)
42 QML_ADDED_IN_VERSION(5, 0)
44 Q_PROPERTY(QPlace place READ place WRITE setPlace)
45 Q_PROPERTY(QDeclarativeGeoServiceProvider *plugin READ plugin WRITE setPlugin NOTIFY pluginChanged)
46 Q_PROPERTY(QQmlListProperty<QDeclarativeCategory> categories READ categories NOTIFY categoriesChanged)
47 Q_PROPERTY(QDeclarativeGeoLocation *location READ location WRITE setLocation NOTIFY locationChanged)
48 Q_PROPERTY(QPlaceRatings ratings READ ratings WRITE setRatings NOTIFY ratingsChanged)
49 Q_PROPERTY(QPlaceSupplier supplier READ supplier WRITE setSupplier NOTIFY supplierChanged)
50 Q_PROPERTY(QPlaceIcon icon READ icon WRITE setIcon NOTIFY iconChanged)
51 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
52 Q_PROPERTY(QString placeId READ placeId WRITE setPlaceId NOTIFY placeIdChanged)
53 Q_PROPERTY(QString attribution READ attribution WRITE setAttribution NOTIFY attributionChanged)
55 Q_PROPERTY(QDeclarativePlaceReviewModel *reviewModel READ reviewModel NOTIFY reviewModelChanged)
56 Q_PROPERTY(QDeclarativePlaceImageModel *imageModel READ imageModel NOTIFY imageModelChanged)
57 Q_PROPERTY(QDeclarativePlaceEditorialModel *editorialModel READ editorialModel NOTIFY editorialModelChanged)
59 Q_PROPERTY(QObject *extendedAttributes READ extendedAttributes NOTIFY extendedAttributesChanged)
60 Q_PROPERTY(QDeclarativeContactDetails *contactDetails READ contactDetails NOTIFY contactDetailsChanged)
61 Q_PROPERTY(
bool detailsFetched READ detailsFetched NOTIFY detailsFetchedChanged)
62 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
64 Q_PROPERTY(QString primaryPhone READ primaryPhone NOTIFY primaryPhoneChanged)
65 Q_PROPERTY(QString primaryFax READ primaryFax NOTIFY primaryFaxChanged)
66 Q_PROPERTY(QString primaryEmail READ primaryEmail NOTIFY primaryEmailChanged)
67 Q_PROPERTY(QUrl primaryWebsite READ primaryWebsite NOTIFY primaryWebsiteChanged)
69 Q_PROPERTY(Visibility visibility READ visibility WRITE setVisibility NOTIFY visibilityChanged)
70 Q_PROPERTY(QDeclarativePlace *favorite READ favorite WRITE setFavorite NOTIFY favoriteChanged)
72 Q_INTERFACES(QQmlParserStatus)
75 explicit QDeclarativePlace(QObject *parent =
nullptr);
76 QDeclarativePlace(
const QPlace &src, QDeclarativeGeoServiceProvider *plugin, QObject *parent =
nullptr);
79 enum Status {Ready, Saving, Fetching, Removing, Error};
83 UnspecifiedVisibility = QLocation::UnspecifiedVisibility,
84 DeviceVisibility = QLocation::DeviceVisibility,
85 PrivateVisibility = QLocation::PrivateVisibility,
86 PublicVisibility = QLocation::PublicVisibility
91 void classBegin() override {}
92 void componentComplete() override;
94 void setPlugin(QDeclarativeGeoServiceProvider *plugin);
95 QDeclarativeGeoServiceProvider *plugin()
const;
97 QDeclarativePlaceReviewModel *reviewModel();
98 QDeclarativePlaceImageModel *imageModel();
99 QDeclarativePlaceEditorialModel *editorialModel();
101 QPlace place()
const;
102 void setPlace(
const QPlace &src);
104 QQmlListProperty<QDeclarativeCategory> categories();
105 static void category_append(QQmlListProperty<QDeclarativeCategory> *prop,
106 QDeclarativeCategory *value);
107 static qsizetype category_count(QQmlListProperty<QDeclarativeCategory> *prop);
108 static QDeclarativeCategory *category_at(QQmlListProperty<QDeclarativeCategory> *prop, qsizetype index);
109 static void category_clear(QQmlListProperty<QDeclarativeCategory> *prop);
111 QDeclarativeGeoLocation *location()
const;
112 void setLocation(QDeclarativeGeoLocation *location);
113 QPlaceRatings ratings()
const;
114 void setRatings(
const QPlaceRatings &ratings);
115 QPlaceSupplier supplier()
const;
116 void setSupplier(
const QPlaceSupplier &supplier);
117 QPlaceIcon icon()
const;
118 void setIcon(
const QPlaceIcon &icon);
119 QString name()
const;
120 void setName(
const QString &name);
121 QString placeId()
const;
122 void setPlaceId(
const QString &placeId);
123 QString attribution()
const;
124 void setAttribution(
const QString &attribution);
125 bool detailsFetched()
const;
127 Status status()
const;
128 void setStatus(Status status,
const QString &errorString = QString());
130 Q_INVOKABLE
void getDetails();
131 Q_INVOKABLE
void save();
132 Q_INVOKABLE
void remove();
133 Q_INVOKABLE QString errorString()
const;
135 QString primaryPhone()
const;
136 QString primaryFax()
const;
137 QString primaryEmail()
const;
138 QUrl primaryWebsite()
const;
140 QQmlPropertyMap *extendedAttributes()
const;
142 QDeclarativeContactDetails *contactDetails()
const;
144 Visibility visibility()
const;
145 void setVisibility(Visibility visibility);
147 QDeclarativePlace *favorite()
const;
148 void setFavorite(QDeclarativePlace *favorite);
150 Q_INVOKABLE
void copyFrom(QDeclarativePlace *original);
151 Q_INVOKABLE
void initializeFavorite(QDeclarativeGeoServiceProvider *plugin);
154 void pluginChanged();
155 void categoriesChanged();
156 void locationChanged();
157 void ratingsChanged();
158 void supplierChanged();
161 void placeIdChanged();
162 void attributionChanged();
163 void detailsFetchedChanged();
164 void reviewModelChanged();
165 void imageModelChanged();
166 void editorialModelChanged();
168 void primaryPhoneChanged();
169 void primaryFaxChanged();
170 void primaryEmailChanged();
171 void primaryWebsiteChanged();
173 void extendedAttributesChanged();
174 void contactDetailsChanged();
175 void statusChanged();
176 void visibilityChanged();
177 void favoriteChanged();
181 void contactsModified(
const QString &,
const QVariant &);
183 void cleanupDeletedCategories();
185 void synchronizeCategories();
186 void pullExtendedAttributes();
187 void synchronizeContacts();
188 void primarySignalsEmission(
const QString &type = QString());
189 QString primaryValue(
const QString &contactType)
const;
192 QPlaceManager *manager();
194 QList<QDeclarativeCategory *> m_categories;
195 QDeclarativeGeoLocation *m_location =
nullptr;
196 QDeclarativePlaceReviewModel *m_reviewModel =
nullptr;
197 QDeclarativePlaceImageModel *m_imageModel =
nullptr;
198 QDeclarativePlaceEditorialModel *m_editorialModel =
nullptr;
199 QQmlPropertyMap *m_extendedAttributes =
nullptr;
200 QDeclarativeContactDetails *m_contactDetails =
nullptr;
204 QPlaceReply *m_reply =
nullptr;
206 QDeclarativeGeoServiceProvider *m_plugin =
nullptr;
207 bool m_complete =
false;
209 QString m_prevPrimaryPhone;
210 QString m_prevPrimaryEmail;
211 QString m_prevPrimaryFax;
212 QUrl m_prevPrimaryWebsite;
214 QDeclarativePlace *m_favorite =
nullptr;
216 Status m_status = Ready;
217 QString m_errorString;
219 QList<QDeclarativeCategory *>m_categoriesToBeDeleted;