41 QML_NAMED_ELEMENT(Place)
42 QML_ADDED_IN_VERSION(5, 0)
43 Q_ENUMS(Status Visibility)
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};
82 UnspecifiedVisibility = QLocation::UnspecifiedVisibility,
83 DeviceVisibility = QLocation::DeviceVisibility,
84 PrivateVisibility = QLocation::PrivateVisibility,
85 PublicVisibility = QLocation::PublicVisibility
89 void classBegin() override {}
90 void componentComplete() override;
92 void setPlugin(QDeclarativeGeoServiceProvider *plugin);
93 QDeclarativeGeoServiceProvider *plugin()
const;
95 QDeclarativePlaceReviewModel *reviewModel();
96 QDeclarativePlaceImageModel *imageModel();
97 QDeclarativePlaceEditorialModel *editorialModel();
100 void setPlace(
const QPlace &src);
102 QQmlListProperty<QDeclarativeCategory> categories();
103 static void category_append(QQmlListProperty<QDeclarativeCategory> *prop,
104 QDeclarativeCategory *value);
105 static qsizetype category_count(QQmlListProperty<QDeclarativeCategory> *prop);
106 static QDeclarativeCategory *category_at(QQmlListProperty<QDeclarativeCategory> *prop, qsizetype index);
107 static void category_clear(QQmlListProperty<QDeclarativeCategory> *prop);
109 QDeclarativeGeoLocation *location()
const;
110 void setLocation(QDeclarativeGeoLocation *location);
111 QPlaceRatings ratings()
const;
112 void setRatings(
const QPlaceRatings &ratings);
113 QPlaceSupplier supplier()
const;
114 void setSupplier(
const QPlaceSupplier &supplier);
115 QPlaceIcon icon()
const;
116 void setIcon(
const QPlaceIcon &icon);
117 QString name()
const;
118 void setName(
const QString &name);
119 QString placeId()
const;
120 void setPlaceId(
const QString &placeId);
121 QString attribution()
const;
122 void setAttribution(
const QString &attribution);
123 bool detailsFetched()
const;
125 Status status()
const;
126 void setStatus(Status status,
const QString &errorString = QString());
128 Q_INVOKABLE
void getDetails();
129 Q_INVOKABLE
void save();
130 Q_INVOKABLE
void remove();
131 Q_INVOKABLE QString errorString()
const;
133 QString primaryPhone()
const;
134 QString primaryFax()
const;
135 QString primaryEmail()
const;
136 QUrl primaryWebsite()
const;
138 QQmlPropertyMap *extendedAttributes()
const;
140 QDeclarativeContactDetails *contactDetails()
const;
142 Visibility visibility()
const;
143 void setVisibility(Visibility visibility);
145 QDeclarativePlace *favorite()
const;
146 void setFavorite(QDeclarativePlace *favorite);
148 Q_INVOKABLE
void copyFrom(QDeclarativePlace *original);
149 Q_INVOKABLE
void initializeFavorite(QDeclarativeGeoServiceProvider *plugin);
152 void pluginChanged();
153 void categoriesChanged();
154 void locationChanged();
155 void ratingsChanged();
156 void supplierChanged();
159 void placeIdChanged();
160 void attributionChanged();
161 void detailsFetchedChanged();
162 void reviewModelChanged();
163 void imageModelChanged();
164 void editorialModelChanged();
166 void primaryPhoneChanged();
167 void primaryFaxChanged();
168 void primaryEmailChanged();
169 void primaryWebsiteChanged();
171 void extendedAttributesChanged();
172 void contactDetailsChanged();
173 void statusChanged();
174 void visibilityChanged();
175 void favoriteChanged();
179 void contactsModified(
const QString &,
const QVariant &);
181 void cleanupDeletedCategories();
183 void synchronizeCategories();
184 void pullExtendedAttributes();
185 void synchronizeContacts();
186 void primarySignalsEmission(
const QString &type = QString());
187 QString primaryValue(
const QString &contactType)
const;
190 QPlaceManager *manager();
192 QList<QDeclarativeCategory *> m_categories;
193 QDeclarativeGeoLocation *m_location =
nullptr;
194 QDeclarativePlaceReviewModel *m_reviewModel =
nullptr;
195 QDeclarativePlaceImageModel *m_imageModel =
nullptr;
196 QDeclarativePlaceEditorialModel *m_editorialModel =
nullptr;
197 QQmlPropertyMap *m_extendedAttributes =
nullptr;
198 QDeclarativeContactDetails *m_contactDetails =
nullptr;
202 QPlaceReply *m_reply =
nullptr;
204 QDeclarativeGeoServiceProvider *m_plugin =
nullptr;
205 bool m_complete =
false;
207 QString m_prevPrimaryPhone;
208 QString m_prevPrimaryEmail;
209 QString m_prevPrimaryFax;
210 QUrl m_prevPrimaryWebsite;
212 QDeclarativePlace *m_favorite =
nullptr;
214 Status m_status = Ready;
215 QString m_errorString;
217 QList<QDeclarativeCategory *>m_categoriesToBeDeleted;