/usr/share/gtk-doc/html/geocode-glib/GeocodeBackend.html is in libgeocode-glib-doc 3.25.4.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GeocodeBackend: geocode-glib Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="index.html" title="geocode-glib Reference Manual">
<link rel="up" href="ch01.html" title="Geocode-glib">
<link rel="prev" href="ch01.html" title="Geocode-glib">
<link rel="next" href="geocode-glib-geocode-error.html" title="geocode-error">
<meta name="generator" content="GTK-Doc V1.25 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span>
<a href="#GeocodeBackend.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span>
<a href="#GeocodeBackend.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_prerequisites"> <span class="dim">|</span>
<a href="#GeocodeBackend.prerequisites" class="shortcut">Prerequisites</a></span><span id="nav_implementations"> <span class="dim">|</span>
<a href="#GeocodeBackend.implementations" class="shortcut">Known Implementations</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="ch01.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="geocode-glib-geocode-error.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GeocodeBackend"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GeocodeBackend.top_of_page"></a>GeocodeBackend</span></h2>
<p>GeocodeBackend — Geocode backend object</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GeocodeBackend.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GeocodeBackend.html#geocode-backend-forward-search-async" title="geocode_backend_forward_search_async ()">geocode_backend_forward_search_async</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GList</span> *
</td>
<td class="function_name">
<a class="link" href="GeocodeBackend.html#geocode-backend-forward-search-finish" title="geocode_backend_forward_search_finish ()">geocode_backend_forward_search_finish</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GList</span> *
</td>
<td class="function_name">
<a class="link" href="GeocodeBackend.html#geocode-backend-forward-search" title="geocode_backend_forward_search ()">geocode_backend_forward_search</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GeocodeBackend.html#geocode-backend-reverse-resolve-async" title="geocode_backend_reverse_resolve_async ()">geocode_backend_reverse_resolve_async</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GList</span> *
</td>
<td class="function_name">
<a class="link" href="GeocodeBackend.html#geocode-backend-reverse-resolve-finish" title="geocode_backend_reverse_resolve_finish ()">geocode_backend_reverse_resolve_finish</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GList</span> *
</td>
<td class="function_name">
<a class="link" href="GeocodeBackend.html#geocode-backend-reverse-resolve" title="geocode_backend_reverse_resolve ()">geocode_backend_reverse_resolve</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GeocodeBackend.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name"><a class="link" href="GeocodeBackend.html#GEOCODE-TYPE-BACKEND:CAPS" title="GEOCODE_TYPE_BACKEND">GEOCODE_TYPE_BACKEND</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="GeocodeBackend.html#GeocodeBackendInterface" title="struct GeocodeBackendInterface">GeocodeBackendInterface</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GeocodeBackend.html#GeocodeBackend-struct" title="GeocodeBackend">GeocodeBackend</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GeocodeBackend.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen"> GInterface
<span class="lineart">╰──</span> GeocodeBackend
</pre>
</div>
<div class="refsect1">
<a name="GeocodeBackend.prerequisites"></a><h2>Prerequisites</h2>
<p>
GeocodeBackend requires
GObject.</p>
</div>
<div class="refsect1">
<a name="GeocodeBackend.implementations"></a><h2>Known Implementations</h2>
<p>
GeocodeBackend is implemented by
<a class="link" href="geocode-glib-geocode-mock-backend.html#GeocodeMockBackend">GeocodeMockBackend</a> and <a class="link" href="GeocodeNominatim.html" title="GeocodeNominatim">GeocodeNominatim</a>.</p>
</div>
<div class="refsect1">
<a name="GeocodeBackend.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include <geocode-glib/geocode-glib.h>
</pre>
</div>
<div class="refsect1">
<a name="GeocodeBackend.description"></a><h2>Description</h2>
<p>The <a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a> interface defines the operations that a resolver
service must implement.</p>
<p>geocode-glib supports multiple backends which provide the underlying
geocoding database and functionality. By default, the <a class="link" href="GeocodeNominatim.html" title="GeocodeNominatim"><span class="type">GeocodeNominatim</span></a>
backend is used with
<a class="ulink" href="https://nominatim.gnome.org/" target="_top">GNOME’s Nominatim server</a>. If you are using
geocode-glib in some GNOME software, this is the correct backend to use.
Otherwise, you should use a new <a class="link" href="GeocodeNominatim.html" title="GeocodeNominatim"><span class="type">GeocodeNominatim</span></a> instance with your own
Nominatim server, or a custom <a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a> implementation to use geocoding
data from a non-Nominatim service. In all cases, please respect the terms of
use of the service you are using.</p>
<p>If you are writing a library which uses geocode-glib, consider exposing the
choice of <a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a> in your library API, so that applications can make
the best choice about which geocoding backend to use.</p>
<p>Custom backends can be implemented by subclassing <a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a> and
implementing the synchronous <code class="literal">forward_search</code> and <code class="literal">reverse_resolve</code> methods.
The asynchronous versions may be implemented as well; the default
implementations run the synchronous version in a thread.</p>
<p>In order to use a custom backend, either instantiate the backend directly
and do forward and reverse queries on it using the <a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a> interface;
or create <a class="link" href="GeocodeForward.html" title="GeocodeForward"><span class="type">GeocodeForward</span></a> and <a class="link" href="GeocodeReverse.html" title="GeocodeReverse"><span class="type">GeocodeReverse</span></a> objects as normal, and set
the backend they use with <a class="link" href="GeocodeForward.html#geocode-forward-set-backend" title="geocode_forward_set_backend ()"><code class="function">geocode_forward_set_backend()</code></a> and
<a class="link" href="GeocodeReverse.html#geocode-reverse-set-backend" title="geocode_reverse_set_backend ()"><code class="function">geocode_reverse_set_backend()</code></a>. They default to using the GNOME Nominatim
backend.</p>
<p><a class="link" href="geocode-glib-geocode-mock-backend.html#GeocodeMockBackend"><span class="type">GeocodeMockBackend</span></a> is intended to be used in unit tests for applications
which use geocode-glib — it allows them to set the geocode results they
expect their application to query, and check afterwards that the queries
were performed. Additionally, it works offline, which allows application
unit tests to be run on integration and build machines which are not online.
It is not expected that <a class="link" href="geocode-glib-geocode-mock-backend.html#GeocodeMockBackend"><span class="type">GeocodeMockBackend</span></a> will be used in production code.</p>
</div>
<div class="refsect1">
<a name="GeocodeBackend.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="geocode-backend-forward-search-async"></a><h3>geocode_backend_forward_search_async ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
geocode_backend_forward_search_async (<em class="parameter"><code><a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a> *backend</code></em>,
<em class="parameter"><code><span class="type">GHashTable</span> *params</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GAsyncReadyCallback</span> callback</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
<p>Asynchronously performs a forward geocoding query using the <em class="parameter"><code>backend</code></em>
. Use
<a class="link" href="GeocodeBackend.html#geocode-backend-forward-search" title="geocode_backend_forward_search ()"><code class="function">geocode_backend_forward_search()</code></a> to do the same thing synchronously.</p>
<p>The <em class="parameter"><code>params</code></em>
hash table is in the format used by Telepathy, and documented
in the <a class="ulink" href="http://telepathy.freedesktop.org/spec/Connection_Interface_Location.html#Mapping:Location" target="_top">Telepathy specification</a>.</p>
<p>See also: <a class="ulink" href="http://xmpp.org/extensions/xep-0080.html" target="_top">XEP-0080 specification</a>.</p>
<p>When the operation is finished, <em class="parameter"><code>callback</code></em>
will be called. You can then call
<a class="link" href="GeocodeBackend.html#geocode-backend-forward-search-finish" title="geocode_backend_forward_search_finish ()"><code class="function">geocode_backend_forward_search_finish()</code></a> to get the result of the operation.</p>
<div class="refsect3">
<a name="geocode-backend-forward-search-async.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>backend</p></td>
<td class="parameter_description"><p>a <a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>params</p></td>
<td class="parameter_description"><p> a <span class="type">GHashTable</span> with string keys, and <span class="type">GValue</span> values. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8 GValue]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>cancellable</p></td>
<td class="parameter_description"><p>optional <span class="type">GCancellable</span>, <code class="literal">NULL</code> to ignore.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>callback</p></td>
<td class="parameter_description"><p>a <span class="type">GAsyncReadyCallback</span> to call when the request is satisfied</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>the data to pass to the <em class="parameter"><code>callback</code></em>
function</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-full.html#api-index-3.23.1">3.23.1</a></p>
</div>
<hr>
<div class="refsect2">
<a name="geocode-backend-forward-search-finish"></a><h3>geocode_backend_forward_search_finish ()</h3>
<pre class="programlisting"><span class="returnvalue">GList</span> *
geocode_backend_forward_search_finish (<em class="parameter"><code><a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a> *backend</code></em>,
<em class="parameter"><code><span class="type">GAsyncResult</span> *result</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Finishes a forward geocoding operation. See
<a class="link" href="GeocodeBackend.html#geocode-backend-forward-search-async" title="geocode_backend_forward_search_async ()"><code class="function">geocode_backend_forward_search_async()</code></a>.</p>
<div class="refsect3">
<a name="geocode-backend-forward-search-finish.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>backend</p></td>
<td class="parameter_description"><p>a <a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>result</p></td>
<td class="parameter_description"><p>a <span class="type">GAsyncResult</span>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a <span class="type">GError</span>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="geocode-backend-forward-search-finish.returns"></a><h4>Returns</h4>
<p> A list of
places or <code class="literal">NULL</code> in case of errors. Free the returned instances with
<code class="function">g_object_unref()</code> and the list with <code class="function">g_list_free()</code> when done. </p>
<p><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GeocodePlace][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-full.html#api-index-3.23.1">3.23.1</a></p>
</div>
<hr>
<div class="refsect2">
<a name="geocode-backend-forward-search"></a><h3>geocode_backend_forward_search ()</h3>
<pre class="programlisting"><span class="returnvalue">GList</span> *
geocode_backend_forward_search (<em class="parameter"><code><a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a> *backend</code></em>,
<em class="parameter"><code><span class="type">GHashTable</span> *params</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Gets the result of a forward geocoding query using the <em class="parameter"><code>backend</code></em>
.</p>
<p>If no results are found, a <a class="link" href="geocode-glib-geocode-error.html#GEOCODE-ERROR-NO-MATCHES:CAPS"><code class="literal">GEOCODE_ERROR_NO_MATCHES</code></a> error is returned.</p>
<p>This is a synchronous function, which means it may block on network requests.
In most situations, the asynchronous version
(<a class="link" href="GeocodeBackend.html#geocode-backend-forward-search-async" title="geocode_backend_forward_search_async ()"><code class="function">geocode_backend_forward_search_async()</code></a>) is more appropriate. See its
documentation for more information on usage.</p>
<div class="refsect3">
<a name="geocode-backend-forward-search.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>backend</p></td>
<td class="parameter_description"><p>a <a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>params</p></td>
<td class="parameter_description"><p> a <span class="type">GHashTable</span> with string keys, and <span class="type">GValue</span> values. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8 GValue]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>cancellable</p></td>
<td class="parameter_description"><p>optional <span class="type">GCancellable</span>, <code class="literal">NULL</code> to ignore.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a <span class="type">GError</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="geocode-backend-forward-search.returns"></a><h4>Returns</h4>
<p> A list of
places or <code class="literal">NULL</code> in case of errors. Free the returned instances with
<code class="function">g_object_unref()</code> and the list with <code class="function">g_list_free()</code> when done. </p>
<p><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GeocodePlace][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-full.html#api-index-3.23.1">3.23.1</a></p>
</div>
<hr>
<div class="refsect2">
<a name="geocode-backend-reverse-resolve-async"></a><h3>geocode_backend_reverse_resolve_async ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
geocode_backend_reverse_resolve_async (<em class="parameter"><code><a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a> *backend</code></em>,
<em class="parameter"><code><span class="type">GHashTable</span> *params</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GAsyncReadyCallback</span> callback</code></em>,
<em class="parameter"><code><span class="type">gpointer</span> user_data</code></em>);</pre>
<p>Asynchronously gets the result of a reverse geocoding query using the
backend.</p>
<p>Typically, a single result will be returned representing the place at a
given latitude and longitude (the <code class="literal">lat</code> and <code class="literal">lon</code> keys to <em class="parameter"><code>params</code></em>
); but in
some cases the results will be ambiguous and *multiple* results will be
returned. They will be returned in order of relevance, with the most
relevant result first in the list.</p>
<p>The <em class="parameter"><code>params</code></em>
hash table is in the format used by Telepathy, and documented
in the <a class="ulink" href="http://telepathy.freedesktop.org/spec/Connection_Interface_Location.html#Mapping:Location" target="_top">Telepathy specification</a>.</p>
<p>See also: <a class="ulink" href="http://xmpp.org/extensions/xep-0080.html" target="_top">XEP-0080 specification</a>.</p>
<p>Use <a class="link" href="GeocodeBackend.html#geocode-backend-reverse-resolve" title="geocode_backend_reverse_resolve ()"><code class="function">geocode_backend_reverse_resolve()</code></a> to do the same thing synchronously.</p>
<p>When the operation is finished, <em class="parameter"><code>callback</code></em>
will be called. You can then call
<a class="link" href="GeocodeBackend.html#geocode-backend-reverse-resolve-finish" title="geocode_backend_reverse_resolve_finish ()"><code class="function">geocode_backend_reverse_resolve_finish()</code></a> to get the result of the operation.</p>
<div class="refsect3">
<a name="geocode-backend-reverse-resolve-async.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>backend</p></td>
<td class="parameter_description"><p>a <a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>params</p></td>
<td class="parameter_description"><p> a <span class="type">GHashTable</span> with string keys, and <span class="type">GValue</span> values. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8 GValue]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>cancellable</p></td>
<td class="parameter_description"><p>optional <span class="type">GCancellable</span> object, <code class="literal">NULL</code> to ignore.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>callback</p></td>
<td class="parameter_description"><p>a <span class="type">GAsyncReadyCallback</span> to call when the request is satisfied.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>the data to pass to callback function.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-full.html#api-index-3.23.1">3.23.1</a></p>
</div>
<hr>
<div class="refsect2">
<a name="geocode-backend-reverse-resolve-finish"></a><h3>geocode_backend_reverse_resolve_finish ()</h3>
<pre class="programlisting"><span class="returnvalue">GList</span> *
geocode_backend_reverse_resolve_finish
(<em class="parameter"><code><a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a> *backend</code></em>,
<em class="parameter"><code><span class="type">GAsyncResult</span> *result</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Finishes a reverse geocoding operation. See <a class="link" href="GeocodeBackend.html#geocode-backend-reverse-resolve-async" title="geocode_backend_reverse_resolve_async ()"><code class="function">geocode_backend_reverse_resolve_async()</code></a>.</p>
<div class="refsect3">
<a name="geocode-backend-reverse-resolve-finish.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>backend</p></td>
<td class="parameter_description"><p>a <a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>result</p></td>
<td class="parameter_description"><p>a <span class="type">GAsyncResult</span>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a <span class="type">GError</span>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="geocode-backend-reverse-resolve-finish.returns"></a><h4>Returns</h4>
<p> A list of
<a class="link" href="GeocodePlace.html" title="GeocodePlace"><span class="type">GeocodePlace</span></a> instances, or <code class="literal">NULL</code> in case of errors. The list is ordered
by relevance, with most relevant results first. Free the returned
instances with <code class="function">g_object_unref()</code> and the list with <code class="function">g_list_free()</code> when done. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GeocodePlace]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-full.html#api-index-3.23.1">3.23.1</a></p>
</div>
<hr>
<div class="refsect2">
<a name="geocode-backend-reverse-resolve"></a><h3>geocode_backend_reverse_resolve ()</h3>
<pre class="programlisting"><span class="returnvalue">GList</span> *
geocode_backend_reverse_resolve (<em class="parameter"><code><a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a> *backend</code></em>,
<em class="parameter"><code><span class="type">GHashTable</span> *params</code></em>,
<em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
<em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Gets the result of a reverse geocoding query using the <em class="parameter"><code>backend</code></em>
.</p>
<p>If no result could be found, a <a class="link" href="geocode-glib-geocode-error.html#GEOCODE-ERROR-NOT-SUPPORTED:CAPS"><code class="literal">GEOCODE_ERROR_NOT_SUPPORTED</code></a> error will be
returned. This typically happens if the coordinates to geocode are in the
middle of the ocean.</p>
<p>This is a synchronous function, which means it may block on network requests.
In most situations, the asynchronous version,
<a class="link" href="GeocodeBackend.html#geocode-backend-forward-search-async" title="geocode_backend_forward_search_async ()"><code class="function">geocode_backend_forward_search_async()</code></a>, is more appropriate. See its
documentation for more information on usage.</p>
<div class="refsect3">
<a name="geocode-backend-reverse-resolve.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>backend</p></td>
<td class="parameter_description"><p>a <a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>params</p></td>
<td class="parameter_description"><p> a <span class="type">GHashTable</span> with string keys, and <span class="type">GValue</span> values. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8 GValue]</span></td>
</tr>
<tr>
<td class="parameter_name"><p>cancellable</p></td>
<td class="parameter_description"><p>optional <span class="type">GCancellable</span> object, <code class="literal">NULL</code> to ignore.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>a <span class="type">GError</span>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="geocode-backend-reverse-resolve.returns"></a><h4>Returns</h4>
<p> A list of
<a class="link" href="GeocodePlace.html" title="GeocodePlace"><span class="type">GeocodePlace</span></a> instances, or <code class="literal">NULL</code> in case of errors. The list is ordered
by relevance, with most relevant results first. Free the returned
instances with <code class="function">g_object_unref()</code> and the list with <code class="function">g_list_free()</code> when done. </p>
<p><span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GeocodePlace]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-full.html#api-index-3.23.1">3.23.1</a></p>
</div>
</div>
<div class="refsect1">
<a name="GeocodeBackend.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GEOCODE-TYPE-BACKEND:CAPS"></a><h3>GEOCODE_TYPE_BACKEND</h3>
<pre class="programlisting">#define GEOCODE_TYPE_BACKEND (geocode_backend_get_type ())
</pre>
<p>See <a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a>.</p>
<p class="since">Since: <a class="link" href="api-index-full.html#api-index-3.23.1">3.23.1</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GeocodeBackendInterface"></a><h3>struct GeocodeBackendInterface</h3>
<pre class="programlisting">struct GeocodeBackendInterface {
/* Forward */
GList *(*forward_search) (GeocodeBackend *backend,
GHashTable *params,
GCancellable *cancellable,
GError **error);
void (*forward_search_async) (GeocodeBackend *backend,
GHashTable *params,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GList *(*forward_search_finish) (GeocodeBackend *backend,
GAsyncResult *result,
GError **error);
/* Reverse */
GList *(*reverse_resolve) (GeocodeBackend *backend,
GHashTable *params,
GCancellable *cancellable,
GError **error);
void (*reverse_resolve_async) (GeocodeBackend *backend,
GHashTable *params,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GList *(*reverse_resolve_finish) (GeocodeBackend *backend,
GAsyncResult *result,
GError **error);
};
</pre>
<p>Interface which defines the basic operations for geocoding.</p>
<div class="refsect3">
<a name="GeocodeBackendInterface.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GeocodeBackendInterface.forward-search"></a>forward_search</code></em> ()</p></td>
<td class="struct_member_description"><p>handles a synchronous forward geocoding request.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GeocodeBackendInterface.forward-search-async"></a>forward_search_async</code></em> ()</p></td>
<td class="struct_member_description"><p>starts an asynchronous forward geocoding request.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GeocodeBackendInterface.forward-search-finish"></a>forward_search_finish</code></em> ()</p></td>
<td class="struct_member_description"><p>finishes an asynchronous forward geocoding request.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GeocodeBackendInterface.reverse-resolve"></a>reverse_resolve</code></em> ()</p></td>
<td class="struct_member_description"><p>handles a synchronous reverse geocoding request.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GeocodeBackendInterface.reverse-resolve-async"></a>reverse_resolve_async</code></em> ()</p></td>
<td class="struct_member_description"><p>starts an asynchronous reverse geocoding request.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="GeocodeBackendInterface.reverse-resolve-finish"></a>reverse_resolve_finish</code></em> ()</p></td>
<td class="struct_member_description"><p>finishes an asynchronous reverse geocoding request.</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-full.html#api-index-3.23.1">3.23.1</a></p>
</div>
<hr>
<div class="refsect2">
<a name="GeocodeBackend-struct"></a><h3>GeocodeBackend</h3>
<pre class="programlisting">typedef struct _GeocodeBackend GeocodeBackend;</pre>
<p>All the fields in the <a class="link" href="GeocodeBackend.html" title="GeocodeBackend"><span class="type">GeocodeBackend</span></a> structure are private and should
never be accessed directly.</p>
<p class="since">Since: <a class="link" href="api-index-full.html#api-index-3.23.1">3.23.1</a></p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.25</div>
</body>
</html>
|