Add gobject introspection
[profile/ivi/GUPnP.git] / libgupnp / gupnp-context.h
1 /*
2  * Copyright (C) 2006, 2007, 2008 OpenedHand Ltd.
3  *
4  * Author: Jorn Baayen <jorn@openedhand.com>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
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  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21
22 #ifndef __GUPNP_CONTEXT_H__
23 #define __GUPNP_CONTEXT_H__
24
25 #include <libgssdp/gssdp-client.h>
26 #include <libsoup/soup-server.h>
27 #include <libsoup/soup-session.h>
28
29 G_BEGIN_DECLS
30
31 GType
32 gupnp_context_get_type (void) G_GNUC_CONST;
33
34 #define GUPNP_TYPE_CONTEXT \
35                 (gupnp_context_get_type ())
36 #define GUPNP_CONTEXT(obj) \
37                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
38                  GUPNP_TYPE_CONTEXT, \
39                  GUPnPContext))
40 #define GUPNP_CONTEXT_CLASS(obj) \
41                 (G_TYPE_CHECK_CLASS_CAST ((obj), \
42                  GUPNP_TYPE_CONTEXT, \
43                  GUPnPContextClass))
44 #define GUPNP_IS_CONTEXT(obj) \
45                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
46                  GUPNP_TYPE_CONTEXT))
47 #define GUPNP_IS_CONTEXT_CLASS(obj) \
48                 (G_TYPE_CHECK_CLASS_TYPE ((obj), \
49                  GUPNP_TYPE_CONTEXT))
50 #define GUPNP_CONTEXT_GET_CLASS(obj) \
51                 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
52                  GUPNP_TYPE_CONTEXT, \
53                  GUPnPContextClass))
54
55 typedef struct _GUPnPContextPrivate GUPnPContextPrivate;
56 typedef struct _GUPnPContext GUPnPContext;
57 typedef struct _GUPnPContextClass GUPnPContextClass;
58
59 /**
60  * GUPnPContext:
61  *
62  * This struct contains private data only, and should be accessed using the
63  * functions below.
64  */
65 struct _GUPnPContext {
66         GSSDPClient parent;
67
68         GUPnPContextPrivate *priv;
69 };
70
71 struct _GUPnPContextClass {
72         GSSDPClientClass parent_class;
73
74         /* future padding */
75         void (* _gupnp_reserved1) (void);
76         void (* _gupnp_reserved2) (void);
77         void (* _gupnp_reserved3) (void);
78         void (* _gupnp_reserved4) (void);
79 };
80
81 GUPnPContext *
82 gupnp_context_new                      (GMainContext *main_context,
83                                         const char   *iface,
84                                         guint         port,
85                                         GError      **error);
86
87 #ifndef GUPNP_DISABLE_DEPRECATED
88
89 const char *
90 gupnp_context_get_host_ip              (GUPnPContext *context);
91
92 #endif /* GUPNP_DISABLE_DEPRECATED */
93
94 guint
95 gupnp_context_get_port                 (GUPnPContext *context);
96
97 SoupServer *
98 gupnp_context_get_server               (GUPnPContext *context);
99
100 SoupSession *
101 gupnp_context_get_session              (GUPnPContext *context);
102
103 void
104 gupnp_context_set_subscription_timeout (GUPnPContext *context,
105                                         guint         timeout);
106
107 guint
108 gupnp_context_get_subscription_timeout (GUPnPContext *context);
109
110 void
111 gupnp_context_set_default_language     (GUPnPContext *context,
112                                         const char   *language);
113
114 const char *
115 gupnp_context_get_default_language     (GUPnPContext *context);
116
117 void
118 gupnp_context_host_path                (GUPnPContext *context,
119                                         const char   *local_path,
120                                         const char   *server_path);
121
122 gboolean
123 gupnp_context_host_path_for_agent      (GUPnPContext *context,
124                                         const char   *local_path,
125                                         const char   *server_path,
126                                         GRegex       *user_agent);
127
128 void
129 gupnp_context_unhost_path              (GUPnPContext *context,
130                                         const char   *server_path);
131
132 G_END_DECLS
133
134 #endif /* __GUPNP_CONTEXT_H__ */