Commit d81d2f26 authored by Jussi Kukkonen's avatar Jussi Kukkonen

Added civic_location_supports-method

returns booleans: TRUE for for all the data items that the
backend may return on a civic_location-method call, FALSE for all
the data items that are not supported.
parent 38be7f0f
......@@ -290,6 +290,32 @@ gboolean geoclue_position_civic_location (GeocluePosition* obj,
return FALSE;
}
gboolean geoclue_position_civic_location_supports (GeocluePosition* obj,
gboolean* OUT_country,
gboolean* OUT_region,
gboolean* OUT_locality,
gboolean* OUT_area,
gboolean* OUT_postalcode,
gboolean* OUT_street,
gboolean* OUT_building,
gboolean* OUT_floor,
gboolean* OUT_room,
gboolean* OUT_text,
GError** error)
{
*OUT_country = FALSE;
*OUT_region = FALSE;
*OUT_locality = FALSE;
*OUT_area = FALSE;
*OUT_postalcode = FALSE;
*OUT_street = FALSE;
*OUT_building = FALSE;
*OUT_floor = FALSE;
*OUT_room = FALSE;
*OUT_text = FALSE;
return TRUE;
}
gboolean geoclue_position_service_available(GeocluePosition *obj, gboolean* OUT_available, char** OUT_reason, GError** error)
{
......
......@@ -90,6 +90,19 @@ gboolean geoclue_position_civic_location (GeocluePosition* obj,
char** OUT_text,
GError** error);
gboolean geoclue_position_civic_location_supports (GeocluePosition* obj,
gboolean* OUT_country,
gboolean* OUT_region,
gboolean* OUT_locality,
gboolean* OUT_area,
gboolean* OUT_postalcode,
gboolean* OUT_street,
gboolean* OUT_building,
gboolean* OUT_floor,
gboolean* OUT_room,
gboolean* OUT_text,
GError** error);
gboolean geoclue_position_service_available(GeocluePosition *obj, gboolean* OUT_available, char** OUT_reason, GError** error);
gboolean geoclue_position_shutdown(GeocluePosition *obj, GError** error);
......
......@@ -534,6 +534,31 @@ gboolean geoclue_position_civic_location (GeocluePosition* obj,
return TRUE;
}
gboolean geoclue_position_civic_location_supports (GeocluePosition* obj,
gboolean* OUT_country,
gboolean* OUT_region,
gboolean* OUT_locality,
gboolean* OUT_area,
gboolean* OUT_postalcode,
gboolean* OUT_street,
gboolean* OUT_building,
gboolean* OUT_floor,
gboolean* OUT_room,
gboolean* OUT_text,
GError** error)
{
*OUT_country = TRUE;
*OUT_region = FALSE;
*OUT_locality = TRUE;
*OUT_area = FALSE;
*OUT_postalcode = FALSE;
*OUT_street = FALSE;
*OUT_building = FALSE;
*OUT_floor = FALSE;
*OUT_room = FALSE;
*OUT_text = FALSE;
return TRUE;
}
/* TODO: Is this method sane? We have "GError**" in the call signatures:
This means calling current_position and checking return value
......
......@@ -103,6 +103,19 @@ gboolean geoclue_position_civic_location (GeocluePosition* obj,
char** OUT_text,
GError** error);
gboolean geoclue_position_civic_location_supports (GeocluePosition* obj,
gboolean* OUT_country,
gboolean* OUT_region,
gboolean* OUT_locality,
gboolean* OUT_area,
gboolean* OUT_postalcode,
gboolean* OUT_street,
gboolean* OUT_building,
gboolean* OUT_floor,
gboolean* OUT_room,
gboolean* OUT_text,
GError** error);
gboolean geoclue_position_service_available(GeocluePosition *obj, gboolean* OUT_available, char** OUT_reason, GError** error);
gboolean geoclue_position_shutdown(GeocluePosition *obj, GError** error);
......
......@@ -216,6 +216,33 @@ gboolean geoclue_position_civic_location (GeocluePosition* obj,
return FALSE;
}
gboolean geoclue_position_civic_location_supports (GeocluePosition* obj,
gboolean* OUT_country,
gboolean* OUT_region,
gboolean* OUT_locality,
gboolean* OUT_area,
gboolean* OUT_postalcode,
gboolean* OUT_street,
gboolean* OUT_building,
gboolean* OUT_floor,
gboolean* OUT_room,
gboolean* OUT_text,
GError** error)
{
/* TODO: update this data to reflect reality */
*OUT_country = TRUE;
*OUT_region = TRUE;
*OUT_locality = TRUE;
*OUT_area = TRUE;
*OUT_postalcode = TRUE;
*OUT_street = TRUE;
*OUT_building = TRUE;
*OUT_floor = TRUE;
*OUT_room = TRUE;
*OUT_text = TRUE;
return TRUE;
}
gboolean geoclue_position_service_available(GeocluePosition *obj, gboolean* OUT_available, char** OUT_reason, GError** error)
{
......
......@@ -86,6 +86,19 @@ gboolean geoclue_position_civic_location (GeocluePosition* obj,
char** OUT_text,
GError** error);
gboolean geoclue_position_civic_location_supports (GeocluePosition* obj,
gboolean* OUT_country,
gboolean* OUT_region,
gboolean* OUT_locality,
gboolean* OUT_area,
gboolean* OUT_postalcode,
gboolean* OUT_street,
gboolean* OUT_building,
gboolean* OUT_floor,
gboolean* OUT_room,
gboolean* OUT_text,
GError** error);
gboolean geoclue_position_service_available(GeocluePosition *obj, gboolean* OUT_available, char** OUT_reason, GError** error);
gboolean geoclue_position_shutdown(GeocluePosition *obj, GError** error);
......
......@@ -591,6 +591,35 @@ gboolean geoclue_position_civic_location (GeocluePosition* obj,
}
gboolean geoclue_position_civic_location_supports (GeocluePosition* obj,
gboolean* OUT_country,
gboolean* OUT_region,
gboolean* OUT_locality,
gboolean* OUT_area,
gboolean* OUT_postalcode,
gboolean* OUT_street,
gboolean* OUT_building,
gboolean* OUT_floor,
gboolean* OUT_room,
gboolean* OUT_text,
GError** error)
{
/* TODO: update this data to reflect reality */
*OUT_country = TRUE;
*OUT_region = FALSE;
*OUT_locality = TRUE;
*OUT_area = FALSE;
*OUT_postalcode = TRUE;
*OUT_street = TRUE;
*OUT_building = FALSE;
*OUT_floor = FALSE;
*OUT_room = FALSE;
*OUT_text = TRUE;
return TRUE;
}
/* TODO: Is this method sane? We have "GError**" in the call signatures:
This means calling current_position and checking return value
(and reading error->message on FALSE) gives the exact same
......
......@@ -103,6 +103,19 @@ gboolean geoclue_position_civic_location (GeocluePosition* obj,
char** OUT_text,
GError** error);
gboolean geoclue_position_civic_location_supports (GeocluePosition* obj,
gboolean* OUT_country,
gboolean* OUT_region,
gboolean* OUT_locality,
gboolean* OUT_area,
gboolean* OUT_postalcode,
gboolean* OUT_street,
gboolean* OUT_building,
gboolean* OUT_floor,
gboolean* OUT_room,
gboolean* OUT_text,
GError** error);
gboolean geoclue_position_service_available(GeocluePosition *obj, gboolean* OUT_available, char** OUT_reason, GError** error);
gboolean geoclue_position_shutdown(GeocluePosition *obj, GError** error);
......
......@@ -74,6 +74,7 @@ int main (int argc, char** argv)
gchar* street = NULL;
gchar* text = NULL;
g_debug ("Querying civic location");
if (geoclue_position_civic_location (&country, NULL, &locality, NULL, &postalcode, &street, NULL, NULL,NULL, &text) != GEOCLUE_POSITION_SUCCESS) {
g_debug ("civic location query failed");
......@@ -86,7 +87,6 @@ int main (int argc, char** argv)
if (text) printf ("Text: %s\n", text);
}
if (geoclue_position_close () != GEOCLUE_POSITION_SUCCESS){
g_debug ("position_close failed");
} else {
......
......@@ -381,3 +381,38 @@ GEOCLUE_POSITION_RETURNCODE geoclue_position_civic_location (char** OUT_country,
return GEOCLUE_POSITION_SUCCESS;
}
GEOCLUE_POSITION_RETURNCODE geoclue_position_civic_location_supports (gboolean* OUT_country,
gboolean* OUT_region,
gboolean* OUT_locality,
gboolean* OUT_area,
gboolean* OUT_postalcode,
gboolean* OUT_street,
gboolean* OUT_building,
gboolean* OUT_floor,
gboolean* OUT_room,
gboolean* OUT_text)
{
g_return_val_if_fail (geoclue_position_connection, GEOCLUE_POSITION_NOT_INITIALIZED);
g_return_val_if_fail (geoclue_position_proxy, GEOCLUE_POSITION_NOT_INITIALIZED);
GError* error = NULL;
org_foinse_project_geoclue_position_civic_location_supports (geoclue_position_proxy,
OUT_country,
OUT_region,
OUT_locality,
OUT_area,
OUT_postalcode,
OUT_street,
OUT_building,
OUT_floor,
OUT_room,
OUT_text,
&error);
if( error != NULL )
{
g_printerr ("Error getting geoclue_position civic_location_supports : %s\n", error->message);
g_error_free (error);
return GEOCLUE_POSITION_DBUS_ERROR;
}
return GEOCLUE_POSITION_SUCCESS;
}
......@@ -145,6 +145,17 @@ typedef enum _geoclue_position_fix
char** OUT_room,
char** OUT_text);
GEOCLUE_POSITION_RETURNCODE geoclue_position_civic_location_supports (gboolean* OUT_country,
gboolean* OUT_region,
gboolean* OUT_locality,
gboolean* OUT_area,
gboolean* OUT_postalcode,
gboolean* OUT_street,
gboolean* OUT_building,
gboolean* OUT_floor,
gboolean* OUT_room,
gboolean* OUT_text);
G_END_DECLS
......
......@@ -93,6 +93,18 @@
<arg type="s" name="text" direction="out" />
</method>
<method name="civic_location_supports">
<arg type="b" name="country" direction="out" />
<arg type="b" name="region" direction="out" />
<arg type="b" name="locality" direction="out" />
<arg type="b" name="area" direction="out" />
<arg type="b" name="postalcode" direction="out" />
<arg type="b" name="street" direction="out" />
<arg type="b" name="building" direction="out" />
<arg type="b" name="floor" direction="out" />
<arg type="b" name="room" direction="out" />
<arg type="b" name="text" direction="out" />
</method>
<method name="service_available">
<arg type="b" name="available" direction="out" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment