gtknotebook.h 11.1 KB
Newer Older
1
/* -*- Mode: C; c-file-style: "gnu"; tab-width: 8 -*- */
Cody Russell's avatar
Cody Russell committed
2
/* GTK - The GIMP Toolkit
Elliot Lee's avatar
Elliot Lee committed
3 4 5
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 *
 * This library is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU Lesser General Public
Elliot Lee's avatar
Elliot Lee committed
7 8 9 10 11 12
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 * Lesser General Public License for more details.
Elliot Lee's avatar
Elliot Lee committed
14
 *
15
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
16
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
Elliot Lee's avatar
Elliot Lee committed
17
 */
18 19

/*
20
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
21 22
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 * files for a list of changes.  These files are distributed with
23
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
24 25
 */

Elliot Lee's avatar
Elliot Lee committed
26 27 28 29
#ifndef __GTK_NOTEBOOK_H__
#define __GTK_NOTEBOOK_H__


30 31 32 33
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif

Elliot Lee's avatar
Elliot Lee committed
34 35
#include <gtk/gtkcontainer.h>

36

37
G_BEGIN_DECLS
Elliot Lee's avatar
Elliot Lee committed
38

39
#define GTK_TYPE_NOTEBOOK                  (gtk_notebook_get_type ())
Manish Singh's avatar
Manish Singh committed
40 41 42 43 44
#define GTK_NOTEBOOK(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_NOTEBOOK, GtkNotebook))
#define GTK_NOTEBOOK_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_NOTEBOOK, GtkNotebookClass))
#define GTK_IS_NOTEBOOK(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_NOTEBOOK))
#define GTK_IS_NOTEBOOK_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_NOTEBOOK))
#define GTK_NOTEBOOK_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_NOTEBOOK, GtkNotebookClass))
Tim Janik's avatar
Tim Janik committed
45

Elliot Lee's avatar
Elliot Lee committed
46

47 48 49 50 51 52
typedef enum
{
  GTK_NOTEBOOK_TAB_FIRST,
  GTK_NOTEBOOK_TAB_LAST
} GtkNotebookTab;

53 54 55
typedef struct _GtkNotebook              GtkNotebook;
typedef struct _GtkNotebookPrivate       GtkNotebookPrivate;
typedef struct _GtkNotebookClass         GtkNotebookClass;
Elliot Lee's avatar
Elliot Lee committed
56 57 58

struct _GtkNotebook
{
59
  /*< private >*/
Elliot Lee's avatar
Elliot Lee committed
60
  GtkContainer container;
61

62
  GtkNotebookPrivate *priv;
Elliot Lee's avatar
Elliot Lee committed
63 64 65 66 67
};

struct _GtkNotebookClass
{
  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 81
  void (* move_focus_out)      (GtkNotebook       *notebook,
				GtkDirectionType   direction);
82
  gboolean (* reorder_tab)     (GtkNotebook       *notebook,
83 84 85 86 87 88 89 90 91
				GtkDirectionType   direction,
				gboolean           move_to_last);

  /* More vfuncs */
  gint (* insert_page)         (GtkNotebook       *notebook,
			        GtkWidget         *child,
				GtkWidget         *tab_label,
				GtkWidget         *menu_label,
				gint               position);
92

93 94 95 96
  GtkNotebook * (* create_window) (GtkNotebook       *notebook,
                                   GtkWidget         *page,
                                   gint               x,
                                   gint               y);
97

98 99 100 101 102 103 104 105 106 107 108 109
  void (* page_reordered)      (GtkNotebook     *notebook,
                                GtkWidget       *child,
                                guint            page_num);

  void (* page_removed)        (GtkNotebook     *notebook,
                                GtkWidget       *child,
                                guint            page_num);

  void (* page_added)          (GtkNotebook     *notebook,
                                GtkWidget       *child,
                                guint            page_num);

110
  /* Padding for future expansion */
111
  void (*_gtk_reserved1) (void);
112 113 114 115 116 117 118
  void (*_gtk_reserved2) (void);
  void (*_gtk_reserved3) (void);
  void (*_gtk_reserved4) (void);
  void (*_gtk_reserved5) (void);
  void (*_gtk_reserved6) (void);
  void (*_gtk_reserved7) (void);
  void (*_gtk_reserved8) (void);
Elliot Lee's avatar
Elliot Lee committed
119 120
};

121 122 123 124
/***********************************************************
 *           Creation, insertion, deletion                 *
 ***********************************************************/

125
GDK_AVAILABLE_IN_ALL
Manish Singh's avatar
Manish Singh committed
126
GType   gtk_notebook_get_type       (void) G_GNUC_CONST;
127
GDK_AVAILABLE_IN_ALL
128
GtkWidget * gtk_notebook_new        (void);
129
GDK_AVAILABLE_IN_ALL
130
gint gtk_notebook_append_page       (GtkNotebook *notebook,
131 132
				     GtkWidget   *child,
				     GtkWidget   *tab_label);
133
GDK_AVAILABLE_IN_ALL
134
gint gtk_notebook_append_page_menu  (GtkNotebook *notebook,
135 136 137
				     GtkWidget   *child,
				     GtkWidget   *tab_label,
				     GtkWidget   *menu_label);
138
GDK_AVAILABLE_IN_ALL
139
gint gtk_notebook_prepend_page      (GtkNotebook *notebook,
140 141
				     GtkWidget   *child,
				     GtkWidget   *tab_label);
142
GDK_AVAILABLE_IN_ALL
143
gint gtk_notebook_prepend_page_menu (GtkNotebook *notebook,
144 145 146
				     GtkWidget   *child,
				     GtkWidget   *tab_label,
				     GtkWidget   *menu_label);
147
GDK_AVAILABLE_IN_ALL
148
gint gtk_notebook_insert_page       (GtkNotebook *notebook,
149 150 151
				     GtkWidget   *child,
				     GtkWidget   *tab_label,
				     gint         position);
152
GDK_AVAILABLE_IN_ALL
153
gint gtk_notebook_insert_page_menu  (GtkNotebook *notebook,
154 155 156 157
				     GtkWidget   *child,
				     GtkWidget   *tab_label,
				     GtkWidget   *menu_label,
				     gint         position);
158
GDK_AVAILABLE_IN_ALL
159 160 161
void gtk_notebook_remove_page       (GtkNotebook *notebook,
				     gint         page_num);

162 163 164 165
/***********************************************************
 *           Tabs drag and drop                            *
 ***********************************************************/

166
GDK_AVAILABLE_IN_ALL
167 168
void         gtk_notebook_set_group_name (GtkNotebook *notebook,
                                          const gchar *group_name);
169
GDK_AVAILABLE_IN_ALL
170
const gchar *gtk_notebook_get_group_name (GtkNotebook *notebook);
171 172 173



174
/***********************************************************
175
 *            query, set current NotebookPage              *
176 177
 ***********************************************************/

178
GDK_AVAILABLE_IN_ALL
179
gint       gtk_notebook_get_current_page (GtkNotebook *notebook);
180
GDK_AVAILABLE_IN_ALL
181 182
GtkWidget* gtk_notebook_get_nth_page     (GtkNotebook *notebook,
					  gint         page_num);
183
GDK_AVAILABLE_IN_ALL
184
gint       gtk_notebook_get_n_pages      (GtkNotebook *notebook);
185
GDK_AVAILABLE_IN_ALL
186 187
gint       gtk_notebook_page_num         (GtkNotebook *notebook,
					  GtkWidget   *child);
188
GDK_AVAILABLE_IN_ALL
189
void       gtk_notebook_set_current_page (GtkNotebook *notebook,
190
					  gint         page_num);
191
GDK_AVAILABLE_IN_ALL
192
void       gtk_notebook_next_page        (GtkNotebook *notebook);
193
GDK_AVAILABLE_IN_ALL
194
void       gtk_notebook_prev_page        (GtkNotebook *notebook);
195 196 197 198 199

/***********************************************************
 *            set Notebook, NotebookTab style              *
 ***********************************************************/

200
GDK_AVAILABLE_IN_ALL
201 202
void     gtk_notebook_set_show_border      (GtkNotebook     *notebook,
					    gboolean         show_border);
203
GDK_AVAILABLE_IN_ALL
204
gboolean gtk_notebook_get_show_border      (GtkNotebook     *notebook);
205
GDK_AVAILABLE_IN_ALL
206 207
void     gtk_notebook_set_show_tabs        (GtkNotebook     *notebook,
					    gboolean         show_tabs);
208
GDK_AVAILABLE_IN_ALL
209
gboolean gtk_notebook_get_show_tabs        (GtkNotebook     *notebook);
210
GDK_AVAILABLE_IN_ALL
211 212
void     gtk_notebook_set_tab_pos          (GtkNotebook     *notebook,
				            GtkPositionType  pos);
213
GDK_AVAILABLE_IN_ALL
214
GtkPositionType gtk_notebook_get_tab_pos   (GtkNotebook     *notebook);
215
GDK_AVAILABLE_IN_ALL
216 217
void     gtk_notebook_set_scrollable       (GtkNotebook     *notebook,
					    gboolean         scrollable);
218
GDK_AVAILABLE_IN_ALL
219
gboolean gtk_notebook_get_scrollable       (GtkNotebook     *notebook);
220
GDK_DEPRECATED_IN_3_4
221
guint16  gtk_notebook_get_tab_hborder      (GtkNotebook     *notebook);
222
GDK_DEPRECATED_IN_3_4
223
guint16  gtk_notebook_get_tab_vborder      (GtkNotebook     *notebook);
224 225 226 227 228

/***********************************************************
 *               enable/disable PopupMenu                  *
 ***********************************************************/

229
GDK_AVAILABLE_IN_ALL
230
void gtk_notebook_popup_enable  (GtkNotebook *notebook);
231
GDK_AVAILABLE_IN_ALL
232 233 234 235 236 237
void gtk_notebook_popup_disable (GtkNotebook *notebook);

/***********************************************************
 *             query/set NotebookPage Properties           *
 ***********************************************************/

238
GDK_AVAILABLE_IN_ALL
239
GtkWidget * gtk_notebook_get_tab_label    (GtkNotebook *notebook,
240
					   GtkWidget   *child);
241
GDK_AVAILABLE_IN_ALL
242 243 244
void gtk_notebook_set_tab_label           (GtkNotebook *notebook,
					   GtkWidget   *child,
					   GtkWidget   *tab_label);
245
GDK_AVAILABLE_IN_ALL
246 247 248
void          gtk_notebook_set_tab_label_text (GtkNotebook *notebook,
                                               GtkWidget   *child,
                                               const gchar *tab_text);
249
GDK_AVAILABLE_IN_ALL
250 251
const gchar * gtk_notebook_get_tab_label_text (GtkNotebook *notebook,
                                               GtkWidget   *child);
252
GDK_AVAILABLE_IN_ALL
253
GtkWidget * gtk_notebook_get_menu_label   (GtkNotebook *notebook,
254
					   GtkWidget   *child);
255
GDK_AVAILABLE_IN_ALL
256 257 258
void gtk_notebook_set_menu_label          (GtkNotebook *notebook,
					   GtkWidget   *child,
					   GtkWidget   *menu_label);
259
GDK_AVAILABLE_IN_ALL
260 261 262
void          gtk_notebook_set_menu_label_text (GtkNotebook *notebook,
                                                GtkWidget   *child,
                                                const gchar *menu_text);
263
GDK_AVAILABLE_IN_ALL
264
const gchar * gtk_notebook_get_menu_label_text (GtkNotebook *notebook,
265
							GtkWidget   *child);
266
GDK_AVAILABLE_IN_ALL
267 268 269
void gtk_notebook_reorder_child           (GtkNotebook *notebook,
					   GtkWidget   *child,
					   gint         position);
270
GDK_AVAILABLE_IN_ALL
271 272
gboolean gtk_notebook_get_tab_reorderable (GtkNotebook *notebook,
					   GtkWidget   *child);
273
GDK_AVAILABLE_IN_ALL
274 275 276
void gtk_notebook_set_tab_reorderable     (GtkNotebook *notebook,
					   GtkWidget   *child,
					   gboolean     reorderable);
277
GDK_AVAILABLE_IN_ALL
278 279
gboolean gtk_notebook_get_tab_detachable  (GtkNotebook *notebook,
					   GtkWidget   *child);
280
GDK_AVAILABLE_IN_ALL
281 282
void gtk_notebook_set_tab_detachable      (GtkNotebook *notebook,
					   GtkWidget   *child,
283
					   gboolean     detachable);
Elliot Lee's avatar
Elliot Lee committed
284

285
GDK_AVAILABLE_IN_ALL
286 287
GtkWidget* gtk_notebook_get_action_widget (GtkNotebook *notebook,
                                           GtkPackType  pack_type);
288
GDK_AVAILABLE_IN_ALL
289 290 291 292
void       gtk_notebook_set_action_widget (GtkNotebook *notebook,
                                           GtkWidget   *widget,
                                           GtkPackType  pack_type);

293
G_END_DECLS
Elliot Lee's avatar
Elliot Lee committed
294 295

#endif /* __GTK_NOTEBOOK_H__ */