1 /*
2  * pluma-notebook.h
3  * This file is part of pluma
4  *
5  * Copyright (C) 2005 - Paolo Maggi
6  * Copyright (C) 2012-2021 MATE Developers
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program 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
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  */
23 
24 /*
25  * Modified by the pluma Team, 2005. See the AUTHORS file for a
26  * list of people on the pluma Team.
27  * See the ChangeLog files for a list of changes.
28  */
29 
30 /* This file is a modified version of the epiphany file ephy-notebook.h
31  * Here the relevant copyright:
32  *
33  *  Copyright (C) 2002 Christophe Fergeau
34  *  Copyright (C) 2003 Marco Pesenti Gritti
35  *  Copyright (C) 2003, 2004 Christian Persch
36  *
37  */
38 
39 #ifndef PLUMA_NOTEBOOK_H
40 #define PLUMA_NOTEBOOK_H
41 
42 #include <pluma/pluma-tab.h>
43 
44 #include <glib.h>
45 #include <gtk/gtk.h>
46 
47 G_BEGIN_DECLS
48 
49 /*
50  * Type checking and casting macros
51  */
52 #define PLUMA_TYPE_NOTEBOOK		(pluma_notebook_get_type ())
53 #define PLUMA_NOTEBOOK(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), PLUMA_TYPE_NOTEBOOK, PlumaNotebook))
54 #define PLUMA_NOTEBOOK_CLASS(k)		(G_TYPE_CHECK_CLASS_CAST((k), PLUMA_TYPE_NOTEBOOK, PlumaNotebookClass))
55 #define PLUMA_IS_NOTEBOOK(o)		(G_TYPE_CHECK_INSTANCE_TYPE ((o), PLUMA_TYPE_NOTEBOOK))
56 #define PLUMA_IS_NOTEBOOK_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), PLUMA_TYPE_NOTEBOOK))
57 #define PLUMA_NOTEBOOK_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), PLUMA_TYPE_NOTEBOOK, PlumaNotebookClass))
58 
59 /* Private structure type */
60 typedef struct _PlumaNotebookPrivate	PlumaNotebookPrivate;
61 
62 /*
63  * Main object structure
64  */
65 typedef struct _PlumaNotebook		PlumaNotebook;
66 
67 struct _PlumaNotebook
68 {
69 	GtkNotebook notebook;
70 
71 	/*< private >*/
72         PlumaNotebookPrivate *priv;
73 };
74 
75 /*
76  * Class definition
77  */
78 typedef struct _PlumaNotebookClass	PlumaNotebookClass;
79 
80 struct _PlumaNotebookClass
81 {
82         GtkNotebookClass parent_class;
83 
84 	/* Signals */
85 	void	 (* tab_added)      (PlumaNotebook *notebook,
86 				     PlumaTab      *tab);
87 	void	 (* tab_removed)    (PlumaNotebook *notebook,
88 				     PlumaTab      *tab);
89 	void	 (* tab_detached)   (PlumaNotebook *notebook,
90 				     PlumaTab      *tab);
91 	void	 (* tabs_reordered) (PlumaNotebook *notebook);
92 	void	 (* tab_close_request)
93 				    (PlumaNotebook *notebook,
94 				     PlumaTab      *tab);
95 };
96 
97 /*
98  * Public methods
99  */
100 GType		pluma_notebook_get_type		(void) G_GNUC_CONST;
101 
102 GtkWidget      *pluma_notebook_new		(void);
103 
104 void		pluma_notebook_add_tab		(PlumaNotebook *nb,
105 						 PlumaTab      *tab,
106 						 gint           position,
107 						 gboolean       jump_to);
108 
109 void		pluma_notebook_remove_tab	(PlumaNotebook *nb,
110 						 PlumaTab      *tab);
111 
112 void		pluma_notebook_remove_all_tabs 	(PlumaNotebook *nb);
113 
114 void		pluma_notebook_reorder_tab	(PlumaNotebook *src,
115 			    			 PlumaTab      *tab,
116 			    			 gint           dest_position);
117 
118 void            pluma_notebook_move_tab		(PlumaNotebook *src,
119 						 PlumaNotebook *dest,
120 						 PlumaTab      *tab,
121 						 gint           dest_position);
122 
123 void		pluma_notebook_set_close_buttons_sensitive
124 						(PlumaNotebook *nb,
125 						 gboolean       sensitive);
126 
127 gboolean	pluma_notebook_get_close_buttons_sensitive
128 						(PlumaNotebook *nb);
129 
130 void		pluma_notebook_set_tab_drag_and_drop_enabled
131 						(PlumaNotebook *nb,
132 						 gboolean       enable);
133 
134 gboolean	pluma_notebook_get_tab_drag_and_drop_enabled
135 						(PlumaNotebook *nb);
136 
137 G_END_DECLS
138 
139 #endif /* PLUMA_NOTEBOOK_H */
140