2 * ga-client.h - Header for GaClient
3 * Copyright (C) 2006-2007 Collabora Ltd.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef __GA_CLIENT_H__
21 #define __GA_CLIENT_H__
23 #include <glib-object.h>
24 #include <avahi-client/client.h>
29 GA_CLIENT_STATE_NOT_STARTED = -1,
30 GA_CLIENT_STATE_S_REGISTERING = AVAHI_CLIENT_S_REGISTERING,
31 GA_CLIENT_STATE_S_RUNNING = AVAHI_CLIENT_S_RUNNING,
32 GA_CLIENT_STATE_S_COLLISION = AVAHI_CLIENT_S_COLLISION,
33 GA_CLIENT_STATE_FAILURE = AVAHI_CLIENT_FAILURE,
34 GA_CLIENT_STATE_CONNECTING = AVAHI_CLIENT_CONNECTING
38 GA_CLIENT_FLAG_NO_FLAGS = 0,
39 GA_CLIENT_FLAG_IGNORE_USER_CONFIG = AVAHI_CLIENT_IGNORE_USER_CONFIG,
40 GA_CLIENT_FLAG_NO_FAIL = AVAHI_CLIENT_NO_FAIL
43 typedef struct _GaClient GaClient;
44 typedef struct _GaClientClass GaClientClass;
46 struct _GaClientClass {
47 GObjectClass parent_class;
52 /* Raw avahi_client handle, only reuse if you have reffed this instance */
53 AvahiClient *avahi_client;
56 GType ga_client_get_type(void);
59 #define GA_TYPE_CLIENT \
60 (ga_client_get_type())
61 #define GA_CLIENT(obj) \
62 (G_TYPE_CHECK_INSTANCE_CAST((obj), GA_TYPE_CLIENT, GaClient))
63 #define GA_CLIENT_CLASS(klass) \
64 (G_TYPE_CHECK_CLASS_CAST((klass), GA_TYPE_CLIENT, GaClientClass))
65 #define IS_GA_CLIENT(obj) \
66 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GA_TYPE_CLIENT))
67 #define IS_GA_CLIENT_CLASS(klass) \
68 (G_TYPE_CHECK_CLASS_TYPE((klass), GA_TYPE_CLIENT))
69 #define GA_CLIENT_GET_CLASS(obj) \
70 (G_TYPE_INSTANCE_GET_CLASS ((obj), GA_TYPE_CLIENT, GaClientClass))
72 GaClient *ga_client_new(GaClientFlags flags);
74 gboolean ga_client_start(GaClient * client, GError ** error);
78 #endif /* #ifndef __GA_CLIENT_H__ */