Top | ![]() |
![]() |
![]() |
![]() |
void | (*GeoclueAddressCallback) () |
gboolean | geoclue_address_get_address () |
void | geoclue_address_get_address_async () |
GeoclueAddress * | geoclue_address_new () |
GeoclueAddress contains Address-related methods and signals. It is part of the Geoclue public C client API which uses D-Bus to communicate with the actual provider.
After a GeoclueAddress is created with geoclue_address_new()
or
geoclue_master_client_create_address()
, the
geoclue_address_get_address()
and geoclue_address_get_address_async()
methods
and the address-changed signal can be used to obtain the current address.
Address GHashTable keys are defined in
geoclue-types.h. See alsoconvenience functions in
geoclue-address-details.h.void (*GeoclueAddressCallback) (GeoclueAddress *address
,int timestamp
,GHashTable *details
,GeoclueAccuracy *accuracy
,GError *error
,gpointer userdata
);
Callback function for geoclue_address_get_address_async()
.
address |
the GeoclueAddress object emitting the signal |
|
timestamp |
Time of address measurement (Unix timestamp) |
|
details |
Address details as GHashTable. |
|
accuracy |
Accuracy of measurement as GeoclueAccuracy |
|
error |
Error as Gerror (may be |
|
userdata |
User data pointer set in |
gboolean geoclue_address_get_address (GeoclueAddress *address
,int *timestamp
,GHashTable **details
,GeoclueAccuracy **accuracy
,GError **error
);
Obtains the current address. timestamp
will contain the time of
the actual address measurement. accuracy
is the estimated of the
accuracy of the current address information (see GeoclueAccuracy
for more details). details
is a hashtable with the address data,
see geoclue-types.h for the
hashtable keys.
If the caller is not interested in some values, the pointers can be
left NULL
.
address |
A GeoclueAddress object |
|
timestamp |
Pointer to returned time of address measurement (Unix timestamp) or |
|
details |
Pointer to returned GHashTable with address details or |
|
accuracy |
Pointer to returned GeoclueAccuracy or NULL |
|
error |
Pointer to returned Gerror or |
void geoclue_address_get_address_async (GeoclueAddress *address
,GeoclueAddressCallback callback
,gpointer userdata
);
Function returns (essentially) immediately and calls callback
when current address
is available or when D-Bus timeouts.
address |
A GeoclueAddress object |
|
callback |
A GeoclueAddressCallback function that should be called when return values are available |
|
userdata |
pointer for user specified data |
GeoclueAddress * geoclue_address_new (const char *service
,const char *path
);
Creates a GeoclueAddress with given D-Bus service name and path.
#define GEOCLUE_ADDRESS_INTERFACE_NAME "org.freedesktop.Geoclue.Address"
“address-changed”
signalvoid user_function (GeoclueAddress *address, int timestamp, gpointer details, gpointer accuracy, gpointer user_data)
The address-changed signal is emitted each time the address changes.
See geoclue-types.h for the possible
GEOCLUE_ADDRESS_KEY_* keys used in details
.
Note that not all providers support signals.
address |
the GeoclueAddress object emitting the signal |
|
timestamp |
Time of address measurement (Unix timestamp) |
|
details |
Address details as GHashTable. |
|
accuracy |
Accuracy of measurement as GeoclueAccuracy |
|
user_data |
user data set when the signal handler was connected. |
Flags: No Recursion