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, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
22 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
23 * file for a list of people on the GTK+ Team. See the ChangeLog
24 * files for a list of changes. These files are distributed with
25 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
28 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
29 #error "Only <gtk/gtk.h> can be included directly."
32 #ifndef __GTK_NOTEBOOK_H__
33 #define __GTK_NOTEBOOK_H__
36 #include <gtk/gtkcontainer.h>
41 #define GTK_TYPE_NOTEBOOK (gtk_notebook_get_type ())
42 #define GTK_NOTEBOOK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_NOTEBOOK, GtkNotebook))
43 #define GTK_NOTEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_NOTEBOOK, GtkNotebookClass))
44 #define GTK_IS_NOTEBOOK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_NOTEBOOK))
45 #define GTK_IS_NOTEBOOK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK))
46 #define GTK_NOTEBOOK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_NOTEBOOK, GtkNotebookClass))
51 GTK_NOTEBOOK_TAB_FIRST,
55 typedef struct _GtkNotebook GtkNotebook;
56 typedef struct _GtkNotebookPrivate GtkNotebookPrivate;
57 typedef struct _GtkNotebookClass GtkNotebookClass;
61 GtkContainer container;
64 GtkNotebookPrivate *priv;
67 struct _GtkNotebookClass
69 GtkContainerClass parent_class;
71 void (* switch_page) (GtkNotebook *notebook,
75 /* Action signals for keybindings */
76 gboolean (* select_page) (GtkNotebook *notebook,
78 gboolean (* focus_tab) (GtkNotebook *notebook,
80 gboolean (* change_current_page) (GtkNotebook *notebook,
82 void (* move_focus_out) (GtkNotebook *notebook,
83 GtkDirectionType direction);
84 gboolean (* reorder_tab) (GtkNotebook *notebook,
85 GtkDirectionType direction,
86 gboolean move_to_last);
89 gint (* insert_page) (GtkNotebook *notebook,
92 GtkWidget *menu_label,
95 GtkNotebook * (* create_window) (GtkNotebook *notebook,
100 void (*_gtk_reserved1) (void);
103 /***********************************************************
104 * Creation, insertion, deletion *
105 ***********************************************************/
107 GType gtk_notebook_get_type (void) G_GNUC_CONST;
108 GtkWidget * gtk_notebook_new (void);
109 gint gtk_notebook_append_page (GtkNotebook *notebook,
111 GtkWidget *tab_label);
112 gint gtk_notebook_append_page_menu (GtkNotebook *notebook,
114 GtkWidget *tab_label,
115 GtkWidget *menu_label);
116 gint gtk_notebook_prepend_page (GtkNotebook *notebook,
118 GtkWidget *tab_label);
119 gint gtk_notebook_prepend_page_menu (GtkNotebook *notebook,
121 GtkWidget *tab_label,
122 GtkWidget *menu_label);
123 gint gtk_notebook_insert_page (GtkNotebook *notebook,
125 GtkWidget *tab_label,
127 gint gtk_notebook_insert_page_menu (GtkNotebook *notebook,
129 GtkWidget *tab_label,
130 GtkWidget *menu_label,
132 void gtk_notebook_remove_page (GtkNotebook *notebook,
135 /***********************************************************
136 * Tabs drag and drop *
137 ***********************************************************/
139 void gtk_notebook_set_group (GtkNotebook *notebook,
141 gpointer gtk_notebook_get_group (GtkNotebook *notebook);
145 /***********************************************************
146 * query, set current NotebookPage *
147 ***********************************************************/
149 gint gtk_notebook_get_current_page (GtkNotebook *notebook);
150 GtkWidget* gtk_notebook_get_nth_page (GtkNotebook *notebook,
152 gint gtk_notebook_get_n_pages (GtkNotebook *notebook);
153 gint gtk_notebook_page_num (GtkNotebook *notebook,
155 void gtk_notebook_set_current_page (GtkNotebook *notebook,
157 void gtk_notebook_next_page (GtkNotebook *notebook);
158 void gtk_notebook_prev_page (GtkNotebook *notebook);
160 /***********************************************************
161 * set Notebook, NotebookTab style *
162 ***********************************************************/
164 void gtk_notebook_set_show_border (GtkNotebook *notebook,
165 gboolean show_border);
166 gboolean gtk_notebook_get_show_border (GtkNotebook *notebook);
167 void gtk_notebook_set_show_tabs (GtkNotebook *notebook,
169 gboolean gtk_notebook_get_show_tabs (GtkNotebook *notebook);
170 void gtk_notebook_set_tab_pos (GtkNotebook *notebook,
171 GtkPositionType pos);
172 GtkPositionType gtk_notebook_get_tab_pos (GtkNotebook *notebook);
173 void gtk_notebook_set_scrollable (GtkNotebook *notebook,
174 gboolean scrollable);
175 gboolean gtk_notebook_get_scrollable (GtkNotebook *notebook);
176 guint16 gtk_notebook_get_tab_hborder (GtkNotebook *notebook);
177 guint16 gtk_notebook_get_tab_vborder (GtkNotebook *notebook);
179 /***********************************************************
180 * enable/disable PopupMenu *
181 ***********************************************************/
183 void gtk_notebook_popup_enable (GtkNotebook *notebook);
184 void gtk_notebook_popup_disable (GtkNotebook *notebook);
186 /***********************************************************
187 * query/set NotebookPage Properties *
188 ***********************************************************/
190 GtkWidget * gtk_notebook_get_tab_label (GtkNotebook *notebook,
192 void gtk_notebook_set_tab_label (GtkNotebook *notebook,
194 GtkWidget *tab_label);
195 void gtk_notebook_set_tab_label_text (GtkNotebook *notebook,
197 const gchar *tab_text);
198 G_CONST_RETURN gchar *gtk_notebook_get_tab_label_text (GtkNotebook *notebook,
200 GtkWidget * gtk_notebook_get_menu_label (GtkNotebook *notebook,
202 void gtk_notebook_set_menu_label (GtkNotebook *notebook,
204 GtkWidget *menu_label);
205 void gtk_notebook_set_menu_label_text (GtkNotebook *notebook,
207 const gchar *menu_text);
208 G_CONST_RETURN gchar *gtk_notebook_get_menu_label_text (GtkNotebook *notebook,
210 void gtk_notebook_reorder_child (GtkNotebook *notebook,
213 gboolean gtk_notebook_get_tab_reorderable (GtkNotebook *notebook,
215 void gtk_notebook_set_tab_reorderable (GtkNotebook *notebook,
217 gboolean reorderable);
218 gboolean gtk_notebook_get_tab_detachable (GtkNotebook *notebook,
220 void gtk_notebook_set_tab_detachable (GtkNotebook *notebook,
222 gboolean detachable);
224 GtkWidget* gtk_notebook_get_action_widget (GtkNotebook *notebook,
225 GtkPackType pack_type);
226 void gtk_notebook_set_action_widget (GtkNotebook *notebook,
228 GtkPackType pack_type);
232 #endif /* __GTK_NOTEBOOK_H__ */