]> Pileus Git - ~andy/gtk/blob - gtk/gtknotebook.h
GtkNotebook: Move public members to private structure
[~andy/gtk] / gtk / gtknotebook.h
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, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 /*
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/.
26  */
27
28 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
29 #error "Only <gtk/gtk.h> can be included directly."
30 #endif
31
32 #ifndef __GTK_NOTEBOOK_H__
33 #define __GTK_NOTEBOOK_H__
34
35
36 #include <gtk/gtkcontainer.h>
37
38
39 G_BEGIN_DECLS
40
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))
47
48
49 typedef enum
50 {
51   GTK_NOTEBOOK_TAB_FIRST,
52   GTK_NOTEBOOK_TAB_LAST
53 } GtkNotebookTab;
54
55 typedef struct _GtkNotebook       GtkNotebook;
56 typedef struct _GtkNotebookPriv   GtkNotebookPriv;
57 typedef struct _GtkNotebookClass  GtkNotebookClass;
58 #if !defined (GTK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
59 typedef struct _GtkNotebookPage   GtkNotebookPage;
60 #endif
61
62 struct _GtkNotebook
63 {
64   GtkContainer container;
65
66   /* <private> */
67   GtkNotebookPriv *priv;
68 };
69
70 struct _GtkNotebookClass
71 {
72   GtkContainerClass parent_class;
73
74   void (* switch_page)       (GtkNotebook     *notebook,
75                               GtkWidget       *page,
76                               guint            page_num);
77
78   /* Action signals for keybindings */
79   gboolean (* select_page)     (GtkNotebook       *notebook,
80                                 gboolean           move_focus);
81   gboolean (* focus_tab)       (GtkNotebook       *notebook,
82                                 GtkNotebookTab     type);
83   gboolean (* change_current_page) (GtkNotebook   *notebook,
84                                 gint               offset);
85   void (* move_focus_out)      (GtkNotebook       *notebook,
86                                 GtkDirectionType   direction);
87   gboolean (* reorder_tab)     (GtkNotebook       *notebook,
88                                 GtkDirectionType   direction,
89                                 gboolean           move_to_last);
90
91   /* More vfuncs */
92   gint (* insert_page)         (GtkNotebook       *notebook,
93                                 GtkWidget         *child,
94                                 GtkWidget         *tab_label,
95                                 GtkWidget         *menu_label,
96                                 gint               position);
97
98   GtkNotebook * (* create_window) (GtkNotebook       *notebook,
99                                    GtkWidget         *page,
100                                    gint               x,
101                                    gint               y);
102
103   void (*_gtk_reserved1) (void);
104 };
105
106 typedef GtkNotebook* (*GtkNotebookWindowCreationFunc) (GtkNotebook *source,
107                                                        GtkWidget   *page,
108                                                        gint         x,
109                                                        gint         y,
110                                                        gpointer     data);
111
112 /***********************************************************
113  *           Creation, insertion, deletion                 *
114  ***********************************************************/
115
116 GType   gtk_notebook_get_type       (void) G_GNUC_CONST;
117 GtkWidget * gtk_notebook_new        (void);
118 gint gtk_notebook_append_page       (GtkNotebook *notebook,
119                                      GtkWidget   *child,
120                                      GtkWidget   *tab_label);
121 gint gtk_notebook_append_page_menu  (GtkNotebook *notebook,
122                                      GtkWidget   *child,
123                                      GtkWidget   *tab_label,
124                                      GtkWidget   *menu_label);
125 gint gtk_notebook_prepend_page      (GtkNotebook *notebook,
126                                      GtkWidget   *child,
127                                      GtkWidget   *tab_label);
128 gint gtk_notebook_prepend_page_menu (GtkNotebook *notebook,
129                                      GtkWidget   *child,
130                                      GtkWidget   *tab_label,
131                                      GtkWidget   *menu_label);
132 gint gtk_notebook_insert_page       (GtkNotebook *notebook,
133                                      GtkWidget   *child,
134                                      GtkWidget   *tab_label,
135                                      gint         position);
136 gint gtk_notebook_insert_page_menu  (GtkNotebook *notebook,
137                                      GtkWidget   *child,
138                                      GtkWidget   *tab_label,
139                                      GtkWidget   *menu_label,
140                                      gint         position);
141 void gtk_notebook_remove_page       (GtkNotebook *notebook,
142                                      gint         page_num);
143
144 /***********************************************************
145  *           Tabs drag and drop                            *
146  ***********************************************************/
147
148 void gtk_notebook_set_window_creation_hook (GtkNotebookWindowCreationFunc  func,
149                                             gpointer                       data,
150                                             GDestroyNotify                 destroy);
151 void gtk_notebook_set_group                (GtkNotebook *notebook,
152                                             gpointer     group);
153 gpointer gtk_notebook_get_group            (GtkNotebook *notebook);
154
155
156
157 /***********************************************************
158  *            query, set current NotebookPage              *
159  ***********************************************************/
160
161 gint       gtk_notebook_get_current_page (GtkNotebook *notebook);
162 GtkWidget* gtk_notebook_get_nth_page     (GtkNotebook *notebook,
163                                           gint         page_num);
164 gint       gtk_notebook_get_n_pages      (GtkNotebook *notebook);
165 gint       gtk_notebook_page_num         (GtkNotebook *notebook,
166                                           GtkWidget   *child);
167 void       gtk_notebook_set_current_page (GtkNotebook *notebook,
168                                           gint         page_num);
169 void       gtk_notebook_next_page        (GtkNotebook *notebook);
170 void       gtk_notebook_prev_page        (GtkNotebook *notebook);
171
172 /***********************************************************
173  *            set Notebook, NotebookTab style              *
174  ***********************************************************/
175
176 void     gtk_notebook_set_show_border      (GtkNotebook     *notebook,
177                                             gboolean         show_border);
178 gboolean gtk_notebook_get_show_border      (GtkNotebook     *notebook);
179 void     gtk_notebook_set_show_tabs        (GtkNotebook     *notebook,
180                                             gboolean         show_tabs);
181 gboolean gtk_notebook_get_show_tabs        (GtkNotebook     *notebook);
182 void     gtk_notebook_set_tab_pos          (GtkNotebook     *notebook,
183                                             GtkPositionType  pos);
184 GtkPositionType gtk_notebook_get_tab_pos   (GtkNotebook     *notebook);
185 void     gtk_notebook_set_scrollable       (GtkNotebook     *notebook,
186                                             gboolean         scrollable);
187 gboolean gtk_notebook_get_scrollable       (GtkNotebook     *notebook);
188
189 /***********************************************************
190  *               enable/disable PopupMenu                  *
191  ***********************************************************/
192
193 void gtk_notebook_popup_enable  (GtkNotebook *notebook);
194 void gtk_notebook_popup_disable (GtkNotebook *notebook);
195
196 /***********************************************************
197  *             query/set NotebookPage Properties           *
198  ***********************************************************/
199
200 GtkWidget * gtk_notebook_get_tab_label    (GtkNotebook *notebook,
201                                            GtkWidget   *child);
202 void gtk_notebook_set_tab_label           (GtkNotebook *notebook,
203                                            GtkWidget   *child,
204                                            GtkWidget   *tab_label);
205 void gtk_notebook_set_tab_label_text      (GtkNotebook *notebook,
206                                            GtkWidget   *child,
207                                            const gchar *tab_text);
208 G_CONST_RETURN gchar *gtk_notebook_get_tab_label_text (GtkNotebook *notebook,
209                                                        GtkWidget   *child);
210 GtkWidget * gtk_notebook_get_menu_label   (GtkNotebook *notebook,
211                                            GtkWidget   *child);
212 void gtk_notebook_set_menu_label          (GtkNotebook *notebook,
213                                            GtkWidget   *child,
214                                            GtkWidget   *menu_label);
215 void gtk_notebook_set_menu_label_text     (GtkNotebook *notebook,
216                                            GtkWidget   *child,
217                                            const gchar *menu_text);
218 G_CONST_RETURN gchar *gtk_notebook_get_menu_label_text (GtkNotebook *notebook,
219                                                         GtkWidget   *child);
220 void gtk_notebook_reorder_child           (GtkNotebook *notebook,
221                                            GtkWidget   *child,
222                                            gint         position);
223 gboolean gtk_notebook_get_tab_reorderable (GtkNotebook *notebook,
224                                            GtkWidget   *child);
225 void gtk_notebook_set_tab_reorderable     (GtkNotebook *notebook,
226                                            GtkWidget   *child,
227                                            gboolean     reorderable);
228 gboolean gtk_notebook_get_tab_detachable  (GtkNotebook *notebook,
229                                            GtkWidget   *child);
230 void gtk_notebook_set_tab_detachable      (GtkNotebook *notebook,
231                                            GtkWidget   *child,
232                                            gboolean     detachable);
233
234 GtkWidget* gtk_notebook_get_action_widget (GtkNotebook *notebook,
235                                            GtkPackType  pack_type);
236 void       gtk_notebook_set_action_widget (GtkNotebook *notebook,
237                                            GtkWidget   *widget,
238                                            GtkPackType  pack_type);
239
240 G_END_DECLS
241
242 #endif /* __GTK_NOTEBOOK_H__ */