Imported Upstream version 0.20.12
[profile/ivi/GUPnP.git] / libgupnp / gupnp-service-info.h
1 /*
2  * Copyright (C) 2006, 2007 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_SERVICE_INFO_H__
23 #define __GUPNP_SERVICE_INFO_H__
24
25 #include <glib-object.h>
26 #include <libxml/tree.h>
27 #include <libsoup/soup-uri.h>
28
29 #include "gupnp-context.h"
30 #include "gupnp-service-introspection.h"
31
32 G_BEGIN_DECLS
33
34 GType
35 gupnp_service_info_get_type (void) G_GNUC_CONST;
36
37 #define GUPNP_TYPE_SERVICE_INFO \
38                 (gupnp_service_info_get_type ())
39 #define GUPNP_SERVICE_INFO(obj) \
40                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
41                  GUPNP_TYPE_SERVICE_INFO, \
42                  GUPnPServiceInfo))
43 #define GUPNP_SERVICE_INFO_CLASS(obj) \
44                 (G_TYPE_CHECK_CLASS_CAST ((obj), \
45                  GUPNP_TYPE_SERVICE_INFO, \
46                  GUPnPServiceInfoClass))
47 #define GUPNP_IS_SERVICE_INFO(obj) \
48                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
49                  GUPNP_TYPE_SERVICE_INFO))
50 #define GUPNP_IS_SERVICE_INFO_CLASS(obj) \
51                 (G_TYPE_CHECK_CLASS_TYPE ((obj), \
52                  GUPNP_TYPE_SERVICE_INFO))
53 #define GUPNP_SERVICE_INFO_GET_CLASS(obj) \
54                 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
55                  GUPNP_TYPE_SERVICE_INFO, \
56                  GUPnPServiceInfoClass))
57
58 typedef struct _GUPnPServiceInfoPrivate GUPnPServiceInfoPrivate;
59 typedef struct _GUPnPServiceInfo GUPnPServiceInfo;
60 typedef struct _GUPnPServiceInfoClass GUPnPServiceInfoClass;
61
62 /**
63  * GUPnPServiceInfo:
64  *
65  * This struct contains private data only, and should be accessed using the
66  * functions below.
67  */
68 struct _GUPnPServiceInfo {
69         GObject parent;
70
71         GUPnPServiceInfoPrivate *priv;
72 };
73
74 struct _GUPnPServiceInfoClass {
75         GObjectClass parent_class;
76
77         /* future padding */
78         void (* _gupnp_reserved1) (void);
79         void (* _gupnp_reserved2) (void);
80         void (* _gupnp_reserved3) (void);
81         void (* _gupnp_reserved4) (void);
82 };
83
84 /**
85  * GUPnPServiceIntrospectionCallback:
86  * @info: The #GUPnPServiceInfo introspection was requested for
87  * @introspection: The new #GUPnPServiceIntrospection object, or NULL
88  * @error: The #GError that occurred, or NULL
89  * @user_data: User data
90  *
91  * Callback notifying that @introspection for @info has been obtained.
92  **/
93 typedef void (* GUPnPServiceIntrospectionCallback) (
94                                  GUPnPServiceInfo           *info,
95                                  GUPnPServiceIntrospection  *introspection,
96                                  const GError               *error,
97                                  gpointer                    user_data);
98
99 GUPnPContext *
100 gupnp_service_info_get_context                (GUPnPServiceInfo *info);
101
102 const char *
103 gupnp_service_info_get_location               (GUPnPServiceInfo *info);
104
105 const SoupURI *
106 gupnp_service_info_get_url_base               (GUPnPServiceInfo *info);
107
108 const char *
109 gupnp_service_info_get_udn                    (GUPnPServiceInfo *info);
110
111 const char *
112 gupnp_service_info_get_service_type           (GUPnPServiceInfo *info);
113
114 char *
115 gupnp_service_info_get_id                     (GUPnPServiceInfo *info);
116
117 char *
118 gupnp_service_info_get_scpd_url               (GUPnPServiceInfo *info);
119
120 char *
121 gupnp_service_info_get_control_url            (GUPnPServiceInfo *info);
122
123 char *
124 gupnp_service_info_get_event_subscription_url (GUPnPServiceInfo *info);
125
126 GUPnPServiceIntrospection *
127 gupnp_service_info_get_introspection          (GUPnPServiceInfo *info,
128                                                GError          **error);
129
130 void
131 gupnp_service_info_get_introspection_async
132                               (GUPnPServiceInfo                 *info,
133                                GUPnPServiceIntrospectionCallback callback,
134                                gpointer                          user_data);
135
136 void
137 gupnp_service_info_get_introspection_async_full
138                               (GUPnPServiceInfo                 *info,
139                                GUPnPServiceIntrospectionCallback callback,
140                                GCancellable                     *cancellable,
141                                gpointer                          user_data);
142
143 G_END_DECLS
144
145 #endif /* __GUPNP_SERVICE_INFO_H__ */