136 \note For simplicty's sake we have assumed that every search result is of
137 \l {Search Result Types} {type} \c PlaceSearchResult and so always have
138 access to the \e place role, other search result types may not have a
139 \e place role.
140
141 See the \l {Places Map(QML)} {Places Map} example for full source code.
142
143 \section2 Fetching Place Details
144 In order to save bandwidth, sometimes a backend will only return places which
145 are partially populated with details. This can be checked with the
146 Place::detailsFetched property which indicates whether all availalable details
147 have been fetched or not. If not, the Place::getDetails() method can be invoked
148 to fetch the remaining details.
149
150 \snippet declarative/places.qml Place fetchDetails
151
152 \section2 Saving and Removing Places
153 Some backends may support saving and removing places. This can be done by
154 calling the Place::save() and Place::remove() methods respectively. Note
155 that in order to save a \l Place, a \l Plugin must be assigned to specify
156 which backend we are saving to. The \l {Place::status} {status} property will
157 transition into the \c Saving state while the save operation is happening and on
158 successful completion will move to the \c Ready state. The following
159 snippet shows how to save and remove a place using javascript.
160
161 \snippet declarative/places.qml Place createAndSavePlace
162 \codeline
163 \snippet declarative/places.qml Place removePlace
164
165 \section2 Learn More
166 The above snippets only exhibit a small subset of Places functionality.
167 Refer to the \l {Places Types} shown below for richer content such as \l {ImageModel} {images}, \l {ReviewModel} {reviews} etc, as well as more indepth descriptions and explanations.
168
169 See also the \l {Places (QML)}{Places (QML)} example for a more comprehensive demonstration on
170 how to use the API.
171
172 \section1 Places Types
173 \section2 Data Types
174 \annotatedlist qml-QtLocation5-places-data
175
176 \section2 Models
177 \annotatedlist qml-QtLocation5-places-models
178*/
179
180/*!
181 \page location-places-cpp.html
182 \title Places (C++)
183
184 \section1 Overview
185
186 The Places API allows users to discover places/points of interest
187 and view details about them such as address and contact information;
188 some places may even have rich content such as images and reviews.
189 The Places API also facilitates management of places and
190 categories, allowing users to save and remove them.
191
192 \section1 Place Definition
193 \include place-definition.qdocinc
194
195 \section1 Common Operations
196
197 \section2 Initializing a Manager
198 All places functionality is facilitated by a QPlaceManager instance. One must specify
199 a QGeoServiceProvider in order to create the QPlaceManager
363 When a category is removed, the QPlaceManager may emit the QPlaceManager::categoryRemoved() signal. Whether a
364 manager does so is provider specific. Managers accessing places from a web service will typically not emit
365 these signals, while managers accessing places stored locally generally will.
366
367 \section2 Matching Places Between Managers
368 Sometimes you may want to cross reference whether places from one manager match those from another manager.
369 Such a situation may arise where one manager provides read-only access to places (origin manager) while another second r/w
370 manager (destination manager) is used to save selected favorites from the first. During a search
371 of the origin manager we may want to know which ones have been 'favorited' into the destination manager and perhaps display
372 a customized favorite name rather than the original name.
373
374 The matching mechanism can vary between managers, but is typically accomplished through an alternative identifier.
375 As part of the save process, the place identifier from the origin manager is saved as an alternative identifier attribute in the destination manager
376 (which can have its own place identifier scheme). In the following example, the origin manager is from the 'here' QGeoServiceProider, therefore
377 as part of the saving process an alternative identifier attribute, x_id_here, is set for the place saved into the destination manager
378 (when QPlaceManager::compatiblePlace() is called)
379
380 \input place-crossref.qdocinc
381
382 In order to perform the matching, we create a QPlaceMatchRequest and assign it the search results from the origin manager.
383 The QPlaceMatchRequest will be used on the destination manager to return corresponding places. We also specify
384 matching parameters which are key value pairs. As mentioned previously, this can vary depending on the manager but typically
385 the key is QPlaceMatchRequest::AlternativeId to indicate we are matching by alternative id, the value in this case would be
386 x_id_here which specifies which alternative identifier attribute we are using to do the matching.
387
388 \snippet places/requesthandler.h Match places
389 \dots
390 \dots
391 \snippet places/requesthandler.h Match places handler