1 /*
2  * Header for DPAP (e.g., iPhoto Picture) sharing
3  *
4  * Copyright (C) 2005 Charles Schmidt <cschmidt2@emich.edu>
5  *
6  * Modifications Copyright (C) 2008 W. Michael Petullo <mike@flyn.org>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 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  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21  *
22  */
23 
24 #ifndef __DPAP_SHARE_H
25 #define __DPAP_SHARE_H
26 
27 #include <glib-object.h>
28 
29 #include <libdmapsharing/dmap-share.h>
30 
31 G_BEGIN_DECLS
32 /**
33  * DPAP_TYPE_SHARE:
34  *
35  * The type for #DPAPShare.
36  */
37 #define DPAP_TYPE_SHARE         (dpap_share_get_type ())
38 /**
39  * DPAP_SHARE:
40  * @o: Object which is subject to casting.
41  *
42  * Casts a #DPAPShare or derived pointer into a (DPAPShare*) pointer.
43  * Depending on the current debugging level, this function may invoke
44  * certain runtime checks to identify invalid casts.
45  */
46 #define DPAP_SHARE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), \
47 				 DPAP_TYPE_SHARE, DPAPShare))
48 /**
49  * DPAP_SHARE_CLASS:
50  * @k: a valid #DPAPShareClass
51  *
52  * Casts a derived #DPAPShareClass structure into a #DPAPShareClass structure.
53  */
54 #define DPAP_SHARE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), \
55 				 DPAP_TYPE_SHARE, DPAPShareClass))
56 /**
57  * IS_DPAP_SHARE:
58  * @o: Instance to check for being a %DPAP_TYPE_SHARE.
59  *
60  * Checks whether a valid #GTypeInstance pointer is of type %DPAP_TYPE_SHARE.
61  */
62 #define IS_DPAP_SHARE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), \
63 				 DPAP_TYPE_SHARE))
64 /**
65  * IS_DPAP_SHARE_CLASS:
66  * @k: a #DPAPShareClass
67  *
68  * Checks whether @k "is a" valid #DPAPShareClass structure of type
69  * %DPAP_SHARE or derived.
70  */
71 #define IS_DPAP_SHARE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), DPAP_TYPE_SHARE))
72 /**
73  * DPAP_SHARE_GET_CLASS:
74  * @o: a #DPAPShare instance.
75  *
76  * Get the class structure associated to a #DPAPShare instance.
77  *
78  * Returns: pointer to object class structure.
79  */
80 #define DPAP_SHARE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \
81 				 DPAP_TYPE_SHARE, DPAPShareClass))
82 typedef struct DPAPSharePrivate DPAPSharePrivate;
83 
84 typedef struct
85 {
86 	DMAPShareClass dmap_share_class;
87 } DPAPShareClass;
88 
89 typedef struct
90 {
91 	DMAPShare dmap_share_instance;
92 	DPAPSharePrivate *priv;
93 } DPAPShare;
94 
95 GType dpap_share_get_type (void);
96 
97 /**
98  * dpap_share_new:
99  * @name: The name that will be published by mDNS.
100  * @password: A share password or NULL.
101  * @db: A media database.
102  * @container_db: A container (album) database.
103  * @transcode_mimetype: A transcode mimetype or NULL.
104  *
105  * Creates a new DPAP share and publishes it using mDNS.
106  *
107  * Returns: a pointer to a DPAPShare.
108  */
109 DPAPShare *dpap_share_new (const char *name, const char *password,
110 			   gpointer db, gpointer container_db,
111 			   gchar * transcode_mimetype);
112 
113 #endif /* __DPAP_SHARE_H */
114 
115 G_END_DECLS
116