HudClientConnection

HudClientConnection — Provide a connection to the HUD service

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <libhud-client/connection.h>

#define             HUD_CLIENT_CONNECTION_SIGNAL_CONNECTION_STATUS
void                (*HudClientConnectionNewQueryCallback)
                                                        (HudClientConnection *connection,
                                                         const gchar *query_path,
                                                         const gchar *results_name,
                                                         const gchar *appstack_name,
                                                         gpointer user_data);
struct              HudClientConnectionClass;
HudClientConnection * hud_client_connection_get_ref     (void);
HudClientConnection * hud_client_connection_new         (gchar *dbus_address,
                                                         gchar *dbus_path);
void                hud_client_connection_new_query     (HudClientConnection *connection,
                                                         const gchar *query,
                                                         HudClientConnectionNewQueryCallback cb,
                                                         gpointer user_data);
const gchar *       hud_client_connection_get_address   (HudClientConnection *connection);
gboolean            hud_client_connection_connected     (HudClientConnection *connection);

Description

The connection is an object to maintain a connection to the default objects on the HUD service. It provides access to the functionality there and can be used to create queries.

Most users should not bother with a connection, it will be created by the HudClientQuery if one is not provided. Most usage is for testing and using custom HUD services.

Details

HUD_CLIENT_CONNECTION_SIGNAL_CONNECTION_STATUS

#define HUD_CLIENT_CONNECTION_SIGNAL_CONNECTION_STATUS   "connection-status"

Signal to notify on a change in the connection status


HudClientConnectionNewQueryCallback ()

void                (*HudClientConnectionNewQueryCallback)
                                                        (HudClientConnection *connection,
                                                         const gchar *query_path,
                                                         const gchar *results_name,
                                                         const gchar *appstack_name,
                                                         gpointer user_data);

Callback for the async call to create a new query

connection :

HudClientConnection for the request

query_path :

Path to the query object on DBus

results_name :

DBus name for the results

appstack_name :

DBus name for the appstack

user_data :

Passed in user data

struct HudClientConnectionClass

struct HudClientConnectionClass {
	GObjectClass parent_class;
};

Class information for HudClientConnection

GObjectClass parent_class;

GObjectClass

hud_client_connection_get_ref ()

HudClientConnection * hud_client_connection_get_ref     (void);

Gets a reference to the default object that connects to the default HUD service.

Returns :

Refence to a HudClientConnection. [transfer full]

hud_client_connection_new ()

HudClientConnection * hud_client_connection_new         (gchar *dbus_address,
                                                         gchar *dbus_path);

Builds a HUD Connection object that can be used to connect to a custom HUD service. For the most part, this should only be used in testing, though there might be other uses. It is likely if you're using this function you'd also be interested in hud_client_query_new_for_connection()

dbus_address :

Address on DBus for the HUD service

dbus_path :

Path to the object to create stuff

Returns :

A new HudClientConnection. [transfer full]

hud_client_connection_new_query ()

void                hud_client_connection_new_query     (HudClientConnection *connection,
                                                         const gchar *query,
                                                         HudClientConnectionNewQueryCallback cb,
                                                         gpointer user_data);

Function to create a new query in the HUD service and pass back the information needed to create a HudClientQuery object.

connection :

A HudClientConnection

query :

The initial query string

cb :

Callback when we've got the query

user_data :

Data to pass to the callback

hud_client_connection_get_address ()

const gchar *       hud_client_connection_get_address   (HudClientConnection *connection);

Accessor to get the address of the HUD service.

connection :

A HudClientConnection

Returns :

A DBus address

hud_client_connection_connected ()

gboolean            hud_client_connection_connected     (HudClientConnection *connection);

Accessor to get the connected status of the connection

connection :

A HudClientConnection

Returns :

If we're connected or not