{-# LINE 2 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
-- -*-haskell-*-
-- GIMP Toolkit (GTK) Widget Notebook
--
-- Author : Axel Simon, Andy Stewart
--
-- Created: 15 May 2001
--
-- Copyright (C) 1999-2005 Axel Simon
-- Copyright (C) 2009 Andy Stewart
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 2.1 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
-- Lesser General Public License for more details.
--
-- TODO
--
-- Functions:
-- gtk_notebook_set_group
-- gtk_notebook_get_group
-- gtk_notebook_set_window_creation_hook
-- Attributes:
-- group
-- Signals:
-- focusTab
--
-- NOTE
--
-- Don't binding `group-id` attribute, even set/get_group_id functions is deprecated)
--
-- |
-- Maintainer : gtk2hs-users@lists.sourceforge.net
-- Stability : provisional
-- Portability : portable (depends on GHC)
--
-- A tabbed notebook container
--
module Graphics.UI.Gtk.Layout.Notebook (
-- * Detail
--
-- | The 'Notebook' widget is a 'Container' whose children are pages that can
-- be switched between using tab labels along one edge.
--
-- There are many configuration options for 'Notebook'. Among other things,
-- you can choose on which edge the tabs appear (see 'notebookSetTabPos'),
-- whether, if there are too many tabs to fit the noteobook should be made
-- bigger or scrolling arrows added (see 'notebookSetScrollable'), and
-- whether there will be a popup menu allowing the users to switch pages. (see
-- 'notebookEnablePopup')

-- * Class Hierarchy
-- |
-- @
-- | 'GObject'
-- | +----'Object'
-- | +----'Widget'
-- | +----'Container'
-- | +----Notebook
-- @

-- * Types
  Notebook,
  NotebookClass,
  NotebookPage,
  castToNotebook, gTypeNotebook,
  toNotebook,

-- * Constructors
  notebookNew,

-- * Methods
  notebookAppendPage,
  notebookAppendPageMenu,
  notebookPrependPage,
  notebookPrependPageMenu,
  notebookInsertPage,
  notebookInsertPageMenu,
  notebookRemovePage,
  notebookPageNum,
  notebookSetCurrentPage,
  notebookNextPage,
  notebookPrevPage,
  notebookReorderChild,
  PositionType(..),
  notebookSetTabPos,
  notebookGetTabPos,
  notebookSetShowTabs,
  notebookGetShowTabs,
  notebookSetShowBorder,
  notebookGetShowBorder,
  notebookSetScrollable,
  notebookGetScrollable,

  notebookSetTabBorder,
  notebookSetTabHBorder,
  notebookSetTabVBorder,

  notebookSetPopup,
  notebookGetCurrentPage,
  notebookSetMenuLabel,
  notebookGetMenuLabel,
  notebookSetMenuLabelText,
  notebookGetMenuLabelText,
  notebookGetNthPage,

  notebookGetNPages,

  notebookGetTabLabel,
  notebookGetTabLabelText,
  Packing(..), PackType(..),
  notebookQueryTabLabelPacking,
  notebookSetTabLabelPacking,

  notebookSetHomogeneousTabs,

  notebookSetTabLabel,
  notebookSetTabLabelText,

  notebookSetTabReorderable,
  notebookGetTabReorderable,
  notebookSetTabDetachable,
  notebookGetTabDetachable,


  notebookSetActionWidget,
  notebookGetActionWidget,


-- * Attributes
  notebookPage,
  notebookTabPos,
  notebookTabBorder,
  notebookTabHborder,
  notebookTabVborder,
  notebookShowTabs,
  notebookShowBorder,
  notebookScrollable,
  notebookEnablePopup,
  notebookHomogeneous,
  notebookCurrentPage,

-- * Child Attributes
  notebookChildTabLabel,
  notebookChildMenuLabel,
  notebookChildPosition,
  notebookChildTabPacking,
  notebookChildTabPackType,
  notebookChildDetachable,
  notebookChildReorderable,
  notebookChildTabExpand,
  notebookChildTabFill,

-- * Style Attributes

  notebookStyleArrowSpacing,

  notebookStyleHasBackwardStepper,
  notebookStyleHasForwardStepper,
  notebookStyleHasSecondaryBackwardStepper,
  notebookStyleHasSecondaryForwardStepper,

  notebookStyleTabCurvature,
  notebookStyleTabOverlap,


-- * Signals
  switchPage,
  pageAdded,
  pageRemoved,
  pageReordered,

-- * Deprecated

  onSwitchPage,
  afterSwitchPage

  ) where

import Control.Monad (liftM)
import Data.Maybe (maybe)

import System.Glib.FFI
import System.Glib.UTFString
import System.Glib.Attributes
import System.Glib.Properties
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.Types
{-# LINE 194 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
import Graphics.UI.Gtk.Signals
{-# LINE 195 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
import Graphics.UI.Gtk.Abstract.ContainerChildProperties
import Graphics.UI.Gtk.Display.Label (labelNew)
import Graphics.UI.Gtk.General.Enums (Packing(..), toPacking, fromPacking,
                                         PackType(..), PositionType(..), DirectionType(..))


{-# LINE 201 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}

newtype NotebookPage = NotebookPage (ForeignPtr (NotebookPage))
{-# LINE 203 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}

--------------------
-- Constructors

-- | Creates a new 'Notebook' widget with no pages.
--
notebookNew :: IO Notebook
notebookNew =
  makeNewObject mkNotebook $
  liftM (castPtr :: Ptr Widget -> Ptr Notebook) $
  gtk_notebook_new
{-# LINE 214 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}

--------------------
-- Methods


-- | Appends a page to @notebook@.
--
-- The given label will be used for the label widget of the new tab. In case
-- the context menu is enabled, this name will also appear in the popup menu.
-- If you want to specify something else to go in the tab, use
-- 'notebookAppendPageMenu'.
--
-- * This function returned @()@ in Gtk+ version 2.2.X and earlier
--
notebookAppendPage :: (NotebookClass self, WidgetClass child) => self
 -> child -- ^ @child@ - the 'Widget' to use as the contents of the page.
 -> String -- ^ @tabLabel@ - the label for the page
 -> IO Int -- ^ returns the index (starting from 0) of the appended page in
             -- the notebook, or -1 if function fails
notebookAppendPage self child tabLabel = do
  tab <- labelNew (Just tabLabel)
  liftM fromIntegral $
   (\(Notebook arg1) (Widget arg2) (Widget arg3) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg3 $ \argPtr3 ->gtk_notebook_append_page argPtr1 argPtr2 argPtr3)
{-# LINE 237 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
    (toWidget tab)
{-# LINE 264 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
-- | Appends a page to @notebook@, specifying the widget to use as the label
-- in the popup menu.
--
-- Like 'notebookAppendPage' but allows any widget to be used for the label of
-- the new tab and the entry in the page-switch popup menu.
--
-- * This function returned @()@ in Gtk version 2.2.X and earlier
--
notebookAppendPageMenu :: (NotebookClass self, WidgetClass child,
  WidgetClass tabLabel, WidgetClass menuLabel) => self
 -> child -- ^ @child@ - the 'Widget' to use as the contents of the page.
 -> tabLabel -- ^ @tabLabel@ - the 'Widget' to be used as the label for the
              -- page (usually a 'Label' widget).
 -> menuLabel -- ^ @menuLabel@ - the widget to use as a label for the
              -- page-switch menu, if that is enabled (usually a 'Label'
              -- widget).
 -> IO Int -- ^ returns the index (starting from 0) of the appended page in
              -- the notebook, or -1 if function fails
notebookAppendPageMenu self child tabLabel menuLabel =
  liftM fromIntegral $
  (\(Notebook arg1) (Widget arg2) (Widget arg3) (Widget arg4) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg3 $ \argPtr3 ->withForeignPtr arg4 $ \argPtr4 ->gtk_notebook_append_page_menu argPtr1 argPtr2 argPtr3 argPtr4)
{-# LINE 285 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
    (toWidget tabLabel)
    (toWidget menuLabel)
{-# LINE 317 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
-- | Prepends a page to @notebook@.
--
-- * The given label will be used for the label widget of the new tab. In case
-- the context menu is enabled, this name will also appear in the popup menu. If
-- you want to specify something else to go in the tab, use
-- 'notebookPrependPageMenu'.
--
-- * This function returned @()@ in Gtk version 2.2.X and earlier
--
notebookPrependPage :: (NotebookClass self, WidgetClass child) => self
 -> child -- ^ @child@ - the 'Widget' to use as the contents of the page.
 -> String -- ^ @tabLabel@ - the label for the page
 -> IO Int -- ^ returns the index (starting from 0) of the prepended page in
             -- the notebook, or -1 if function fails
notebookPrependPage self child tabLabel = do
  tab <- labelNew (Just tabLabel)
  liftM fromIntegral $
   (\(Notebook arg1) (Widget arg2) (Widget arg3) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg3 $ \argPtr3 ->gtk_notebook_prepend_page argPtr1 argPtr2 argPtr3)
{-# LINE 335 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
    (toWidget tab)
{-# LINE 362 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
-- | Prepends a page to @notebook@, specifying the widget to use as the label
-- in the popup menu.
--
-- Like 'notebookPrependPage' but allows any widget to be used for the label of
-- the new tab and then entry in the page-switch popup menu.
--
-- * This function returned @()@ in Gtk version 2.2.X and earlier
--
notebookPrependPageMenu :: (NotebookClass self, WidgetClass child,
 WidgetClass tabLabel, WidgetClass menuLabel) => self
 -> child -- ^ @child@ - the 'Widget' to use as the contents of the page.
 -> tabLabel -- ^ @tabLabel@ - the 'Widget' to be used as the label for the
              -- page (usually a 'Label' widget).
 -> menuLabel -- ^ @menuLabel@ - the widget to use as a label for the
              -- page-switch menu, if that is enabled (usually a 'Label'
              -- widget).
 -> IO Int -- ^ returns the index (starting from 0) of the prepended page
              -- in the notebook, or -1 if function fails
notebookPrependPageMenu self child tabLabel menuLabel =
  liftM fromIntegral $
  (\(Notebook arg1) (Widget arg2) (Widget arg3) (Widget arg4) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg3 $ \argPtr3 ->withForeignPtr arg4 $ \argPtr4 ->gtk_notebook_prepend_page_menu argPtr1 argPtr2 argPtr3 argPtr4)
{-# LINE 383 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
    (toWidget tabLabel)
    (toWidget menuLabel)
{-# LINE 414 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
-- | Insert a page into @notebook@ at the given position.
--
-- * The given label will be used for the label widget of the new tab. In case
-- the context menu is enabled, this name will also appear in the popup menu. If
-- you want to specify something else to go in the tab, use
-- 'notebookInsertPageMenu'.
--
-- * This function returned @()@ in Gtk version 2.2.X and earlier
--
notebookInsertPage :: (NotebookClass self, WidgetClass child) => self
 -> child -- ^ @child@ - the 'Widget' to use as the contents of the page.
 -> String -- ^ @tabLabel@ - the label for the page
 -> Int -- ^ @position@ - the index (starting at 0) at which to insert
             -- the page, or -1 to append the page after all other pages.
 -> IO Int -- ^ returns the index (starting from 0) of the inserted page in
             -- the notebook, or -1 if function fails
notebookInsertPage self child tabLabel position = do
  tab <- labelNew (Just tabLabel)
  liftM fromIntegral $
   (\(Notebook arg1) (Widget arg2) (Widget arg3) arg4 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg3 $ \argPtr3 ->gtk_notebook_insert_page argPtr1 argPtr2 argPtr3 arg4)
{-# LINE 434 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
    (toWidget tab)
    (fromIntegral position)
{-# LINE 465 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
-- | Insert a page into @notebook@ at the given position, specifying the
-- widget to use as the label in the popup menu.
--
-- Like 'notebookInsertPage' but allows any widget to be used for the label of
-- the new tab and then entry in the page-switch popup menu.
--
-- * This function returned @()@ in Gtk version 2.2.X and earlier
--
notebookInsertPageMenu :: (NotebookClass self, WidgetClass child,
 WidgetClass tabLabel, WidgetClass menuLabel) => self
 -> child -- ^ @child@ - the 'Widget' to use as the contents of the page.
 -> tabLabel -- ^ @tabLabel@ - the 'Widget' to be used as the label for the
              -- page (usually a 'Label' widget).
 -> menuLabel -- ^ @menuLabel@ - the widget to use as a label for the
              -- page-switch menu, if that is enabled (usually a 'Label'
              -- widget).
 -> Int -- ^ @position@ - the index (starting at 0) at which to insert
              -- the page, or -1 to append the page after all other pages.
 -> IO Int -- ^ returns the index (starting from 0) of the inserted page in
              -- the notebook, or -1 if function fails
notebookInsertPageMenu self child tabLabel menuLabel position =
  liftM fromIntegral $
  (\(Notebook arg1) (Widget arg2) (Widget arg3) (Widget arg4) arg5 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg3 $ \argPtr3 ->withForeignPtr arg4 $ \argPtr4 ->gtk_notebook_insert_page_menu argPtr1 argPtr2 argPtr3 argPtr4 arg5)
{-# LINE 488 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
    (toWidget tabLabel)
    (toWidget menuLabel)
    (fromIntegral position)
{-# LINE 518 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
-- | Removes a page from the notebook given its index in the notebook.
--
notebookRemovePage :: NotebookClass self => self
 -> Int -- ^ @pageNum@ - the index of a notebook page, starting from 0. If
          -- -1, the last page will be removed.
 -> IO ()
notebookRemovePage self pageNum =
  (\(Notebook arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_remove_page argPtr1 arg2)
{-# LINE 526 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (fromIntegral pageNum)

-- | Query the page the child widget is contained in.
--
-- * The function returns the page number if the child was found, Nothing
-- otherwise.
--
notebookPageNum :: (NotebookClass self, WidgetClass w) => self
 -> w
 -> IO (Maybe Int)
notebookPageNum nb child =
  liftM (\page -> if page==(-1) then Nothing else Just (fromIntegral page)) $
  (\(Notebook arg1) (Widget arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_notebook_page_num argPtr1 argPtr2)
{-# LINE 540 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook nb)
    (toWidget child)

-- | Switches to the page number @pageNum@. Page numbers start from @0@.
-- Use @-1@ to request the last page.
--
-- * Note that due to historical reasons, GtkNotebook refuses
-- to switch to a page unless the child widget is visible.
-- Therefore, it is recommended to show child widgets before
-- adding them to a notebook.
--
notebookSetCurrentPage :: NotebookClass self => self
 -> Int -- ^ @pageNum@ - index of the page to switch to, starting from 0. If
          -- negative, the last page will be used. If greater than the number
          -- of pages in the notebook, nothing will be done.
 -> IO ()
notebookSetCurrentPage self pageNum =
  (\(Notebook arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_set_current_page argPtr1 arg2)
{-# LINE 558 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (fromIntegral pageNum)

-- | Switches to the next page. Nothing happens if the current page is the
-- last page.
--
notebookNextPage :: NotebookClass self => self -> IO ()
notebookNextPage self =
  (\(Notebook arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_next_page argPtr1)
{-# LINE 567 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)

-- | Switches to the previous page. Nothing happens if the current page is the
-- first page.
--
notebookPrevPage :: NotebookClass self => self -> IO ()
notebookPrevPage self =
  (\(Notebook arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_prev_page argPtr1)
{-# LINE 575 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)

-- | Reorders the page containing @child@, so that it appears in position
-- @position@. If @position@ is greater than or equal to the number of children
-- in the list or negative, @child@ will be moved to the end of the list.
--
notebookReorderChild :: (NotebookClass self, WidgetClass child) => self
 -> child -- ^ @child@ - the child to move
 -> Int -- ^ @position@ - the new position, or -1 to move to the end
 -> IO ()
notebookReorderChild self child position =
  (\(Notebook arg1) (Widget arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_notebook_reorder_child argPtr1 argPtr2 arg3)
{-# LINE 587 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
    (fromIntegral position)

-- | Sets the edge at which the tabs for switching pages in the notebook are
-- drawn.
--
notebookSetTabPos :: NotebookClass self => self
 -> PositionType -- ^ @pos@ - the edge to draw the tabs at.
 -> IO ()
notebookSetTabPos self pos =
  (\(Notebook arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_set_tab_pos argPtr1 arg2)
{-# LINE 599 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    ((fromIntegral . fromEnum) pos)

-- | Gets the edge at which the tabs for switching pages in the notebook are
-- drawn.
--
notebookGetTabPos :: NotebookClass self => self
 -> IO PositionType -- ^ returns the edge at which the tabs are drawn
notebookGetTabPos self =
  liftM (toEnum . fromIntegral) $
  (\(Notebook arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_get_tab_pos argPtr1)
{-# LINE 610 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)

-- | Sets whether to show the tabs for the notebook or not.
--
notebookSetShowTabs :: NotebookClass self => self
 -> Bool -- ^ @showTabs@ - @True@ if the tabs should be shown.
 -> IO ()
notebookSetShowTabs self showTabs =
  (\(Notebook arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_set_show_tabs argPtr1 arg2)
{-# LINE 619 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (fromBool showTabs)

-- | Returns whether the tabs of the notebook are shown. See
-- 'notebookSetShowTabs'.
--
notebookGetShowTabs :: NotebookClass self => self
 -> IO Bool -- ^ returns @True@ if the tabs are shown
notebookGetShowTabs self =
  liftM toBool $
  (\(Notebook arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_get_show_tabs argPtr1)
{-# LINE 630 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)

-- | Sets whether a bevel will be drawn around the notebook pages. This only
-- has a visual effect when the tabs are not shown. See 'notebookSetShowTabs'.
--
notebookSetShowBorder :: NotebookClass self => self
 -> Bool -- ^ @showBorder@ - @True@ if a bevel should be drawn around the
          -- notebook.
 -> IO ()
notebookSetShowBorder self showBorder =
  (\(Notebook arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_set_show_border argPtr1 arg2)
{-# LINE 641 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (fromBool showBorder)

-- | Returns whether a bevel will be drawn around the notebook pages. See
-- 'notebookSetShowBorder'.
--
notebookGetShowBorder :: NotebookClass self => self
 -> IO Bool -- ^ returns @True@ if the bevel is drawn
notebookGetShowBorder self =
  liftM toBool $
  (\(Notebook arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_get_show_border argPtr1)
{-# LINE 652 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)

-- | Sets whether the tab label area will have arrows for scrolling if there
-- are too many tabs to fit in the area.
--
notebookSetScrollable :: NotebookClass self => self
 -> Bool -- ^ @scrollable@ - @True@ if scroll arrows should be added
 -> IO ()
notebookSetScrollable self scrollable =
  (\(Notebook arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_set_scrollable argPtr1 arg2)
{-# LINE 662 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (fromBool scrollable)

-- | Returns whether the tab label area has arrows for scrolling. See
-- 'notebookSetScrollable'.
--
notebookGetScrollable :: NotebookClass self => self
 -> IO Bool -- ^ returns @True@ if arrows for scrolling are present
notebookGetScrollable self =
  liftM toBool $
  (\(Notebook arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_get_scrollable argPtr1)
{-# LINE 673 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)


-- | Sets the width the border around the tab labels in a notebook. This is
-- equivalent to calling @'notebookSetTabHBorder' notebook borderWidth@
-- followed by @'notebookSetTabVBorder' notebook borderWidth@.
--
-- * Warning: this function is deprecated and should not be used in
-- newly-written code.
--
notebookSetTabBorder :: NotebookClass self => self
 -> Int -- ^ @borderWidth@ - width of the border around the tab labels.
 -> IO ()
notebookSetTabBorder self borderWidth =
  (\(Notebook arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_set_tab_border argPtr1 arg2)
{-# LINE 688 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (fromIntegral borderWidth)

-- | Sets the width of the horizontal border of tab labels.
--
-- * Warning: this function is deprecated and should not be used in
-- newly-written code.
--
notebookSetTabHBorder :: NotebookClass self => self
 -> Int -- ^ @tabHborder@ - width of the horizontal border of tab labels.
 -> IO ()
notebookSetTabHBorder self tabHborder =
  (\(Notebook arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_set_tab_hborder argPtr1 arg2)
{-# LINE 701 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (fromIntegral tabHborder)

-- | Sets the width of the vertical border of tab labels.
--
-- * Warning: this function is deprecated and should not be used in
-- newly-written code.
--
notebookSetTabVBorder :: NotebookClass self => self
 -> Int -- ^ @tabVborder@ - width of the vertical border of tab labels.
 -> IO ()
notebookSetTabVBorder self tabVborder =
  (\(Notebook arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_set_tab_vborder argPtr1 arg2)
{-# LINE 714 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (fromIntegral tabVborder)


-- | Enables or disables the popup menu: if the user clicks with the right
-- mouse button on the bookmarks, a menu with all the pages will be popped up.
--
notebookSetPopup :: NotebookClass self => self -> Bool -> IO ()
notebookSetPopup self enable =
  (if enable
     then (\(Notebook arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_popup_enable argPtr1)
{-# LINE 725 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
     else (\(Notebook arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_popup_disable argPtr1))
    (toNotebook self)

-- | Returns the page number of the current page.
--
notebookGetCurrentPage :: NotebookClass self => self
 -> IO Int -- ^ returns the index (starting from 0) of the current page in the
           -- notebook. If the notebook has no pages, then -1 will be returned.
notebookGetCurrentPage self =
  liftM fromIntegral $
  (\(Notebook arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_get_current_page argPtr1)
{-# LINE 736 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)

-- | Changes the menu label for the page containing @child@.
--
notebookSetMenuLabel :: (NotebookClass self, WidgetClass child, WidgetClass menuLabel) => self
 -> child -- ^ @child@ - the child widget
 -> Maybe menuLabel -- ^ @menuLabel@ - the menu label, or @Nothing@ for
                    -- default
 -> IO ()
notebookSetMenuLabel self child menuLabel =
  (\(Notebook arg1) (Widget arg2) (Widget arg3) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg3 $ \argPtr3 ->gtk_notebook_set_menu_label argPtr1 argPtr2 argPtr3)
{-# LINE 747 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
    (maybe (Widget nullForeignPtr) toWidget menuLabel)

-- | Retrieves the menu label widget of the page containing @child@.
--
notebookGetMenuLabel :: (NotebookClass self, WidgetClass child) => self
 -> child -- ^ @child@ - a widget contained in a page of
                      -- @notebook@
 -> IO (Maybe Widget) -- ^ returns the menu label, or @Nothing@ if the
                      -- notebook page does not have a menu label other than
                      -- the default (the tab label).
notebookGetMenuLabel self child =
  maybeNull (makeNewObject mkWidget) $
  (\(Notebook arg1) (Widget arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_notebook_get_menu_label argPtr1 argPtr2)
{-# LINE 762 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)

-- | Creates a new label and sets it as the menu label of @child@.
--
notebookSetMenuLabelText :: (NotebookClass self, WidgetClass child) => self
 -> child -- ^ @child@ - the child widget
 -> String -- ^ @menuText@ - the label text
 -> IO ()
notebookSetMenuLabelText self child menuText =
  withUTFString menuText $ \menuTextPtr ->
  (\(Notebook arg1) (Widget arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_notebook_set_menu_label_text argPtr1 argPtr2 arg3)
{-# LINE 774 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
    menuTextPtr

-- | Retrieves the text of the menu label for the page containing @child@.
--
notebookGetMenuLabelText :: (NotebookClass self, WidgetClass child) => self
 -> child -- ^ @child@ - the child widget of a page of the
                      -- notebook.
 -> IO (Maybe String) -- ^ returns value: the text of the tab label, or
                      -- @Nothing@ if the widget does not have a menu label
                      -- other than the default menu label, or the menu label
                      -- widget is not a 'Label'.
notebookGetMenuLabelText self child =
  (\(Notebook arg1) (Widget arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_notebook_get_menu_label_text argPtr1 argPtr2)
{-# LINE 789 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
  >>= maybePeek peekUTFString

-- | Returns the child widget contained in page number @pageNum@.
--
notebookGetNthPage :: NotebookClass self => self
 -> Int -- ^ @pageNum@ - the index of a page in the noteobok, or
                      -- -1 to get the last page.
 -> IO (Maybe Widget) -- ^ returns the child widget, or @Nothing@ if @pageNum@
                      -- is out of bounds.
notebookGetNthPage self pageNum =
  maybeNull (makeNewObject mkWidget) $
  (\(Notebook arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_get_nth_page argPtr1 arg2)
{-# LINE 803 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (fromIntegral pageNum)


-- | Gets the number of pages in a notebook.
--
-- * Available since Gtk version 2.2
--
notebookGetNPages :: NotebookClass self => self -> IO Int
notebookGetNPages self =
  liftM fromIntegral $
  (\(Notebook arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_get_n_pages argPtr1)
{-# LINE 815 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)


-- | Returns the tab label widget for the page @child@. @Nothing@ is returned
-- if @child@ is not in @notebook@ or if no tab label has specifically been set
-- for @child@.
--
notebookGetTabLabel :: (NotebookClass self, WidgetClass child) => self
 -> child -- ^ @child@ - the page
 -> IO (Maybe Widget) -- ^ returns the tab label
notebookGetTabLabel self child =
  maybeNull (makeNewObject mkWidget) $
  (\(Notebook arg1) (Widget arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_notebook_get_tab_label argPtr1 argPtr2)
{-# LINE 828 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)

-- | Retrieves the text of the tab label for the page containing @child@.
--
notebookGetTabLabelText :: (NotebookClass self, WidgetClass child) => self
 -> child -- ^ @child@ - a widget contained in a page of
                      -- @notebook@
 -> IO (Maybe String) -- ^ returns value: the text of the tab label, or
                      -- @Nothing@ if the tab label widget is not a 'Label'.
notebookGetTabLabelText self child =
  (\(Notebook arg1) (Widget arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_notebook_get_tab_label_text argPtr1 argPtr2)
{-# LINE 840 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
  >>= maybePeek peekUTFString

-- | Query the packing attributes for the tab label of the page containing
-- @child@.
--
notebookQueryTabLabelPacking :: (NotebookClass self, WidgetClass child) => self
 -> child -- ^ @child@ - the page
 -> IO (Packing,PackType)
notebookQueryTabLabelPacking self child =
  alloca $ \expPtr ->
  alloca $ \fillPtr ->
  alloca $ \packPtr -> do
  (\(Notebook arg1) (Widget arg2) arg3 arg4 arg5 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_notebook_query_tab_label_packing argPtr1 argPtr2 arg3 arg4 arg5)
{-# LINE 855 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
    expPtr
    fillPtr
    packPtr
  expand <- liftM toBool $ peek expPtr
  fill <- liftM toBool $ peek fillPtr
  pt <- liftM (toEnum . fromIntegral) $ peek packPtr
  return (toPacking expand fill, pt)

-- | Sets the packing parameters for the tab label of the page containing
-- @child@. See 'Graphics.UI.Gtk.Abstract.Box.boxPackStart' for the exact
-- meaning of the parameters.
--
notebookSetTabLabelPacking :: (NotebookClass self, WidgetClass child) => self
 -> child -- ^ @child@ - the child widget
 -> Packing
 -> PackType -- ^ @packType@ - the position of the bookmark
 -> IO ()
notebookSetTabLabelPacking self child pack packType =
  (\(Notebook arg1) (Widget arg2) arg3 arg4 arg5 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_notebook_set_tab_label_packing argPtr1 argPtr2 arg3 arg4 arg5)
{-# LINE 876 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
    (fromBool expand)
    (fromBool fill)
    ((fromIntegral . fromEnum) packType)
  where (expand, fill) = fromPacking pack


-- | Sets whether the tabs must have all the same size or not.
--
-- * Warning: this function is deprecated and should not be used in
-- newly-written code.
--
notebookSetHomogeneousTabs :: NotebookClass self => self
 -> Bool -- ^ @homogeneous@ - @True@ if all tabs should be the same size.
 -> IO ()
notebookSetHomogeneousTabs self homogeneous =
  (\(Notebook arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_set_homogeneous_tabs argPtr1 arg2)
{-# LINE 894 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (fromBool homogeneous)


-- | Changes the tab label for @child@.
--
notebookSetTabLabel :: (NotebookClass self, WidgetClass child, WidgetClass tabLabel) => self
 -> child -- ^ @child@ - the page
 -> tabLabel -- ^ @tabLabel@ - the tab label widget to use
 -> IO ()
notebookSetTabLabel self child tabLabel =
  (\(Notebook arg1) (Widget arg2) (Widget arg3) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->withForeignPtr arg3 $ \argPtr3 ->gtk_notebook_set_tab_label argPtr1 argPtr2 argPtr3)
{-# LINE 906 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
    (toWidget tabLabel)

-- | Creates a new label and sets it as the tab label for the page containing
-- @child@.
--
notebookSetTabLabelText :: (NotebookClass self, WidgetClass child) => self
 -> child -- ^ @child@ - the page
 -> String -- ^ @tabText@ - the label text
 -> IO ()
notebookSetTabLabelText self child tabText =
  withUTFString tabText $ \tabTextPtr ->
  (\(Notebook arg1) (Widget arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_notebook_set_tab_label_text argPtr1 argPtr2 arg3)
{-# LINE 920 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
    tabTextPtr


-- | Sets whether the notebook tab can be reordered via drag and drop or not.
--
-- * Available since Gtk version 2.10
--
notebookSetTabReorderable :: (NotebookClass self, WidgetClass child) => self
 -> child -- ^ @child@ - a child page
 -> Bool -- ^ @reorderable@ - whether the tab is reorderable or not.
 -> IO ()
notebookSetTabReorderable self child reorderable =
  (\(Notebook arg1) (Widget arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_notebook_set_tab_reorderable argPtr1 argPtr2 arg3)
{-# LINE 935 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
    (fromBool reorderable)

-- | Gets whether the tab can be reordered via drag and drop or not.
--
-- * Available since Gtk version 2.10
--
notebookGetTabReorderable :: (NotebookClass self, WidgetClass child) => self
 -> child -- ^ @child@ - the child page
 -> IO Bool -- ^ return @True@ if the tab is reorderable.
notebookGetTabReorderable self child = liftM toBool $
  (\(Notebook arg1) (Widget arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_notebook_get_tab_reorderable argPtr1 argPtr2)
{-# LINE 948 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)

-- | Sets whether the tab can be detached from notebook to another notebook or widget.
--
-- Note that 2 notebooks must share a common group identificator (see gtk_notebook_set_group_id()) to allow automatic tabs interchange between them.
--
-- If you want a widget to interact with a notebook through DnD (i.e.: accept dragged tabs from it) it must be set as a drop destination and accept the target "GTK_NOTEBOOK_TAB".
-- The notebook will fill the selection with a GtkWidget** pointing to the child widget that corresponds to the dropped tab.
--
-- If you want a notebook to accept drags from other widgets, you will have to set your own DnD code to do it.
--
-- * Available since Gtk version 2.10
--
notebookSetTabDetachable :: (NotebookClass self, WidgetClass child) => self
 -> child -- ^ @child@ - the child page
 -> Bool -- ^ @detachable@ - whether the tab is detachable or not
 -> IO ()
notebookSetTabDetachable self child detachable =
  (\(Notebook arg1) (Widget arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_notebook_set_tab_detachable argPtr1 argPtr2 arg3)
{-# LINE 968 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)
    (fromBool detachable)

-- | Returns whether the tab contents can be detached from notebook.
--
-- * Available since Gtk version 2.10
--
notebookGetTabDetachable :: (NotebookClass self, WidgetClass child) => self
 -> child -- ^ @child@ - the child page
 -> IO Bool -- ^ return @True@ if the tab is detachable.
notebookGetTabDetachable self child = liftM toBool $
  (\(Notebook arg1) (Widget arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_notebook_get_tab_detachable argPtr1 argPtr2)
{-# LINE 981 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget child)



-- | Sets widget as one of the action widgets. Depending on the pack type the widget will be placed
-- before or after the tabs. You can use a 'Box' if you need to pack more than one widget on the same
-- side.
--
-- Note that action widgets are "internal" children of the notebook and thus not included in the list
-- returned from 'containerForeach'.
--
-- * Available since Gtk version 2.20
--
notebookSetActionWidget :: (NotebookClass self, WidgetClass widget) => self
                        -> widget
                        -> PackType -- ^ @packType@ pack type of the action widget
                        -> IO ()
notebookSetActionWidget self widget packType =
  (\(Notebook arg1) (Widget arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_notebook_set_action_widget argPtr1 argPtr2 arg3)
{-# LINE 1001 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
    (toNotebook self)
    (toWidget widget)
    ((fromIntegral . fromEnum) packType)

-- | Gets one of the action widgets. See 'notebookSetActionWidget'.
--
-- * Available since Gtk version 2.20
--
notebookGetActionWidget :: NotebookClass self => self
                        -> PackType -- ^ @packType@ pack type of the action widget to receive
                        -> IO (Maybe Widget)
notebookGetActionWidget self packType =
    maybeNull (makeNewObject mkWidget) $
    (\(Notebook arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_notebook_get_action_widget argPtr1 arg2)
{-# LINE 1015 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}
      (toNotebook self)
      ((fromIntegral . fromEnum) packType)


--------------------
-- Attributes

-- | The index of the current page.
--
-- Allowed values: >= 0
--
-- Default value: 0
--
notebookPage :: NotebookClass self => Attr self Int
notebookPage = newAttrFromIntProperty "page"

-- | Which side of the notebook holds the tabs.
--
-- Default value: 'PosTop'
--
notebookTabPos :: NotebookClass self => Attr self PositionType
notebookTabPos = newAttr
  notebookGetTabPos
  notebookSetTabPos

-- | Width of the border around the tab labels.
--
-- Default value: 2
--
notebookTabBorder :: NotebookClass self => WriteAttr self Int
notebookTabBorder = writeAttrFromUIntProperty "tab-border"

-- | Width of the horizontal border of tab labels.
--
-- Default value: 2
--
notebookTabHborder :: NotebookClass self => Attr self Int
notebookTabHborder = newAttrFromUIntProperty "tab-hborder"

-- | Width of the vertical border of tab labels.
--
-- Default value: 2
--
notebookTabVborder :: NotebookClass self => Attr self Int
notebookTabVborder = newAttrFromUIntProperty "tab-vborder"

-- | Whether tabs should be shown or not.
--
-- Default value: @True@
--
notebookShowTabs :: NotebookClass self => Attr self Bool
notebookShowTabs = newAttr
  notebookGetShowTabs
  notebookSetShowTabs

-- | Whether the border should be shown or not.
--
-- Default value: @True@
--
notebookShowBorder :: NotebookClass self => Attr self Bool
notebookShowBorder = newAttr
  notebookGetShowBorder
  notebookSetShowBorder

-- | If @True@, scroll arrows are added if there are too many tabs to fit.
--
-- Default value: @False@
--
notebookScrollable :: NotebookClass self => Attr self Bool
notebookScrollable = newAttr
  notebookGetScrollable
  notebookSetScrollable

-- | If @True@, pressing the right mouse button on the notebook pops up a menu
-- that you can use to go to a page.
--
-- Default value: @False@
--
notebookEnablePopup :: NotebookClass self => Attr self Bool
notebookEnablePopup = newAttrFromBoolProperty "enable-popup"

-- | Whether tabs should have homogeneous sizes.
--
-- Default value: @False@
--
notebookHomogeneous :: NotebookClass self => Attr self Bool
notebookHomogeneous = newAttrFromBoolProperty "homogeneous"

-- | Switches to the page number @pageNum@.
--
-- Note that due to historical reasons, 'Notebook' refuses to switch to a
-- page unless the child widget is visible. Therefore, it is recommended to
-- show child widgets before adding them to a notebook.
--
-- Returns the page number of the current page.
--
notebookCurrentPage :: NotebookClass self => Attr self Int
notebookCurrentPage = newAttr
  notebookGetCurrentPage
  notebookSetCurrentPage

--------------------
-- Child Attributes

-- | The string displayed on the child's tab label.
--
-- Default value: @Nothing@
--
notebookChildTabLabel :: (NotebookClass self, WidgetClass child) => child -> Attr self String
notebookChildTabLabel = newAttrFromContainerChildStringProperty "tab-label"

-- | The string displayed in the child's menu entry.
--
-- Default value: @Nothing@
--
notebookChildMenuLabel :: (NotebookClass self, WidgetClass child) => child -> Attr self String
notebookChildMenuLabel = newAttrFromContainerChildStringProperty "menu-label"

-- | The index of the child in the parent.
--
-- Allowed values: >= -1
--
-- Default value: 0
--
notebookChildPosition :: (NotebookClass self, WidgetClass child) => child -> Attr self Int
notebookChildPosition = newAttrFromContainerChildIntProperty "position"

-- | The packing style of the child's tab.
--
-- Default value: 'PackGrow'
--
notebookChildTabPacking :: (NotebookClass self, WidgetClass child) => child -> Attr self Packing
notebookChildTabPacking child = newAttr
  (\container -> do
     expand <- containerChildGetPropertyBool "tab-expand" child container
     fill <- containerChildGetPropertyBool "tab-fill" child container
     return (toPacking expand fill))
  (\container packing ->
     case fromPacking packing of
       (expand, fill) -> do
         containerChildSetPropertyBool "tab-expand" child container expand
         containerChildSetPropertyBool "tab-fill" child container fill)

-- | A 'PackType' indicating whether the child is packed with reference to the
-- start or end of the parent.
--
-- Default value: 'PackStart'
--
notebookChildTabPackType :: (NotebookClass self, WidgetClass child) => child -> Attr self PackType
notebookChildTabPackType = newAttrFromContainerChildEnumProperty "tab-pack"
                         gtk_pack_type_get_type
{-# LINE 1166 "./Graphics/UI/Gtk/Layout/Notebook.chs" #-}

-- | Whether the tab is detachable.
--
-- Default value: @False@
--
notebookChildDetachable :: NotebookClass self => Attr self Bool
notebookChildDetachable = newAttrFromBoolProperty "detachable"

-- | Whether the tab is reorderable by user action or not.
--
-- Default value: @False@
--
notebookChildReorderable :: NotebookClass self => Attr self Bool
notebookChildReorderable = newAttrFromBoolProperty "reorderable"

-- | Whether to expand the child's tab or not.
--
-- Default value : @False@
--
notebookChildTabExpand :: NotebookClass self => Attr self Bool
notebookChildTabExpand = newAttrFromBoolProperty "tab-expand"

-- | Whether the child's tab should fill the allocated area or not.
--
-- Default value : @False@
--
notebookChildTabFill :: NotebookClass self => Attr self Bool
notebookChildTabFill = newAttrFromBoolProperty "tab-fill"


-- | The 'notebookStyleArrowSpacing' property defines the spacing between the scroll arrows and the tabs.
--
-- Allowed values: >= 0
--
-- Default value: 0
--
-- * Available since Gtk version 2.10
--
notebookStyleArrowSpacing :: NotebookClass self => ReadAttr self Bool
notebookStyleArrowSpacing = readAttrFromBoolProperty "arrow-spacing"


-- | The 'notebookStyleHasBackwardStepper' property determines whether the standard backward arrow button is displayed.
--
-- Default value: @True@
--
-- * Available since Gtk version 2.4
--
notebookStyleHasBackwardStepper :: NotebookClass self => ReadAttr self Bool
notebookStyleHasBackwardStepper = readAttrFromBoolProperty "has-backward-stepper"

-- | The 'notebookStyleHasForwardStepper' property determines whether the standard forward arrow button is displayed.
--
-- Default value : @True@
--
-- * Available since Gtk version 2.4
--
notebookStyleHasForwardStepper :: NotebookClass self => ReadAttr self Bool
notebookStyleHasForwardStepper = readAttrFromBoolProperty "has-forward-stepper"

-- | The 'notebookStyleHasSecondaryBackwardStepper' property determines whether a second backward arrow button is displayed on the opposite end of the tab area.
--
-- Default value: @False@
--
-- * Available since Gtk version 2.4
--
notebookStyleHasSecondaryBackwardStepper :: NotebookClass self => ReadAttr self Bool
notebookStyleHasSecondaryBackwardStepper = readAttrFromBoolProperty "has-secondary-backward-stepper"

-- | The 'notebookStyleHasSecondaryForwardStepper' property determines whether a second forward arrow button is displayed on the opposite end of the tab area.
--
-- Default value: @False@
--
-- * Available since Gtk version 2.4
--
notebookStyleHasSecondaryForwardStepper :: NotebookClass self => ReadAttr self Bool
notebookStyleHasSecondaryForwardStepper = readAttrFromBoolProperty "has-secondary-forward-stepper"


-- | The 'notebookStyleTabCurvature' property defines size of tab curvature.
--
-- Allowed values: >= 0
--
-- Default value: 1
--
-- * Available since Gtk version 2.10
--
notebookStyleTabCurvature :: NotebookClass self => ReadAttr self Int
notebookStyleTabCurvature = readAttrFromIntProperty "tab-curvature"

-- | The 'notebookStyleTabOverlap' property defines size of tab overlap area.
--
-- Default value: 2
--
-- * Available since Gtk version 2.10
--
notebookStyleTabOverlap :: NotebookClass self => ReadAttr self Int
notebookStyleTabOverlap = readAttrFromIntProperty "tab-overlap"


--------------------
-- Signals

-- | Emitted when the user or a function changes the current page.
--
switchPage :: NotebookClass self => Signal self (Int -> IO ())
switchPage = Signal (\after obj act ->
                     connect_PTR_WORD__NONE "switch-page" after obj
                     (\_ page -> act (fromIntegral page)))


-- | The 'pageReordered' signal is emitted in the notebook right after a page has been reordered.
--
-- * Available since Gtk+ version 2.10
--
pageReordered :: NotebookClass self => Signal self (Widget -> Int -> IO ())
pageReordered = Signal (connect_OBJECT_INT__NONE "page-reordered")

-- | The 'pageRemoved' signal is emitted in the notebook right after a page is removed from the notebook.
--
-- * Available since Gtk+ version 2.10
--
pageRemoved :: NotebookClass self => Signal self (Widget -> Int -> IO ())
pageRemoved = Signal (connect_OBJECT_INT__NONE "page-removed")

-- | The 'pageAdded' signal is emitted in the notebook right after a page is added to the notebook.
--
-- * Available since Gtk+ version 2.10
--
pageAdded :: NotebookClass self => Signal self (Widget -> Int -> IO ())
pageAdded = Signal (connect_OBJECT_INT__NONE "page-added")


-- * Deprecated


-- | This signal is emitted when a new page is
-- selected.
--
onSwitchPage, afterSwitchPage :: NotebookClass nb => nb -> (Int -> IO ()) ->
                                 IO (ConnectId nb)
onSwitchPage nb fun = connect_BOXED_WORD__NONE "switch-page"
        (const $ return ()) False nb
        (\_ page -> fun (fromIntegral page))
afterSwitchPage nb fun = connect_BOXED_WORD__NONE "switch-page"
    (const $ return ()) True nb
    (\_ page -> fun (fromIntegral page))

foreign import ccall unsafe "gtk_notebook_new"
  gtk_notebook_new :: (IO (Ptr Widget))

foreign import ccall safe "gtk_notebook_append_page"
  gtk_notebook_append_page :: ((Ptr Notebook) -> ((Ptr Widget) -> ((Ptr Widget) -> (IO CInt))))

foreign import ccall safe "gtk_notebook_append_page_menu"
  gtk_notebook_append_page_menu :: ((Ptr Notebook) -> ((Ptr Widget) -> ((Ptr Widget) -> ((Ptr Widget) -> (IO CInt)))))

foreign import ccall safe "gtk_notebook_prepend_page"
  gtk_notebook_prepend_page :: ((Ptr Notebook) -> ((Ptr Widget) -> ((Ptr Widget) -> (IO CInt))))

foreign import ccall safe "gtk_notebook_prepend_page_menu"
  gtk_notebook_prepend_page_menu :: ((Ptr Notebook) -> ((Ptr Widget) -> ((Ptr Widget) -> ((Ptr Widget) -> (IO CInt)))))

foreign import ccall safe "gtk_notebook_insert_page"
  gtk_notebook_insert_page :: ((Ptr Notebook) -> ((Ptr Widget) -> ((Ptr Widget) -> (CInt -> (IO CInt)))))

foreign import ccall safe "gtk_notebook_insert_page_menu"
  gtk_notebook_insert_page_menu :: ((Ptr Notebook) -> ((Ptr Widget) -> ((Ptr Widget) -> ((Ptr Widget) -> (CInt -> (IO CInt))))))

foreign import ccall safe "gtk_notebook_remove_page"
  gtk_notebook_remove_page :: ((Ptr Notebook) -> (CInt -> (IO ())))

foreign import ccall unsafe "gtk_notebook_page_num"
  gtk_notebook_page_num :: ((Ptr Notebook) -> ((Ptr Widget) -> (IO CInt)))

foreign import ccall safe "gtk_notebook_set_current_page"
  gtk_notebook_set_current_page :: ((Ptr Notebook) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_notebook_next_page"
  gtk_notebook_next_page :: ((Ptr Notebook) -> (IO ()))

foreign import ccall safe "gtk_notebook_prev_page"
  gtk_notebook_prev_page :: ((Ptr Notebook) -> (IO ()))

foreign import ccall safe "gtk_notebook_reorder_child"
  gtk_notebook_reorder_child :: ((Ptr Notebook) -> ((Ptr Widget) -> (CInt -> (IO ()))))

foreign import ccall safe "gtk_notebook_set_tab_pos"
  gtk_notebook_set_tab_pos :: ((Ptr Notebook) -> (CInt -> (IO ())))

foreign import ccall unsafe "gtk_notebook_get_tab_pos"
  gtk_notebook_get_tab_pos :: ((Ptr Notebook) -> (IO CInt))

foreign import ccall safe "gtk_notebook_set_show_tabs"
  gtk_notebook_set_show_tabs :: ((Ptr Notebook) -> (CInt -> (IO ())))

foreign import ccall unsafe "gtk_notebook_get_show_tabs"
  gtk_notebook_get_show_tabs :: ((Ptr Notebook) -> (IO CInt))

foreign import ccall safe "gtk_notebook_set_show_border"
  gtk_notebook_set_show_border :: ((Ptr Notebook) -> (CInt -> (IO ())))

foreign import ccall unsafe "gtk_notebook_get_show_border"
  gtk_notebook_get_show_border :: ((Ptr Notebook) -> (IO CInt))

foreign import ccall unsafe "gtk_notebook_set_scrollable"
  gtk_notebook_set_scrollable :: ((Ptr Notebook) -> (CInt -> (IO ())))

foreign import ccall unsafe "gtk_notebook_get_scrollable"
  gtk_notebook_get_scrollable :: ((Ptr Notebook) -> (IO CInt))

foreign import ccall safe "gtk_notebook_set_tab_border"
  gtk_notebook_set_tab_border :: ((Ptr Notebook) -> (CUInt -> (IO ())))

foreign import ccall safe "gtk_notebook_set_tab_hborder"
  gtk_notebook_set_tab_hborder :: ((Ptr Notebook) -> (CUInt -> (IO ())))

foreign import ccall safe "gtk_notebook_set_tab_vborder"
  gtk_notebook_set_tab_vborder :: ((Ptr Notebook) -> (CUInt -> (IO ())))

foreign import ccall safe "gtk_notebook_popup_enable"
  gtk_notebook_popup_enable :: ((Ptr Notebook) -> (IO ()))

foreign import ccall safe "gtk_notebook_popup_disable"
  gtk_notebook_popup_disable :: ((Ptr Notebook) -> (IO ()))

foreign import ccall unsafe "gtk_notebook_get_current_page"
  gtk_notebook_get_current_page :: ((Ptr Notebook) -> (IO CInt))

foreign import ccall safe "gtk_notebook_set_menu_label"
  gtk_notebook_set_menu_label :: ((Ptr Notebook) -> ((Ptr Widget) -> ((Ptr Widget) -> (IO ()))))

foreign import ccall unsafe "gtk_notebook_get_menu_label"
  gtk_notebook_get_menu_label :: ((Ptr Notebook) -> ((Ptr Widget) -> (IO (Ptr Widget))))

foreign import ccall safe "gtk_notebook_set_menu_label_text"
  gtk_notebook_set_menu_label_text :: ((Ptr Notebook) -> ((Ptr Widget) -> ((Ptr CChar) -> (IO ()))))

foreign import ccall unsafe "gtk_notebook_get_menu_label_text"
  gtk_notebook_get_menu_label_text :: ((Ptr Notebook) -> ((Ptr Widget) -> (IO (Ptr CChar))))

foreign import ccall unsafe "gtk_notebook_get_nth_page"
  gtk_notebook_get_nth_page :: ((Ptr Notebook) -> (CInt -> (IO (Ptr Widget))))

foreign import ccall unsafe "gtk_notebook_get_n_pages"
  gtk_notebook_get_n_pages :: ((Ptr Notebook) -> (IO CInt))

foreign import ccall unsafe "gtk_notebook_get_tab_label"
  gtk_notebook_get_tab_label :: ((Ptr Notebook) -> ((Ptr Widget) -> (IO (Ptr Widget))))

foreign import ccall unsafe "gtk_notebook_get_tab_label_text"
  gtk_notebook_get_tab_label_text :: ((Ptr Notebook) -> ((Ptr Widget) -> (IO (Ptr CChar))))

foreign import ccall unsafe "gtk_notebook_query_tab_label_packing"
  gtk_notebook_query_tab_label_packing :: ((Ptr Notebook) -> ((Ptr Widget) -> ((Ptr CInt) -> ((Ptr CInt) -> ((Ptr CInt) -> (IO ()))))))

foreign import ccall safe "gtk_notebook_set_tab_label_packing"
  gtk_notebook_set_tab_label_packing :: ((Ptr Notebook) -> ((Ptr Widget) -> (CInt -> (CInt -> (CInt -> (IO ()))))))

foreign import ccall safe "gtk_notebook_set_homogeneous_tabs"
  gtk_notebook_set_homogeneous_tabs :: ((Ptr Notebook) -> (CInt -> (IO ())))

foreign import ccall safe "gtk_notebook_set_tab_label"
  gtk_notebook_set_tab_label :: ((Ptr Notebook) -> ((Ptr Widget) -> ((Ptr Widget) -> (IO ()))))

foreign import ccall safe "gtk_notebook_set_tab_label_text"
  gtk_notebook_set_tab_label_text :: ((Ptr Notebook) -> ((Ptr Widget) -> ((Ptr CChar) -> (IO ()))))

foreign import ccall safe "gtk_notebook_set_tab_reorderable"
  gtk_notebook_set_tab_reorderable :: ((Ptr Notebook) -> ((Ptr Widget) -> (CInt -> (IO ()))))

foreign import ccall safe "gtk_notebook_get_tab_reorderable"
  gtk_notebook_get_tab_reorderable :: ((Ptr Notebook) -> ((Ptr Widget) -> (IO CInt)))

foreign import ccall safe "gtk_notebook_set_tab_detachable"
  gtk_notebook_set_tab_detachable :: ((Ptr Notebook) -> ((Ptr Widget) -> (CInt -> (IO ()))))

foreign import ccall safe "gtk_notebook_get_tab_detachable"
  gtk_notebook_get_tab_detachable :: ((Ptr Notebook) -> ((Ptr Widget) -> (IO CInt)))

foreign import ccall safe "gtk_notebook_set_action_widget"
  gtk_notebook_set_action_widget :: ((Ptr Notebook) -> ((Ptr Widget) -> (CInt -> (IO ()))))

foreign import ccall safe "gtk_notebook_get_action_widget"
  gtk_notebook_get_action_widget :: ((Ptr Notebook) -> (CInt -> (IO (Ptr Widget))))

foreign import ccall unsafe "gtk_pack_type_get_type"
  gtk_pack_type_get_type :: CUInt