Connection Location interface

Connection Location interface — client-side wrappers for the Location interface

Functions

Object Hierarchy


Includes

#include <telepathy-glib/telepathy-glib-dbus.h>

Description

Some instant messaging protocols support "rich presence" functionality, such as geolocation (advertising the user's location to authorized contacts, and receiving contacts' locations).

This section documents the auto-generated C wrappers for the Location interface, used with TpConnection objects.

Functions

tp_cli_connection_interface_location1_connect_to_location_updated ()

TpProxySignalConnection *
tp_cli_connection_interface_location1_connect_to_location_updated
                               (TpConnection *proxy,
                                tp_cli_connection_interface_location1_signal_callback_location_updated callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object,
                                GError **error);

Connect a handler to the signal LocationUpdated.

Emitted when a contact's location changes or becomes known.

Parameters

proxy

A TpConnection or subclass

 

callback

Callback to be called when the signal is received

 

user_data

User-supplied data for the callback

 

destroy

Destructor for the user-supplied data, which will be called when this signal is disconnected, or before this function returns NULL

 

weak_object

A GObject which will be weakly referenced; if it is destroyed, this callback will automatically be disconnected

 

error

If not NULL, used to raise an error if NULL is returned

 

Returns

a TpProxySignalConnection containing all of the above, which can be used to disconnect the signal; or NULL if the proxy does not have the desired interface or has become invalid.


tp_cli_connection_interface_location1_signal_callback_location_updated ()

void
(*tp_cli_connection_interface_location1_signal_callback_location_updated)
                               (TpConnection *proxy,
                                guint arg_Contact,
                                GHashTable *arg_Location,
                                gpointer user_data,
                                GObject *weak_object);

Represents the signature of a callback for the signal LocationUpdated.

Parameters

proxy

The proxy on which tp_cli_connection_interface_location1_connect_to_location_updated() was called

 

arg_Contact

The contact (TpContactHandle)

 

arg_Location

The contact's location, or empty to indicate that nothing is known about the contact's location.

 

user_data

User-supplied data

 

weak_object

User-supplied weakly referenced object

 

tp_cli_connection_interface_location1_call_request_location ()

TpProxyPendingCall *
tp_cli_connection_interface_location1_call_request_location
                               (TpConnection *proxy,
                                gint timeout_ms,
                                guint in_Contact,
                                tp_cli_connection_interface_location1_callback_for_request_location callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a RequestLocation method call.

Return the current location of the given contact. If necessary, make a request to the server for up-to-date information, and wait for a reply. <tp:rationale> This method is appropriate for use in a &quot;Contact Information...&quot; dialog; it can be used to show progress information (while waiting for the method to return), and can distinguish between various error conditions. </tp:rationale>

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Contact

Used to pass an 'in' argument: The contact whose location should be returned. (TpContactHandle)

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_location1_callback_for_request_location ()

void
(*tp_cli_connection_interface_location1_callback_for_request_location)
                               (TpConnection *proxy,
                                GHashTable *out_Location,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a RequestLocation method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

out_Location

Used to return an 'out' argument if error is NULL: The contact's location. It MAY be empty, indicating that no location information was found.

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

tp_cli_connection_interface_location1_call_set_location ()

TpProxyPendingCall *
tp_cli_connection_interface_location1_call_set_location
                               (TpConnection *proxy,
                                gint timeout_ms,
                                GHashTable *in_Location,
                                tp_cli_connection_interface_location1_callback_for_set_location callback,
                                gpointer user_data,
                                GDestroyNotify destroy,
                                GObject *weak_object);

Start a SetLocation method call.

Set the local user's own location.

Parameters

proxy

the TpProxy

 

timeout_ms

the timeout in milliseconds, or -1 to use the default

 

in_Location

Used to pass an 'in' argument: The location to advertise. If the user wants to obscure their exact location by reducing the precision or accuracy, clients MUST do this themselves, rather than relying on the connection manager to do so. Clients that interact with more than one connection SHOULD advertise the same reduced-accuracy location to all of them, so that contacts cannot obtain an undesirably accurate location by assuming that random errors have been added and averaging the locations advertised on multiple connections.

 

callback

called when the method call succeeds or fails; may be NULL to make a "fire and forget" call with no reply tracking

 

user_data

user-supplied data passed to the callback; must be NULL if callback is NULL

 

destroy

called with the user_data as argument, after the call has succeeded, failed or been cancelled; must be NULL if callback is NULL

 

weak_object

If not NULL, a GObject which will be weakly referenced; if it is destroyed, this call will automatically be cancelled. Must be NULL if callback is NULL

 

Returns

a TpProxyPendingCall representing the call in progress. It is borrowed from the object, and will become invalid when the callback is called, the call is cancelled or the TpProxy becomes invalid.


tp_cli_connection_interface_location1_callback_for_set_location ()

void
(*tp_cli_connection_interface_location1_callback_for_set_location)
                               (TpConnection *proxy,
                                const GError *error,
                                gpointer user_data,
                                GObject *weak_object);

Signature of the callback called when a SetLocation method call succeeds or fails.

Parameters

proxy

the proxy on which the call was made

 

error

NULL on success, or an error on failure

 

user_data

user-supplied data

 

weak_object

user-supplied object

 

Types and Values

See Also

TpConnection