Add gobject introspection
[profile/ivi/GSSDP.git] / libgssdp / gssdp-socket-source.h
1 /* 
2  * Copyright (C) 2006, 2007, 2008 OpenedHand Ltd.
3  * Copyright (C) 2010 Jens Georg <mail@jensge.org>
4  *
5  * Author: Jorn Baayen <jorn@openedhand.com>
6  *         Jens Georg <mail@jensge.org>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23
24 #ifndef __GSSDP_SOCKET_SOURCE_H__
25 #define __GSSDP_SOCKET_SOURCE_H__
26
27 #include <glib-object.h>
28
29 #include <gio/gio.h>
30
31 G_BEGIN_DECLS
32
33 #define GSSDP_TYPE_SOCKET_SOURCE \
34                 (gssdp_socket_source_get_type ())
35 #define GSSDP_SOCKET_SOURCE(obj) \
36                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
37                  GSSDP_TYPE_SOCKET_SOURCE, \
38                  GSSDPSocketSource))
39 #define GSSDP_SOCKET_SOURCE_CLASS(klass) \
40                 (G_TYPE_CHECK_CLASS_CAST ((klass), \
41                  GSSDP_TYPE_SOCKET_SOURCE, \
42                  GSSDPSocketSourceClass))
43 #define GSSDP_IS_SOCKET_SOURCE(obj) \
44                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
45                  GSSDP_TYPE_SOCKET_SOURCE))
46 #define GSSDP_IS_SOCKET_SOURCE_CLASS(klass) \
47                 (G_TYPE_CHECK_CLASS_TYPE ((klass), \
48                  GSSDP_TYPE_SOCKET_SOURCE))
49 #define GSSDP_SOCKET_SOURCE_GET_CLASS(obj) \
50                 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
51                  GSSDP_TYPE_SOCKET_SOURCE, \
52                  GSSDPSocketSourceClass))
53
54 typedef struct _GSSDPSocketSourcePrivate GSSDPSocketSourcePrivate;
55
56 typedef enum {
57         GSSDP_SOCKET_SOURCE_TYPE_REQUEST,
58         GSSDP_SOCKET_SOURCE_TYPE_MULTICAST,
59         GSSDP_SOCKET_SOURCE_TYPE_SEARCH
60 } GSSDPSocketSourceType;
61
62
63
64 typedef struct _GSSDPSocketSource {
65         GObject                   parent;
66
67         GSSDPSocketSourcePrivate *priv;
68 } GSSDPSocketSource;
69
70 typedef struct _GSSDPSocketSourceClass {
71         GObjectClass parent_class;
72 } GSSDPSocketSourceClass;
73
74 G_GNUC_INTERNAL GSSDPSocketSource *
75 gssdp_socket_source_new        (GSSDPSocketSourceType  type,
76                                 const char            *host_ip,
77                                 guint                  ttl,
78                                 GError               **error);
79 G_GNUC_INTERNAL GSocket*
80 gssdp_socket_source_get_socket (GSSDPSocketSource     *socket_source);
81
82 G_GNUC_INTERNAL void
83 gssdp_socket_source_set_callback (GSSDPSocketSource   *socket_source,
84                                   GSourceFunc          callback,
85                                   gpointer             user_data);
86
87 G_GNUC_INTERNAL void
88 gssdp_socket_source_attach       (GSSDPSocketSource   *socket_source);
89
90 G_END_DECLS
91
92 #endif /* __GSSDP_SOCKET_SOURCE_H__ */