![]() |
![]() |
![]() |
Geoclue Reference Manual | ![]() |
---|---|---|---|---|
GeoclueProvider; gboolean geoclue_provider_get_status (GeoclueProvider *provider, GeoclueStatus *status, GError **error); gboolean geoclue_provider_get_provider_info (GeoclueProvider *provider, char **name, char **description, GError **error); gboolean geoclue_provider_set_options (GeoclueProvider *provider, GHashTable *options, GError **error);
GObject +----GeoclueProvider +----GeocluePosition +----GeoclueVelocity +----GeoclueAddress +----GeoclueGeocode +----GeoclueReverseGeocode
"interface" gchar* : Write / Construct Only "path" gchar* : Write / Construct Only "service" gchar* : Write / Construct Only
GeoclueProvider contains the methods and signals common to all Geoclue providers. It is part of the public C client API which uses D-Bus to communicate with the actual provider.
A GeoclueProvider is not explicitly created. Instead any provider object can be cast to GeoclueProvider. Using a GeocluePosition as example here:
GeocluePosition *pos; char *name; GError *error; pos = geoclue_position_new ("org.freedesktop.Geoclue.Providers.Example", "/org/freedesktop/Geoclue/Providers/Example"); if (pos == NULL) { / * error * / } if (geoclue_provider_get_provider_info (GEOCLUE_PROVIDER (pos), &name, NULL, &error)) { g_print ("name = %s", name); }
GeoclueProvider can be used to obtain generic information about the provider and to set provider options.
gboolean geoclue_provider_get_status (GeoclueProvider *provider, GeoclueStatus *status, GError **error);
Obtains the current status of the provider.
|
A GeoclueProvider object |
|
Pointer for returned status as GeoclueStatus |
|
Pointer for returned GError or NULL
|
Returns : |
TRUE on success
|
gboolean geoclue_provider_get_provider_info (GeoclueProvider *provider, char **name, char **description, GError **error);
Obtains name and a short description of the provider.
|
A GeoclueProvider object |
|
Pointer for returned provider name or NULL
|
|
Pointer for returned provider description or NULL
|
|
Pointer for returned GError or NULL
|
Returns : |
TRUE on success
|
gboolean geoclue_provider_set_options (GeoclueProvider *provider, GHashTable *options, GError **error);
Sets the options on the provider.
|
A GeoclueProvider object |
|
A GHashTable containing the options |
|
Pointer for returned GError or NULL
|
Returns : |
TRUE if setting options succeeded
|
"interface"
property"interface" gchar* : Write / Construct Only
The D-Bus interface implemented by the object.
Default value: ""
"path"
property"path" gchar* : Write / Construct Only
The D-Bus path to this provider.
Default value: ""
"status-changed"
signalvoid user_function (GeoclueProvider *provider, gint status, gpointer user_data) : Run First / No Recursion
The status-changed signal is emitted each time the provider status changes
|
the provider object emitting the signal |
|
New provider status as GeoclueStatus |
|
user data set when the signal handler was connected. |