afaaa32f05105f618cb4a537bf0034b11dcc3581
[profile/ivi/GUPnP.git] / libgupnp / gupnp-root-device.h
1 /*
2  * Copyright (C) 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_ROOT_DEVICE_H__
23 #define __GUPNP_ROOT_DEVICE_H__
24
25 #include <libxml/tree.h>
26
27 #include "gupnp-context.h"
28 #include "gupnp-device.h"
29 #include "gupnp-resource-factory.h"
30 #include "gupnp-xml-doc.h"
31
32 G_BEGIN_DECLS
33
34 GType
35 gupnp_root_device_get_type (void) G_GNUC_CONST;
36
37 #define GUPNP_TYPE_ROOT_DEVICE \
38                 (gupnp_root_device_get_type ())
39 #define GUPNP_ROOT_DEVICE(obj) \
40                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
41                  GUPNP_TYPE_ROOT_DEVICE, \
42                  GUPnPRootDevice))
43 #define GUPNP_ROOT_DEVICE_CLASS(obj) \
44                 (G_TYPE_CHECK_CLASS_CAST ((obj), \
45                  GUPNP_TYPE_ROOT_DEVICE, \
46                  GUPnPRootDeviceClass))
47 #define GUPNP_IS_ROOT_DEVICE(obj) \
48                 (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
49                  GUPNP_TYPE_ROOT_DEVICE))
50 #define GUPNP_IS_ROOT_DEVICE_CLASS(obj) \
51                 (G_TYPE_CHECK_CLASS_TYPE ((obj), \
52                  GUPNP_TYPE_ROOT_DEVICE))
53 #define GUPNP_ROOT_DEVICE_GET_CLASS(obj) \
54                 (G_TYPE_INSTANCE_GET_CLASS ((obj), \
55                  GUPNP_TYPE_ROOT_DEVICE, \
56                  GUPnPRootDeviceClass))
57
58 typedef struct _GUPnPRootDevicePrivate GUPnPRootDevicePrivate;
59 typedef struct _GUPnPRootDevice GUPnPRootDevice;
60 typedef struct _GUPnPRootDeviceClass GUPnPRootDeviceClass;
61
62 /**
63  * GUPnPRootDevice:
64  *
65  * This struct contains private data only, and should be accessed using the
66  * functions below.
67  */
68 struct _GUPnPRootDevice {
69         GUPnPDevice parent;
70
71         GUPnPRootDevicePrivate *priv;
72 };
73
74 struct _GUPnPRootDeviceClass {
75         GUPnPDeviceClass 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 GUPnPRootDevice *
85 gupnp_root_device_new             (GUPnPContext         *context,
86                                    const char           *description_path,
87                                    const char           *description_dir);
88
89 GUPnPRootDevice *
90 gupnp_root_device_new_full        (GUPnPContext         *context,
91                                    GUPnPResourceFactory *factory,
92                                    GUPnPXMLDoc          *description_doc,
93                                    const char           *description_path,
94                                    const char           *description_dir);
95
96 void
97 gupnp_root_device_set_available   (GUPnPRootDevice      *root_device,
98                                    gboolean              available);
99
100 gboolean
101 gupnp_root_device_get_available   (GUPnPRootDevice      *root_device);
102
103 const char *
104 gupnp_root_device_get_relative_location
105                                   (GUPnPRootDevice      *root_device);
106
107 const char *
108 gupnp_root_device_get_description_path
109                                   (GUPnPRootDevice      *root_device);
110
111 const char *
112 gupnp_root_device_get_description_dir
113                                   (GUPnPRootDevice      *root_device);
114
115 G_END_DECLS
116
117 #endif /* __GUPNP_ROOT_DEVICE_H__ */