1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2 /*
3  * Libbrasero-burn
4  * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app@wanadoo.fr>
5  *
6  * Libbrasero-burn is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * The Libbrasero-burn authors hereby grant permission for non-GPL compatible
12  * GStreamer plugins to be used and distributed together with GStreamer
13  * and Libbrasero-burn. This permission is above and beyond the permissions granted
14  * by the GPL license by which Libbrasero-burn is covered. If you modify this code
15  * you may extend this exception to your version of the code, but you are not
16  * obligated to do so. If you do not wish to do so, delete this exception
17  * statement from your version.
18  *
19  * Libbrasero-burn is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU Library General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to:
26  * 	The Free Software Foundation, Inc.,
27  * 	51 Franklin Street, Fifth Floor
28  * 	Boston, MA  02110-1301, USA.
29  */
30 
31 #ifndef _BRASERO_TRACK_DATA_H_
32 #define _BRASERO_TRACK_DATA_H_
33 
34 #include <glib-object.h>
35 
36 #include <brasero-track.h>
37 
38 G_BEGIN_DECLS
39 
40 /**
41  * BraseroGraftPt:
42  * @uri: a URI
43  * @path: a file path
44  *
45  * A pair of strings describing:
46  * @uri the actual current location of the file
47  * @path the path of the file on the future ISO9660/UDF/... filesystem
48  **/
49 typedef struct _BraseroGraftPt {
50 	gchar *uri;
51 	gchar *path;
52 } BraseroGraftPt;
53 
54 void
55 brasero_graft_point_free (BraseroGraftPt *graft);
56 
57 BraseroGraftPt *
58 brasero_graft_point_copy (BraseroGraftPt *graft);
59 
60 
61 #define BRASERO_TYPE_TRACK_DATA             (brasero_track_data_get_type ())
62 #define BRASERO_TRACK_DATA(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), BRASERO_TYPE_TRACK_DATA, BraseroTrackData))
63 #define BRASERO_TRACK_DATA_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), BRASERO_TYPE_TRACK_DATA, BraseroTrackDataClass))
64 #define BRASERO_IS_TRACK_DATA(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BRASERO_TYPE_TRACK_DATA))
65 #define BRASERO_IS_TRACK_DATA_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), BRASERO_TYPE_TRACK_DATA))
66 #define BRASERO_TRACK_DATA_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), BRASERO_TYPE_TRACK_DATA, BraseroTrackDataClass))
67 
68 typedef struct _BraseroTrackDataClass BraseroTrackDataClass;
69 typedef struct _BraseroTrackData BraseroTrackData;
70 
71 struct _BraseroTrackDataClass
72 {
73 	BraseroTrackClass parent_class;
74 
75 	/* virtual functions */
76 
77 	/**
78 	 * set_source:
79 	 * @track: a #BraseroTrackData.
80 	 * @grafts: (element-type BraseroBurn.GraftPt) (transfer full): a #GSList of #BraseroGraftPt.
81 	 * @unreadable: (element-type utf8) (transfer full) (allow-none): a #GSList of URIs (as strings) or %NULL.
82 	 *
83 	 * Return value: a #BraseroBurnResult
84 	 **/
85 	BraseroBurnResult	(*set_source)		(BraseroTrackData *track,
86 							 GSList *grafts,
87 							 GSList *unreadable);
88 	BraseroBurnResult       (*add_fs)		(BraseroTrackData *track,
89 							 BraseroImageFS fstype);
90 
91 	BraseroBurnResult       (*rm_fs)		(BraseroTrackData *track,
92 							 BraseroImageFS fstype);
93 
94 	BraseroImageFS		(*get_fs)		(BraseroTrackData *track);
95 	GSList*			(*get_grafts)		(BraseroTrackData *track);
96 	GSList*			(*get_excluded)		(BraseroTrackData *track);
97 	guint64			(*get_file_num)		(BraseroTrackData *track);
98 };
99 
100 struct _BraseroTrackData
101 {
102 	BraseroTrack parent_instance;
103 };
104 
105 GType brasero_track_data_get_type (void) G_GNUC_CONST;
106 
107 BraseroTrackData *
108 brasero_track_data_new (void);
109 
110 BraseroBurnResult
111 brasero_track_data_set_source (BraseroTrackData *track,
112 			       GSList *grafts,
113 			       GSList *unreadable);
114 
115 BraseroBurnResult
116 brasero_track_data_add_fs (BraseroTrackData *track,
117 			   BraseroImageFS fstype);
118 
119 BraseroBurnResult
120 brasero_track_data_rm_fs (BraseroTrackData *track,
121 			  BraseroImageFS fstype);
122 
123 BraseroBurnResult
124 brasero_track_data_set_data_blocks (BraseroTrackData *track,
125 				    goffset blocks);
126 
127 BraseroBurnResult
128 brasero_track_data_set_file_num (BraseroTrackData *track,
129 				 guint64 number);
130 
131 GSList *
132 brasero_track_data_get_grafts (BraseroTrackData *track);
133 
134 GSList *
135 brasero_track_data_get_excluded_list (BraseroTrackData *track);
136 
137 BraseroBurnResult
138 brasero_track_data_write_to_paths (BraseroTrackData *track,
139                                    const gchar *grafts_path,
140                                    const gchar *excluded_path,
141                                    const gchar *emptydir,
142                                    const gchar *videodir,
143                                    GError **error);
144 
145 BraseroBurnResult
146 brasero_track_data_get_file_num (BraseroTrackData *track,
147 				 guint64 *file_num);
148 
149 BraseroImageFS
150 brasero_track_data_get_fs (BraseroTrackData *track);
151 
152 G_END_DECLS
153 
154 #endif /* _BRASERO_TRACK_DATA_H_ */
155