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
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.
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.
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/>.
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/.
26 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
27 #error "Only <gtk/gtk.h> can be included directly."
30 #ifndef __GTK_NOTEBOOK_H__
31 #define __GTK_NOTEBOOK_H__
34 #include <gtk/gtkcontainer.h>
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))
49 GTK_NOTEBOOK_TAB_FIRST,
53 typedef struct _GtkNotebook GtkNotebook;
54 typedef struct _GtkNotebookPrivate GtkNotebookPrivate;
55 typedef struct _GtkNotebookClass GtkNotebookClass;
60 GtkContainer container;
62 GtkNotebookPrivate *priv;
65 struct _GtkNotebookClass
67 GtkContainerClass parent_class;
69 void (* switch_page) (GtkNotebook *notebook,
73 /* Action signals for keybindings */
74 gboolean (* select_page) (GtkNotebook *notebook,
76 gboolean (* focus_tab) (GtkNotebook *notebook,
78 gboolean (* change_current_page) (GtkNotebook *notebook,
80 void (* move_focus_out) (GtkNotebook *notebook,
81 GtkDirectionType direction);
82 gboolean (* reorder_tab) (GtkNotebook *notebook,
83 GtkDirectionType direction,
84 gboolean move_to_last);
87 gint (* insert_page) (GtkNotebook *notebook,
90 GtkWidget *menu_label,
93 GtkNotebook * (* create_window) (GtkNotebook *notebook,
98 void (* page_reordered) (GtkNotebook *notebook,
102 void (* page_removed) (GtkNotebook *notebook,
106 void (* page_added) (GtkNotebook *notebook,
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);
121 /***********************************************************
122 * Creation, insertion, deletion *
123 ***********************************************************/
125 GType gtk_notebook_get_type (void) G_GNUC_CONST;
126 GtkWidget * gtk_notebook_new (void);
127 gint gtk_notebook_append_page (GtkNotebook *notebook,
129 GtkWidget *tab_label);
130 gint gtk_notebook_append_page_menu (GtkNotebook *notebook,
132 GtkWidget *tab_label,
133 GtkWidget *menu_label);
134 gint gtk_notebook_prepend_page (GtkNotebook *notebook,
136 GtkWidget *tab_label);
137 gint gtk_notebook_prepend_page_menu (GtkNotebook *notebook,
139 GtkWidget *tab_label,
140 GtkWidget *menu_label);
141 gint gtk_notebook_insert_page (GtkNotebook *notebook,
143 GtkWidget *tab_label,
145 gint gtk_notebook_insert_page_menu (GtkNotebook *notebook,
147 GtkWidget *tab_label,
148 GtkWidget *menu_label,
150 void gtk_notebook_remove_page (GtkNotebook *notebook,
153 /***********************************************************
154 * Tabs drag and drop *
155 ***********************************************************/
157 void gtk_notebook_set_group_name (GtkNotebook *notebook,
158 const gchar *group_name);
159 const gchar *gtk_notebook_get_group_name (GtkNotebook *notebook);
163 /***********************************************************
164 * query, set current NotebookPage *
165 ***********************************************************/
167 gint gtk_notebook_get_current_page (GtkNotebook *notebook);
168 GtkWidget* gtk_notebook_get_nth_page (GtkNotebook *notebook,
170 gint gtk_notebook_get_n_pages (GtkNotebook *notebook);
171 gint gtk_notebook_page_num (GtkNotebook *notebook,
173 void gtk_notebook_set_current_page (GtkNotebook *notebook,
175 void gtk_notebook_next_page (GtkNotebook *notebook);
176 void gtk_notebook_prev_page (GtkNotebook *notebook);
178 /***********************************************************
179 * set Notebook, NotebookTab style *
180 ***********************************************************/
182 void gtk_notebook_set_show_border (GtkNotebook *notebook,
183 gboolean show_border);
184 gboolean gtk_notebook_get_show_border (GtkNotebook *notebook);
185 void gtk_notebook_set_show_tabs (GtkNotebook *notebook,
187 gboolean gtk_notebook_get_show_tabs (GtkNotebook *notebook);
188 void gtk_notebook_set_tab_pos (GtkNotebook *notebook,
189 GtkPositionType pos);
190 GtkPositionType gtk_notebook_get_tab_pos (GtkNotebook *notebook);
191 void gtk_notebook_set_scrollable (GtkNotebook *notebook,
192 gboolean scrollable);
193 gboolean gtk_notebook_get_scrollable (GtkNotebook *notebook);
194 guint16 gtk_notebook_get_tab_hborder (GtkNotebook *notebook);
195 guint16 gtk_notebook_get_tab_vborder (GtkNotebook *notebook);
197 /***********************************************************
198 * enable/disable PopupMenu *
199 ***********************************************************/
201 void gtk_notebook_popup_enable (GtkNotebook *notebook);
202 void gtk_notebook_popup_disable (GtkNotebook *notebook);
204 /***********************************************************
205 * query/set NotebookPage Properties *
206 ***********************************************************/
208 GtkWidget * gtk_notebook_get_tab_label (GtkNotebook *notebook,
210 void gtk_notebook_set_tab_label (GtkNotebook *notebook,
212 GtkWidget *tab_label);
213 void gtk_notebook_set_tab_label_text (GtkNotebook *notebook,
215 const gchar *tab_text);
216 const gchar * gtk_notebook_get_tab_label_text (GtkNotebook *notebook,
218 GtkWidget * gtk_notebook_get_menu_label (GtkNotebook *notebook,
220 void gtk_notebook_set_menu_label (GtkNotebook *notebook,
222 GtkWidget *menu_label);
223 void gtk_notebook_set_menu_label_text (GtkNotebook *notebook,
225 const gchar *menu_text);
226 const gchar * gtk_notebook_get_menu_label_text (GtkNotebook *notebook,
228 void gtk_notebook_reorder_child (GtkNotebook *notebook,
231 gboolean gtk_notebook_get_tab_reorderable (GtkNotebook *notebook,
233 void gtk_notebook_set_tab_reorderable (GtkNotebook *notebook,
235 gboolean reorderable);
236 gboolean gtk_notebook_get_tab_detachable (GtkNotebook *notebook,
238 void gtk_notebook_set_tab_detachable (GtkNotebook *notebook,
240 gboolean detachable);
242 GtkWidget* gtk_notebook_get_action_widget (GtkNotebook *notebook,
243 GtkPackType pack_type);
244 void gtk_notebook_set_action_widget (GtkNotebook *notebook,
246 GtkPackType pack_type);
250 #endif /* __GTK_NOTEBOOK_H__ */