|
avahi 0.6.30
|
00001 /* 00002 * ga-client.h - Header for GaClient 00003 * Copyright (C) 2006-2007 Collabora Ltd. 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with this library; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 */ 00019 00020 #ifndef __GA_CLIENT_H__ 00021 #define __GA_CLIENT_H__ 00022 00023 #include <glib-object.h> 00024 #include <avahi-client/client.h> 00025 00026 G_BEGIN_DECLS 00027 00028 typedef enum { 00029 GA_CLIENT_STATE_NOT_STARTED = -1, 00030 GA_CLIENT_STATE_S_REGISTERING = AVAHI_CLIENT_S_REGISTERING, 00031 GA_CLIENT_STATE_S_RUNNING = AVAHI_CLIENT_S_RUNNING, 00032 GA_CLIENT_STATE_S_COLLISION = AVAHI_CLIENT_S_COLLISION, 00033 GA_CLIENT_STATE_FAILURE = AVAHI_CLIENT_FAILURE, 00034 GA_CLIENT_STATE_CONNECTING = AVAHI_CLIENT_CONNECTING 00035 } GaClientState; 00036 00037 typedef enum { 00038 GA_CLIENT_FLAG_NO_FLAGS = 0, 00039 GA_CLIENT_FLAG_IGNORE_USER_CONFIG = AVAHI_CLIENT_IGNORE_USER_CONFIG, 00040 GA_CLIENT_FLAG_NO_FAIL = AVAHI_CLIENT_NO_FAIL 00041 } GaClientFlags; 00042 00043 typedef struct _GaClient GaClient; 00044 typedef struct _GaClientClass GaClientClass; 00045 00046 struct _GaClientClass { 00047 GObjectClass parent_class; 00048 }; 00049 00050 struct _GaClient { 00051 GObject parent; 00052 /* Raw avahi_client handle, only reuse if you have reffed this instance */ 00053 AvahiClient *avahi_client; 00054 }; 00055 00056 GType ga_client_get_type(void); 00057 00058 /* TYPE MACROS */ 00059 #define GA_TYPE_CLIENT \ 00060 (ga_client_get_type()) 00061 #define GA_CLIENT(obj) \ 00062 (G_TYPE_CHECK_INSTANCE_CAST((obj), GA_TYPE_CLIENT, GaClient)) 00063 #define GA_CLIENT_CLASS(klass) \ 00064 (G_TYPE_CHECK_CLASS_CAST((klass), GA_TYPE_CLIENT, GaClientClass)) 00065 #define IS_GA_CLIENT(obj) \ 00066 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GA_TYPE_CLIENT)) 00067 #define IS_GA_CLIENT_CLASS(klass) \ 00068 (G_TYPE_CHECK_CLASS_TYPE((klass), GA_TYPE_CLIENT)) 00069 #define GA_CLIENT_GET_CLASS(obj) \ 00070 (G_TYPE_INSTANCE_GET_CLASS ((obj), GA_TYPE_CLIENT, GaClientClass)) 00071 00072 GaClient *ga_client_new(GaClientFlags flags); 00073 00074 gboolean ga_client_start(GaClient * client, GError ** error); 00075 00076 G_END_DECLS 00077 00078 #endif /* #ifndef __GA_CLIENT_H__ */