Geoclue Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
Synopsis
#define GEOCLUE_ADDRESS_INTERFACE_NAME GeoclueAddress; void (*GeoclueAddressCallback) (GeoclueAddress *address
,int timestamp
,GHashTable *details
,GeoclueAccuracy *accuracy
,GError *error
,gpointer userdata
); GeoclueAddressClass; gboolean geoclue_address_get_address (GeoclueAddress *address
,int *timestamp
,GHashTable **details
,GeoclueAccuracy **accuracy
,GError **error
); void geoclue_address_get_address_async (GeoclueAddress *address
,GeoclueAddressCallback callback
,gpointer userdata
); GeoclueAddress * geoclue_address_new (const char *service
,const char *path
);
Description
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 also convenience functions in geoclue-address-details.h.
Details
GEOCLUE_ADDRESS_INTERFACE_NAME
#define GEOCLUE_ADDRESS_INTERFACE_NAME "org.freedesktop.Geoclue.Address"
GeoclueAddressCallback ()
void (*GeoclueAddressCallback) (GeoclueAddress *address
,int timestamp
,GHashTable *details
,GeoclueAccuracy *accuracy
,GError *error
,gpointer userdata
);
Callback function for geoclue_address_get_address_async()
.
|
the GeoclueAddress object emitting the signal |
|
Time of address measurement (Unix timestamp) |
|
Address details as GHashTable. |
|
Accuracy of measurement as GeoclueAccuracy |
|
Error as Gerror (may be NULL ) |
|
User data pointer set in geoclue_position_get_position_async()
|
GeoclueAddressClass
typedef struct { GeoclueProviderClass provider_class; void (* address_changed) (GeoclueAddress *address, int timestamp, GHashTable *details, GeoclueAccuracy *accuracy); } GeoclueAddressClass;
geoclue_address_get_address ()
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
.
|
A GeoclueAddress object |
|
Pointer to returned time of address measurement (Unix timestamp) or NULL
|
|
Pointer to returned GHashTable with address details or NULL
|
|
Pointer to returned GeoclueAccuracy or NULL |
|
Pointer to returned Gerror or NULL
|
Returns : |
TRUE if there is no error
|
geoclue_address_get_address_async ()
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.
|
A GeoclueAddress object |
|
A GeoclueAddressCallback function that should be called when return values are available |
|
pointer for user specified data |
geoclue_address_new ()
GeoclueAddress * geoclue_address_new (const char *service
,const char *path
);
Creates a GeoclueAddress with given D-Bus service name and path.
|
D-Bus service name |
|
D-Bus path name |
Returns : |
Pointer to a new GeoclueAddress |
Signal Details
The "address-changed"
signal
void user_function (GeoclueAddress *address,
gint timestamp,
gpointer details,
gpointer accuracy,
gpointer user_data) : No Recursion
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.
|
the GeoclueAddress object emitting the signal |
|
Time of address measurement (Unix timestamp) |
|
Address details as GHashTable. |
|
Accuracy of measurement as GeoclueAccuracy |
|
user data set when the signal handler was connected. |