2
* Copyright © 2012 Canonical Ltd.
4
* This program is free software: you can redistribute it and/or modify it
5
* under the terms of the GNU General Public License version 3, as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but
9
* WITHOUT ANY WARRANTY; without even the implied warranties of
10
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11
* PURPOSE. See the GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License along
14
* with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Author: Ted Gould <ted@canonical.com>
19
#if !defined (_HUD_CLIENT_H_INSIDE) && !defined (HUD_CLIENT_COMPILATION)
20
#error "Only <hud-client.h> can be included directly."
23
#ifndef __HUD_CLIENT_CONNECTION_H__
24
#define __HUD_CLIENT_CONNECTION_H__
26
#pragma GCC visibility push(default)
28
#include <glib-object.h>
32
#define HUD_CLIENT_TYPE_CONNECTION (hud_client_connection_get_type ())
33
#define HUD_CLIENT_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HUD_CLIENT_TYPE_CONNECTION, HudClientConnection))
34
#define HUD_CLIENT_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HUD_CLIENT_TYPE_CONNECTION, HudClientConnectionClass))
35
#define HUD_CLIENT_IS_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HUD_CLIENT_TYPE_CONNECTION))
36
#define HUD_CLIENT_IS_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HUD_CLIENT_TYPE_CONNECTION))
37
#define HUD_CLIENT_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), HUD_CLIENT_TYPE_CONNECTION, HudClientConnectionClass))
40
* HUD_CLIENT_CONNECTION_SIGNAL_CONNECTION_STATUS:
42
* Signal to notify on a change in the connection status
44
#define HUD_CLIENT_CONNECTION_SIGNAL_CONNECTION_STATUS "connection-status"
46
typedef struct _HudClientConnection HudClientConnection;
47
typedef struct _HudClientConnectionClass HudClientConnectionClass;
48
typedef struct _HudClientConnectionPrivate HudClientConnectionPrivate ;
51
* HudClientConnectionNewQueryCallback:
52
* @connection: #HudClientConnection for the request
53
* @query_path: Path to the query object on DBus
54
* @results_name: DBus name for the results
55
* @appstack_name: DBus name for the appstack
56
* @user_data: Passed in user data
58
* Callback for the async call to create a new query
60
typedef void (*HudClientConnectionNewQueryCallback) (HudClientConnection * connection,
61
const gchar * query_path,
62
const gchar * results_name,
63
const gchar * appstack_name,
67
* HudClientConnectionClass:
68
* @parent_class: #GObjectClass
70
* Class information for #HudClientConnection
72
struct _HudClientConnectionClass {
73
GObjectClass parent_class;
77
* HudClientConnection:
79
* Object to make a generic connection to a HUD service. For the most
80
* part people should just create a #HudClientQuery and that'll use the
81
* default HUD service. For most folks that should be enough.
83
struct _HudClientConnection {
85
HudClientConnectionPrivate * priv;
88
GType hud_client_connection_get_type (void);
89
HudClientConnection * hud_client_connection_get_ref (void);
90
HudClientConnection * hud_client_connection_new (gchar * dbus_address,
92
void hud_client_connection_new_query (HudClientConnection * connection,
94
HudClientConnectionNewQueryCallback cb,
96
const gchar * hud_client_connection_get_address (HudClientConnection * connection);
97
gboolean hud_client_connection_connected (HudClientConnection * connection);
101
@short_description: Provide a connection to the HUD service
103
@include: libhud-client/connection.h
105
The connection is an object to maintain a connection to the default
106
objects on the HUD service. It provides access to the functionality
107
there and can be used to create queries.
109
Most users should not bother with a connection, it will be created
110
by the #HudClientQuery if one is not provided. Most usage is for
111
testing and using custom HUD services.
116
#pragma GCC visibility pop