1 /*
2  * xed-notebook.h
3  * This file is part of xed
4  *
5  * Copyright (C) 2005 - Paolo Maggi
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 /*
24  * Modified by the xed Team, 2005. See the AUTHORS file for a
25  * list of people on the xed Team.
26  * See the ChangeLog files for a list of changes.
27  */
28 
29 /* This file is a modified version of the epiphany file ephy-notebook.h
30  * Here the relevant copyright:
31  *
32  *  Copyright (C) 2002 Christophe Fergeau
33  *  Copyright (C) 2003 Marco Pesenti Gritti
34  *  Copyright (C) 2003, 2004 Christian Persch
35  *
36  */
37 
38 #ifndef XED_NOTEBOOK_H
39 #define XED_NOTEBOOK_H
40 
41 #include <xed/xed-tab.h>
42 
43 #include <glib.h>
44 #include <gtk/gtk.h>
45 
46 G_BEGIN_DECLS
47 
48 /*
49  * Type checking and casting macros
50  */
51 #define XED_TYPE_NOTEBOOK		(xed_notebook_get_type ())
52 #define XED_NOTEBOOK(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), XED_TYPE_NOTEBOOK, XedNotebook))
53 #define XED_NOTEBOOK_CLASS(k)		(G_TYPE_CHECK_CLASS_CAST((k), XED_TYPE_NOTEBOOK, XedNotebookClass))
54 #define XED_IS_NOTEBOOK(o)		(G_TYPE_CHECK_INSTANCE_TYPE ((o), XED_TYPE_NOTEBOOK))
55 #define XED_IS_NOTEBOOK_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), XED_TYPE_NOTEBOOK))
56 #define XED_NOTEBOOK_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), XED_TYPE_NOTEBOOK, XedNotebookClass))
57 
58 /* Private structure type */
59 typedef struct _XedNotebookPrivate	XedNotebookPrivate;
60 
61 /*
62  * Main object structure
63  */
64 typedef struct _XedNotebook		XedNotebook;
65 
66 struct _XedNotebook
67 {
68 	GtkNotebook notebook;
69 
70 	/*< private >*/
71         XedNotebookPrivate *priv;
72 };
73 
74 /*
75  * Class definition
76  */
77 typedef struct _XedNotebookClass	XedNotebookClass;
78 
79 struct _XedNotebookClass
80 {
81         GtkNotebookClass parent_class;
82 
83 	/* Signals */
84 	void	 (* tab_added)      (XedNotebook *notebook,
85 				     XedTab      *tab);
86 	void	 (* tab_removed)    (XedNotebook *notebook,
87 				     XedTab      *tab);
88 	void	 (* tab_detached)   (XedNotebook *notebook,
89 				     XedTab      *tab);
90 	void	 (* tabs_reordered) (XedNotebook *notebook);
91 	void	 (* tab_close_request)
92 				    (XedNotebook *notebook,
93 				     XedTab      *tab);
94 };
95 
96 /*
97  * Public methods
98  */
99 GType		xed_notebook_get_type		(void) G_GNUC_CONST;
100 
101 GtkWidget      *xed_notebook_new		(void);
102 
103 void		xed_notebook_add_tab		(XedNotebook *nb,
104 						 XedTab      *tab,
105 						 gint           position,
106 						 gboolean       jump_to);
107 
108 void		xed_notebook_remove_tab	(XedNotebook *nb,
109 						 XedTab      *tab);
110 
111 void		xed_notebook_remove_all_tabs 	(XedNotebook *nb);
112 
113 GList *xed_notebook_get_all_tabs (XedNotebook *nb);
114 
115 void		xed_notebook_reorder_tab	(XedNotebook *src,
116 			    			 XedTab      *tab,
117 			    			 gint           dest_position);
118 
119 void            xed_notebook_move_tab		(XedNotebook *src,
120 						 XedNotebook *dest,
121 						 XedTab      *tab,
122 						 gint           dest_position);
123 
124 void		xed_notebook_set_close_buttons_sensitive
125 						(XedNotebook *nb,
126 						 gboolean       sensitive);
127 
128 gboolean	xed_notebook_get_close_buttons_sensitive
129 						(XedNotebook *nb);
130 
131 void		xed_notebook_set_tab_drag_and_drop_enabled
132 						(XedNotebook *nb,
133 						 gboolean       enable);
134 
135 gboolean	xed_notebook_get_tab_drag_and_drop_enabled
136 						(XedNotebook *nb);
137 
138 void        xed_notebook_set_tab_scrolling_enabled (XedNotebook *nb,
139                                                     gboolean     enable);
140 gboolean    xed_notebook_get_tab_scrolling_enabled (XedNotebook *nb);
141 
142 G_END_DECLS
143 
144 #endif /* XED_NOTEBOOK_H */
145