/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */

#ifndef __KZ_NOTEBOOK_H__
#define __KZ_NOTEBOOK_H__

#include "kz-tab-label.h"
#include "kz-web.h"

G_BEGIN_DECLS

#define KZ_TYPE_NOTEBOOK		(kz_notebook_get_type ())
#define KZ_NOTEBOOK(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), KZ_TYPE_NOTEBOOK, KzNotebook))
#define KZ_NOTEBOOK_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass), KZ_TYPE_NOTEBOOK, KzNotebookClass))
#define KZ_IS_NOTEBOOK(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), KZ_TYPE_NOTEBOOK))
#define KZ_IS_NOTEBOOK_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((klass), KZ_TYPE_NOTEBOOK))
#define KZ_NOTEBOOK_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS ((obj), KZ_TYPE_NOTEBOOK, KzNotebookClass))

typedef struct _KzNotebook      KzNotebook;
typedef struct _KzNotebookClass KzNotebookClass;

struct _KzNotebook
{
	GtkNotebook parent;
};

struct _KzNotebookClass
{
	GtkNotebookClass parent_class;
};

typedef enum {
	KZ_NOTEBOOK_CLOSE_INACTIVE,
	KZ_NOTEBOOK_CLOSE_BACKWARD,
	KZ_NOTEBOOK_CLOSE_FORWARD
} KzNotebookCloseCondition;

GType       kz_notebook_get_type              (void) G_GNUC_CONST;
GtkWidget  *kz_notebook_new                   (KzWindow   *kz);
gint        kz_notebook_open_new_tab	      (KzNotebook *notebook,
					       KzWeb    *web,
					       KzTabLabel *label);
gint        kz_notebook_open_new_tab_with_parent
					      (KzNotebook *notebook,
					       KzWeb    *web,
					       KzTabLabel *label,
					       KzWeb    *parent);
gint        kz_notebook_open_new_tab_at_pos   (KzNotebook *notebook,
					       KzWeb    *web,
					       KzTabLabel *label,
					       gint pos);
gint        kz_notebook_prepend_new_tab	      (KzNotebook *notebook,
					       KzWeb    *web,
					       KzTabLabel *label);
gboolean    kz_notebook_close_tab	      (KzNotebook *notebook,
					       KzWeb    *web);
gboolean    kz_notebook_close_tabs	      (KzNotebook *notebook,
					       KzNotebookCloseCondition condition,
					       gint pos);
gboolean    kz_notebook_close_all_tab         (KzNotebook *notebook);
gboolean    kz_notebook_move_tab              (KzNotebook *src_notebook,
					       KzNotebook *dest_notebook,
					       GtkWidget  *widget);
void	    kz_notebook_next_tab	      (KzNotebook *notebook);
void	    kz_notebook_prev_tab	      (KzNotebook *notebook);
gboolean    kz_notebook_scroll_tab	      (KzNotebook *notebook,
					       GdkScrollDirection direction);
KzTabLabel *kz_notebook_get_tab_label         (KzNotebook *notebook,
					       KzWeb    *web);
KzTabLabel *kz_notebook_get_nth_tab_label     (KzNotebook *notebook,
					       gint        page_num);
KzWeb      *kz_notebook_get_nth_web           (KzNotebook *notebook,
					       gint        page_num);
gint        kz_notebook_page_num              (KzNotebook *notebook,
					       GtkWidget  *child);
gint	    kz_notebook_get_current_page      (KzNotebook *notebook);
void	    kz_notebook_set_current_page      (KzNotebook *notebook,
					       gint        page_num);
gint        kz_notebook_get_n_pages           (KzNotebook *notebook);
KzWeb      *kz_notebook_get_sibling_web       (KzNotebook *notebook,
					       KzWeb    *web);
KzTabLabel *kz_notebook_get_sibling_tab_label (KzNotebook *notebook,
					       KzTabLabel *label);
GtkWidget  *kz_notebook_get_dragged_page      (KzNotebook *notebook);
KzWeb      *kz_notebook_get_dragged_web       (KzNotebook *notebook);
GNode      *kz_notebook_get_tree              (KzNotebook *notebook);
void        kz_notebook_foreach_web           (KzNotebook *notebook,
					       GFunc       func,
					       gpointer    user_data);

G_END_DECLS

#endif /* __KZ_NOTEBOOK_H__ */
