HudClientConnection

HudClientConnection — Provide a connection to the HUD service

Stability Level

Unstable, unless otherwise indicated

Functions

Properties

gchar * address Read / Write / Construct Only
gchar * path Read / Write / Construct Only

Signals

void connection-status Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── HudClientConnection

Includes

#include <libhud-client/connection.h>

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.

Functions

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

Parameters

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

 

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 (const gchar *dbus_address,
                           const 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()

Parameters

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.

Parameters

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.

Parameters

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

Parameters

connection

A HudClientConnection

 

Returns

If we're connected or not

Types and Values

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


struct HudClientConnectionClass

struct HudClientConnectionClass {
	GObjectClass parent_class;
};

Class information for HudClientConnection

Members

GObjectClass parent_class;

GObjectClass

 

struct HudClientConnection

struct HudClientConnection;

Object to make a generic connection to a HUD service. For the most part people should just create a HudClientQuery and that'll use the default HUD service. For most folks that should be enough.


HudClientConnectionPrivate

typedef struct _HudClientConnectionPrivate HudClientConnectionPrivate;

Private data for HudClientConnection.

Property Details

The “address” property

  “address”                  gchar *

The DBus address of the HUD service we should connect to.

Flags: Read / Write / Construct Only

Default value: "com.canonical.hud"


The “path” property

  “path”                     gchar *

The DBus path of the HUD service we should connect to.

Flags: Read / Write / Construct Only

Default value: "/com/canonical/hud"

Signal Details

The “connection-status” signal

void
user_function (HudClientConnection *arg0,
               gboolean             arg1,
               gpointer             user_data)

Called when the connection status changes in some way.

Parameters

user_data

user data set when the signal handler was connected.

 

Flags: Run Last