1 /***************************************************************************
2  *            brasero-disc.h
3  *
4  *  dim nov 27 14:58:13 2005
5  *  Copyright  2005  Rouquier Philippe
6  *  brasero-app@wanadoo.fr
7  ***************************************************************************/
8 
9 /*
10  *  Brasero is free software; you can redistribute it and/or modify
11  *  it under the terms of the GNU General Public License as published by
12  *  the Free Software Foundation; either version 2 of the License, or
13  *  (at your option) any later version.
14  *
15  *  Brasero is distributed in the hope that it will be useful,
16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *  GNU Library General Public License for more details.
19  *
20  *  You should have received a copy of the GNU General Public License
21  *  along with this program; if not, write to:
22  * 	The Free Software Foundation, Inc.,
23  * 	51 Franklin Street, Fifth Floor
24  * 	Boston, MA  02110-1301, USA.
25  */
26 
27 #ifndef DISC_H
28 #define DISC_H
29 
30 #include <glib.h>
31 #include <glib-object.h>
32 
33 #include <gtk/gtk.h>
34 
35 #include "brasero-project-parse.h"
36 #include "brasero-session.h"
37 
38 G_BEGIN_DECLS
39 
40 #define BRASERO_TYPE_DISC         (brasero_disc_get_type ())
41 #define BRASERO_DISC(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), BRASERO_TYPE_DISC, BraseroDisc))
42 #define BRASERO_IS_DISC(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), BRASERO_TYPE_DISC))
43 #define BRASERO_DISC_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), BRASERO_TYPE_DISC, BraseroDiscIface))
44 
45 #define BRASERO_DISC_ACTION "DiscAction"
46 
47 
48 typedef enum {
49 	BRASERO_DISC_OK = 0,
50 	BRASERO_DISC_NOT_IN_TREE,
51 	BRASERO_DISC_NOT_READY,
52 	BRASERO_DISC_LOADING,
53 	BRASERO_DISC_BROKEN_SYMLINK,
54 	BRASERO_DISC_CANCELLED,
55 	BRASERO_DISC_ERROR_SIZE,
56 	BRASERO_DISC_ERROR_EMPTY_SELECTION,
57 	BRASERO_DISC_ERROR_FILE_NOT_FOUND,
58 	BRASERO_DISC_ERROR_UNREADABLE,
59 	BRASERO_DISC_ERROR_ALREADY_IN_TREE,
60 	BRASERO_DISC_ERROR_JOLIET,
61 	BRASERO_DISC_ERROR_FILE_TYPE,
62 	BRASERO_DISC_ERROR_THREAD,
63 	BRASERO_DISC_ERROR_UNKNOWN
64 } BraseroDiscResult;
65 
66 typedef struct _BraseroDisc        BraseroDisc;
67 typedef struct _BraseroDiscIface   BraseroDiscIface;
68 
69 struct _BraseroDiscIface {
70 	GTypeInterface g_iface;
71 
72 	/* signals */
73 	void	(*selection_changed)			(BraseroDisc *disc);
74 
75 	/* virtual functions */
76 	BraseroDiscResult	(*set_session_contents)	(BraseroDisc *disc,
77 							 BraseroBurnSession *session);
78 
79 	BraseroDiscResult	(*add_uri)		(BraseroDisc *disc,
80 							 const gchar *uri);
81 
82 	gboolean		(*is_empty)		(BraseroDisc *disc);
83 	gboolean		(*get_selected_uri)	(BraseroDisc *disc,
84 							 gchar **uri);
85 	gboolean		(*get_boundaries)	(BraseroDisc *disc,
86 							 gint64 *start,
87 							 gint64 *end);
88 
89 	void			(*delete_selected)	(BraseroDisc *disc);
90 	void			(*clear)		(BraseroDisc *disc);
91 
92 	guint			(*add_ui)		(BraseroDisc *disc,
93 							 GtkUIManager *manager,
94 							 GtkWidget *message);
95 };
96 
97 GType brasero_disc_get_type (void);
98 
99 guint
100 brasero_disc_add_ui (BraseroDisc *disc,
101 		     GtkUIManager *manager,
102 		     GtkWidget *message);
103 
104 BraseroDiscResult
105 brasero_disc_add_uri (BraseroDisc *disc, const gchar *escaped_uri);
106 
107 gboolean
108 brasero_disc_get_selected_uri (BraseroDisc *disc, gchar **uri);
109 
110 gboolean
111 brasero_disc_get_boundaries (BraseroDisc *disc,
112 			     gint64 *start,
113 			     gint64 *end);
114 
115 void
116 brasero_disc_delete_selected (BraseroDisc *disc);
117 
118 gboolean
119 brasero_disc_clear (BraseroDisc *disc);
120 
121 BraseroDiscResult
122 brasero_disc_get_status (BraseroDisc *disc,
123 			 gint *remaining,
124 			 gchar **current_task);
125 
126 BraseroDiscResult
127 brasero_disc_set_session_contents (BraseroDisc *disc,
128 				   BraseroBurnSession *session);
129 
130 gboolean
131 brasero_disc_is_empty (BraseroDisc *disc);
132 
133 void
134 brasero_disc_selection_changed (BraseroDisc *disc);
135 
136 G_END_DECLS
137 
138 #endif /* DISC_H */
139