1 /* GIO - GLib Input, Output and Streaming Library
3 * Copyright © 2009 Codethink Limited
4 * Copyright © 2009 Red Hat, Inc
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation; either version 2 of the licence or (at
9 * your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General
17 * Public License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19 * Boston, MA 02111-1307, USA.
21 * Authors: Ryan Lortie <desrt@desrt.ca>
22 * Alexander Larsson <alexl@redhat.com>
25 #if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
26 #error "Only <gio/gio.h> can be included directly."
29 #ifndef __G_SOCKET_SERVICE_H__
30 #define __G_SOCKET_SERVICE_H__
32 #include <gio/gsocketlistener.h>
36 #define G_TYPE_SOCKET_SERVICE (g_socket_service_get_type ())
37 #define G_SOCKET_SERVICE(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
38 G_TYPE_SOCKET_SERVICE, GSocketService))
39 #define G_SOCKET_SERVICE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), \
40 G_TYPE_SOCKET_SERVICE, GSocketServiceClass))
41 #define G_IS_SOCKET_SERVICE(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
42 G_TYPE_SOCKET_SERVICE))
43 #define G_IS_SOCKET_SERVICE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), \
44 G_TYPE_SOCKET_SERVICE))
45 #define G_SOCKET_SERVICE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), \
46 G_TYPE_SOCKET_SERVICE, GSocketServiceClass))
48 typedef struct _GSocketServicePrivate GSocketServicePrivate;
49 typedef struct _GSocketServiceClass GSocketServiceClass;
52 * GSocketServiceClass:
53 * @incomming: signal emitted when new connections are accepted
55 struct _GSocketServiceClass
57 GSocketListenerClass parent_class;
59 gboolean (* incoming) (GSocketService *service,
60 GSocketConnection *connection,
61 GObject *source_object);
63 /* Padding for future expansion */
64 void (*_g_reserved1) (void);
65 void (*_g_reserved2) (void);
66 void (*_g_reserved3) (void);
67 void (*_g_reserved4) (void);
68 void (*_g_reserved5) (void);
69 void (*_g_reserved6) (void);
72 struct _GSocketService
74 GSocketListener parent_instance;
75 GSocketServicePrivate *priv;
78 GType g_socket_service_get_type (void);
80 GSocketService *g_socket_service_new (void);
81 void g_socket_service_start (GSocketService *service);
82 void g_socket_service_stop (GSocketService *service);
83 gboolean g_socket_service_is_active (GSocketService *service);
88 #endif /* __G_SOCKET_SERVICE_H__ */