1/* -*- Mode: C; c-file-style: "gnu"; tab-width: 8 -*- */
2/* GTK - The GIMP Toolkit
3 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19/*
20 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
21 * file for a list of people on the GTK+ Team. See the ChangeLog
22 * files for a list of changes. These files are distributed with
23 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
24 */
25
26#ifndef __GTK_NOTEBOOK_H__
27#define __GTK_NOTEBOOK_H__
28
29
30#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
31#error "Only <gtk/gtk.h> can be included directly."
32#endif
33
34#include <gtk/gtkcontainer.h>
35
36
37G_BEGIN_DECLS
38
39#define GTK_TYPE_NOTEBOOK (gtk_notebook_get_type ())
40#define GTK_NOTEBOOK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_NOTEBOOK, GtkNotebook))
41#define GTK_NOTEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_NOTEBOOK, GtkNotebookClass))
42#define GTK_IS_NOTEBOOK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_NOTEBOOK))
43#define GTK_IS_NOTEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK))
44#define GTK_NOTEBOOK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_NOTEBOOK, GtkNotebookClass))
45
46
47typedef enum
48{
49 GTK_NOTEBOOK_TAB_FIRST,
50 GTK_NOTEBOOK_TAB_LAST
51} GtkNotebookTab;
52
53typedef struct _GtkNotebook GtkNotebook;
54typedef struct _GtkNotebookPrivate GtkNotebookPrivate;
55typedef struct _GtkNotebookClass GtkNotebookClass;
56
57struct _GtkNotebook
58{
59 /*< private >*/
60 GtkContainer container;
61
62 GtkNotebookPrivate *priv;
63};
64
65struct _GtkNotebookClass
66{
67 GtkContainerClass parent_class;
68
69 void (* switch_page) (GtkNotebook *notebook,
70 GtkWidget *page,
71 guint page_num);
72
73 /* Action signals for keybindings */
74 gboolean (* select_page) (GtkNotebook *notebook,
75 gboolean move_focus);
76 gboolean (* focus_tab) (GtkNotebook *notebook,
77 GtkNotebookTab type);
78 gboolean (* change_current_page) (GtkNotebook *notebook,
79 gint offset);
80 void (* move_focus_out) (GtkNotebook *notebook,
81 GtkDirectionType direction);
82 gboolean (* reorder_tab) (GtkNotebook *notebook,
83 GtkDirectionType direction,
84 gboolean move_to_last);
85
86 /* More vfuncs */
87 gint (* insert_page) (GtkNotebook *notebook,
88 GtkWidget *child,
89 GtkWidget *tab_label,
90 GtkWidget *menu_label,
91 gint position);
92
93 GtkNotebook * (* create_window) (GtkNotebook *notebook,
94 GtkWidget *page,
95 gint x,
96 gint y);
97
98 void (* page_reordered) (GtkNotebook *notebook,
99 GtkWidget *child,
100 guint page_num);
101
102 void (* page_removed) (GtkNotebook *notebook,
103 GtkWidget *child,
104 guint page_num);
105
106 void (* page_added) (GtkNotebook *notebook,
107 GtkWidget *child,
108 guint page_num);
109
110 /* Padding for future expansion */
111 void (*_gtk_reserved1) (void);
112 void (*_gtk_reserved2) (void);
113 void (*_gtk_reserved3) (void);
114 void (*_gtk_reserved4) (void);
115 void (*_gtk_reserved5) (void);
116 void (*_gtk_reserved6) (void);
117 void (*_gtk_reserved7) (void);
118 void (*_gtk_reserved8) (void);
119};
120
121/***********************************************************
122 * Creation, insertion, deletion *
123 ***********************************************************/
124
125GDK_AVAILABLE_IN_ALL
126GType gtk_notebook_get_type (void) G_GNUC_CONST;
127GDK_AVAILABLE_IN_ALL
128GtkWidget * gtk_notebook_new (void);
129GDK_AVAILABLE_IN_ALL
130gint gtk_notebook_append_page (GtkNotebook *notebook,
131 GtkWidget *child,
132 GtkWidget *tab_label);
133GDK_AVAILABLE_IN_ALL
134gint gtk_notebook_append_page_menu (GtkNotebook *notebook,
135 GtkWidget *child,
136 GtkWidget *tab_label,
137 GtkWidget *menu_label);
138GDK_AVAILABLE_IN_ALL
139gint gtk_notebook_prepend_page (GtkNotebook *notebook,
140 GtkWidget *child,
141 GtkWidget *tab_label);
142GDK_AVAILABLE_IN_ALL
143gint gtk_notebook_prepend_page_menu (GtkNotebook *notebook,
144 GtkWidget *child,
145 GtkWidget *tab_label,
146 GtkWidget *menu_label);
147GDK_AVAILABLE_IN_ALL
148gint gtk_notebook_insert_page (GtkNotebook *notebook,
149 GtkWidget *child,
150 GtkWidget *tab_label,
151 gint position);
152GDK_AVAILABLE_IN_ALL
153gint gtk_notebook_insert_page_menu (GtkNotebook *notebook,
154 GtkWidget *child,
155 GtkWidget *tab_label,
156 GtkWidget *menu_label,
157 gint position);
158GDK_AVAILABLE_IN_ALL
159void gtk_notebook_remove_page (GtkNotebook *notebook,
160 gint page_num);
161
162/***********************************************************
163 * Tabs drag and drop *
164 ***********************************************************/
165
166GDK_AVAILABLE_IN_ALL
167void gtk_notebook_set_group_name (GtkNotebook *notebook,
168 const gchar *group_name);
169GDK_AVAILABLE_IN_ALL
170const gchar *gtk_notebook_get_group_name (GtkNotebook *notebook);
171
172
173
174/***********************************************************
175 * query, set current NotebookPage *
176 ***********************************************************/
177
178GDK_AVAILABLE_IN_ALL
179gint gtk_notebook_get_current_page (GtkNotebook *notebook);
180GDK_AVAILABLE_IN_ALL
181GtkWidget* gtk_notebook_get_nth_page (GtkNotebook *notebook,
182 gint page_num);
183GDK_AVAILABLE_IN_ALL
184gint gtk_notebook_get_n_pages (GtkNotebook *notebook);
185GDK_AVAILABLE_IN_ALL
186gint gtk_notebook_page_num (GtkNotebook *notebook,
187 GtkWidget *child);
188GDK_AVAILABLE_IN_ALL
189void gtk_notebook_set_current_page (GtkNotebook *notebook,
190 gint page_num);
191GDK_AVAILABLE_IN_ALL
192void gtk_notebook_next_page (GtkNotebook *notebook);
193GDK_AVAILABLE_IN_ALL
194void gtk_notebook_prev_page (GtkNotebook *notebook);
195
196/***********************************************************
197 * set Notebook, NotebookTab style *
198 ***********************************************************/
199
200GDK_AVAILABLE_IN_ALL
201void gtk_notebook_set_show_border (GtkNotebook *notebook,
202 gboolean show_border);
203GDK_AVAILABLE_IN_ALL
204gboolean gtk_notebook_get_show_border (GtkNotebook *notebook);
205GDK_AVAILABLE_IN_ALL
206void gtk_notebook_set_show_tabs (GtkNotebook *notebook,
207 gboolean show_tabs);
208GDK_AVAILABLE_IN_ALL
209gboolean gtk_notebook_get_show_tabs (GtkNotebook *notebook);
210GDK_AVAILABLE_IN_ALL
211void gtk_notebook_set_tab_pos (GtkNotebook *notebook,
212 GtkPositionType pos);
213GDK_AVAILABLE_IN_ALL
214GtkPositionType gtk_notebook_get_tab_pos (GtkNotebook *notebook);
215GDK_AVAILABLE_IN_ALL
216void gtk_notebook_set_scrollable (GtkNotebook *notebook,
217 gboolean scrollable);
218GDK_AVAILABLE_IN_ALL
219gboolean gtk_notebook_get_scrollable (GtkNotebook *notebook);
220GDK_DEPRECATED_IN_3_4
221guint16 gtk_notebook_get_tab_hborder (GtkNotebook *notebook);
222GDK_DEPRECATED_IN_3_4
223guint16 gtk_notebook_get_tab_vborder (GtkNotebook *notebook);
224
225/***********************************************************
226 * enable/disable PopupMenu *
227 ***********************************************************/
228
229GDK_AVAILABLE_IN_ALL
230void gtk_notebook_popup_enable (GtkNotebook *notebook);
231GDK_AVAILABLE_IN_ALL
232void gtk_notebook_popup_disable (GtkNotebook *notebook);
233
234/***********************************************************
235 * query/set NotebookPage Properties *
236 ***********************************************************/
237
238GDK_AVAILABLE_IN_ALL
239GtkWidget * gtk_notebook_get_tab_label (GtkNotebook *notebook,
240 GtkWidget *child);
241GDK_AVAILABLE_IN_ALL
242void gtk_notebook_set_tab_label (GtkNotebook *notebook,
243 GtkWidget *child,
244 GtkWidget *tab_label);
245GDK_AVAILABLE_IN_ALL
246void gtk_notebook_set_tab_label_text (GtkNotebook *notebook,
247 GtkWidget *child,
248 const gchar *tab_text);
249GDK_AVAILABLE_IN_ALL
250const gchar * gtk_notebook_get_tab_label_text (GtkNotebook *notebook,
251 GtkWidget *child);
252GDK_AVAILABLE_IN_ALL
253GtkWidget * gtk_notebook_get_menu_label (GtkNotebook *notebook,
254 GtkWidget *child);
255GDK_AVAILABLE_IN_ALL
256void gtk_notebook_set_menu_label (GtkNotebook *notebook,
257 GtkWidget *child,
258 GtkWidget *menu_label);
259GDK_AVAILABLE_IN_ALL
260void gtk_notebook_set_menu_label_text (GtkNotebook *notebook,
261 GtkWidget *child,
262 const gchar *menu_text);
263GDK_AVAILABLE_IN_ALL
264const gchar * gtk_notebook_get_menu_label_text (GtkNotebook *notebook,
265 GtkWidget *child);
266GDK_AVAILABLE_IN_ALL
267void gtk_notebook_reorder_child (GtkNotebook *notebook,
268 GtkWidget *child,
269 gint position);
270GDK_AVAILABLE_IN_ALL
271gboolean gtk_notebook_get_tab_reorderable (GtkNotebook *notebook,
272 GtkWidget *child);
273GDK_AVAILABLE_IN_ALL
274void gtk_notebook_set_tab_reorderable (GtkNotebook *notebook,
275 GtkWidget *child,
276 gboolean reorderable);
277GDK_AVAILABLE_IN_ALL
278gboolean gtk_notebook_get_tab_detachable (GtkNotebook *notebook,
279 GtkWidget *child);
280GDK_AVAILABLE_IN_ALL
281void gtk_notebook_set_tab_detachable (GtkNotebook *notebook,
282 GtkWidget *child,
283 gboolean detachable);
284GDK_AVAILABLE_IN_3_16
285void gtk_notebook_detach_tab (GtkNotebook *notebook,
286 GtkWidget *child);
287
288GDK_AVAILABLE_IN_ALL
289GtkWidget* gtk_notebook_get_action_widget (GtkNotebook *notebook,
290 GtkPackType pack_type);
291GDK_AVAILABLE_IN_ALL
292void gtk_notebook_set_action_widget (GtkNotebook *notebook,
293 GtkWidget *widget,
294 GtkPackType pack_type);
295
296G_END_DECLS
297
298#endif /* __GTK_NOTEBOOK_H__ */
299

source code of include/gtk-3.0/gtk/gtknotebook.h