    {-# LINE 2 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
    -- -*-haskell-*-
    -- GIMP Toolkit (GTK) Widget InfoBar
    --
    -- Author : Andy Stewart
    --
    -- Created: 27 Mar 2010
    --
    -- Copyright (C) 2010 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.
    --
    -- The following varargs functions can't bound:
    --
    -- gtk_info_bar_new_with_buttons
    -- gtk_info_bar_add_buttons
    --
    -- Use 'infoBarAddButton' replace.
    --
    -- |
    -- Maintainer : gtk2hs-users@lists.sourceforge.net
    -- Stability : provisional
    -- Portability : portable (depends on GHC)
    --
    -- Report important messages to the user
    --
    module Graphics.UI.Gtk.Display.InfoBar (

    -- * Detail
    --
    -- | 'InfoBar' is a widget that can be used to show messages to the user
    -- without showing a dialog. It is often temporarily shown at the top or bottom
    -- of a document. In contrast to 'Dialog', which has a horizontal action area
    -- at the bottom, 'InfoBar' has a vertical action area at the side.
    --
    -- The API of 'InfoBar' is very similar to 'Dialog', allowing you to add
    -- buttons to the action area with 'infoBarAddButton'.
    -- The sensitivity of action widgets can be controlled
    -- with 'infoBarSetResponseSensitive'. To add widgets to the main content area
    -- of a 'InfoBar', use 'infoBarGetContentArea' and add your widgets to the
    -- container.
    --
    -- Similar to 'MessageDialog', the contents of a 'InfoBar' can by classified
    -- as error message, warning, informational message, etc, by using
    -- 'infoBarSetMessageType'. Gtk+ uses the message type to determine the
    -- background color of the message area.

    -- * Class Hierarchy
    --
    -- |
    -- @
    -- | 'GObject'
    -- | +----'Object'
    -- | +----'Widget'
    -- | +----'Container'
    -- | +----'Box'
    -- | +----'HBox'
    -- | +----InfoBar
    -- @

    -- * Types
      InfoBar,
      InfoBarClass,
      castToInfoBar,
      toInfoBar,

    -- * Constructors
      infoBarNew,

    -- * Methods
      infoBarAddActionWidget,
      infoBarAddButton,
      infoBarSetResponseSensitive,
      infoBarSetDefaultResponse,
      infoBarEmitResponse,
      infoBarGetActionArea,
      infoBarGetContentArea,

    -- * Attributes
      infoBarMessageType,

    -- * Signals
      infoBarResponse,
      infoBarClose,

      ) where

    import Control.Monad (liftM)

    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.Windows.MessageDialog (MessageType)
    import Graphics.UI.Gtk.Types
    {-# LINE 106 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
    import Graphics.UI.Gtk.Signals
    {-# LINE 107 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}

    {-# LINE 109 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}

    --------------------
    -- Interfaces

    -- instance BuildableClass InfoBar

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

    -- | Creates a new 'InfoBar' object.
    --
    -- * Available since Gtk+ version 2.18
    --
    infoBarNew :: IO InfoBar
    infoBarNew :: IO InfoBar
    infoBarNew =
      (ForeignPtr InfoBar -> InfoBar, FinalizerPtr InfoBar)
    -> IO (Ptr InfoBar) -> IO InfoBar
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    makeNewObject (ForeignPtr InfoBar -> InfoBar, FinalizerPtr InfoBar)
    forall {a}. (ForeignPtr InfoBar -> InfoBar, FinalizerPtr a)
    mkInfoBar (IO (Ptr InfoBar) -> IO InfoBar) -> IO (Ptr InfoBar) -> IO InfoBar
    forall a b. (a -> b) -> a -> b
    $
      (Ptr Widget -> Ptr InfoBar) -> IO (Ptr Widget) -> IO (Ptr InfoBar)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Ptr Widget -> Ptr InfoBar
    forall a b. Ptr a -> Ptr b
    castPtr :: Ptr Widget -> Ptr InfoBar) (IO (Ptr Widget) -> IO (Ptr InfoBar))
    -> IO (Ptr Widget) -> IO (Ptr InfoBar)
    forall a b. (a -> b) -> a -> b
    $
      IO (Ptr Widget)
    gtk_info_bar_new
    {-# LINE 128 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}

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

    -- | Add an activatable widget to the action area of a 'InfoBar', connecting a signal handler that will
    -- emit the "response" signal on the message area when the widget is activated. The widget is appended
    -- to the end of the message areas action area.
    --
    -- * Available since Gtk+ version 2.18
    --
    infoBarAddActionWidget :: (InfoBarClass self, WidgetClass child) => self
     -> child -- ^ @child@ - an activatable widget
     -> Int -- ^ @responseId@ - response ID for @child@
     -> IO ()
    infoBarAddActionWidget :: forall self child.
    (InfoBarClass self, WidgetClass child) =>
    self -> child -> Int -> IO ()
    infoBarAddActionWidget self
    self child
    child Int
    responseId =
      (\(InfoBar ForeignPtr InfoBar
    arg1) (Widget ForeignPtr Widget
    arg2) CInt
    arg3 -> ForeignPtr InfoBar -> (Ptr InfoBar -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr InfoBar
    arg1 ((Ptr InfoBar -> IO ()) -> IO ())
    -> (Ptr InfoBar -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr InfoBar
    argPtr1 ->ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr Widget
    arg2 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr Widget
    argPtr2 ->Ptr InfoBar -> Ptr Widget -> CInt -> IO ()
    gtk_info_bar_add_action_widget Ptr InfoBar
    argPtr1 Ptr Widget
    argPtr2 CInt
    arg3)
    {-# LINE 144 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
        (toInfoBar self)
        (child -> Widget
    forall o. WidgetClass o => o -> Widget
    toWidget child
    child)
        (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Int
    responseId)

    -- | Adds a button with the given text (or a stock button, if buttonText is a
    -- stock ID) and sets things up so that clicking the button will emit the
    -- \"response\" signal with the given responseId. The button is appended to
    -- the end of the info bars's action area. The button widget is returned, but
    -- usually you don't need it.
    --
    -- * Available since Gtk+ version 2.18
    --
    infoBarAddButton :: (InfoBarClass self, GlibString string) => self
     -> string -- ^ @buttonText@ - text of button, or stock ID
     -> Int -- ^ @responseId@ - response ID for the button
     -> IO Button -- ^ returns the button widget that was added
    infoBarAddButton :: forall self string.
    (InfoBarClass self, GlibString string) =>
    self -> string -> Int -> IO Button
    infoBarAddButton self
    self string
    buttonText Int
    responseId =
      (ForeignPtr Button -> Button, FinalizerPtr Button)
    -> IO (Ptr Button) -> IO Button
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    makeNewObject (ForeignPtr Button -> Button, FinalizerPtr Button)
    forall {a}. (ForeignPtr Button -> Button, FinalizerPtr a)
    mkButton (IO (Ptr Button) -> IO Button) -> IO (Ptr Button) -> IO Button
    forall a b. (a -> b) -> a -> b
    $
      string -> (CString -> IO (Ptr Button)) -> IO (Ptr Button)
    forall a. string -> (CString -> IO a) -> IO a
    forall s a. GlibString s => s -> (CString -> IO a) -> IO a
    withUTFString string
    buttonText ((CString -> IO (Ptr Button)) -> IO (Ptr Button))
    -> (CString -> IO (Ptr Button)) -> IO (Ptr Button)
    forall a b. (a -> b) -> a -> b
    $ \CString
    buttonTextPtr ->
      (Ptr Widget -> Ptr Button) -> IO (Ptr Widget) -> IO (Ptr Button)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Ptr Widget -> Ptr Button
    forall a b. Ptr a -> Ptr b
    castPtr :: Ptr Widget -> Ptr Button) (IO (Ptr Widget) -> IO (Ptr Button))
    -> IO (Ptr Widget) -> IO (Ptr Button)
    forall a b. (a -> b) -> a -> b
    $
         (\(InfoBar ForeignPtr InfoBar
    arg1) CString
    arg2 CInt
    arg3 -> ForeignPtr InfoBar
    -> (Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget)
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr InfoBar
    arg1 ((Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget))
    -> (Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget)
    forall a b. (a -> b) -> a -> b
    $ \Ptr InfoBar
    argPtr1 ->Ptr InfoBar -> CString -> CInt -> IO (Ptr Widget)
    gtk_info_bar_add_button Ptr InfoBar
    argPtr1 CString
    arg2 CInt
    arg3)
    {-# LINE 165 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
           (toInfoBar self)
           CString
    buttonTextPtr
           (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Int
    responseId)

    -- | Calls 'widgetSetSensitive' for each widget in the
    -- info bars's action area with the given responseId. A convenient way to
    -- sensitize\/desensitize dialog buttons.
    --
    -- * Available since Gtk+ version 2.18
    --
    infoBarSetResponseSensitive :: InfoBarClass self => self
     -> Int -- ^ @responseId@ - a response ID
     -> Bool -- ^ @setting@ - @True@ for sensitive
     -> IO ()
    infoBarSetResponseSensitive :: forall self. InfoBarClass self => self -> Int -> Bool -> IO ()
    infoBarSetResponseSensitive self
    self Int
    responseId Bool
    setting =
      (\(InfoBar ForeignPtr InfoBar
    arg1) CInt
    arg2 CInt
    arg3 -> ForeignPtr InfoBar -> (Ptr InfoBar -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr InfoBar
    arg1 ((Ptr InfoBar -> IO ()) -> IO ())
    -> (Ptr InfoBar -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr InfoBar
    argPtr1 ->Ptr InfoBar -> CInt -> CInt -> IO ()
    gtk_info_bar_set_response_sensitive Ptr InfoBar
    argPtr1 CInt
    arg2 CInt
    arg3)
    {-# LINE 181 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
        (toInfoBar self)
        (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Int
    responseId)
        (Bool -> CInt
    forall a. Num a => Bool -> a
    fromBool Bool
    setting)

    -- | Sets the last widget in the info bar's action area with the given
    -- responseId as the default widget for the dialog. Pressing \"Enter\"
    -- normally activates the default widget.
    --
    -- * Available since Gtk+ version 2.18
    --
    infoBarSetDefaultResponse :: InfoBarClass self => self
     -> Int -- ^ @responseId@ - a response ID
     -> IO ()
    infoBarSetDefaultResponse :: forall self. InfoBarClass self => self -> Int -> IO ()
    infoBarSetDefaultResponse self
    self Int
    responseId =
      (\(InfoBar ForeignPtr InfoBar
    arg1) CInt
    arg2 -> ForeignPtr InfoBar -> (Ptr InfoBar -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr InfoBar
    arg1 ((Ptr InfoBar -> IO ()) -> IO ())
    -> (Ptr InfoBar -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr InfoBar
    argPtr1 ->Ptr InfoBar -> CInt -> IO ()
    gtk_info_bar_set_default_response Ptr InfoBar
    argPtr1 CInt
    arg2)
    {-# LINE 196 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
        (toInfoBar self)
        (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Int
    responseId)

    -- | Emits the \'response\' signal with the given @responseId@.
    --
    -- * Available since Gtk+ version 2.18
    --
    infoBarEmitResponse :: InfoBarClass self => self
     -> Int -- ^ @responseId@ - a response ID
     -> IO ()
    infoBarEmitResponse :: forall self. InfoBarClass self => self -> Int -> IO ()
    infoBarEmitResponse self
    self Int
    responseId =
      (\(InfoBar ForeignPtr InfoBar
    arg1) CInt
    arg2 -> ForeignPtr InfoBar -> (Ptr InfoBar -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr InfoBar
    arg1 ((Ptr InfoBar -> IO ()) -> IO ())
    -> (Ptr InfoBar -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr InfoBar
    argPtr1 ->Ptr InfoBar -> CInt -> IO ()
    gtk_info_bar_response Ptr InfoBar
    argPtr1 CInt
    arg2)
    {-# LINE 208 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
        (toInfoBar self)
        (Int -> CInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Int
    responseId)

    -- | Returns the action area of @infoBar@.
    --
    -- * Available since Gtk+ version 2.18
    --
    infoBarGetActionArea :: InfoBarClass self => self
     -> IO Widget -- ^ returns the action area.
    infoBarGetActionArea :: forall self. InfoBarClass self => self -> IO Widget
    infoBarGetActionArea self
    self =
      (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
    -> IO (Ptr Widget) -> IO Widget
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    makeNewObject (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
    forall {a}. (ForeignPtr Widget -> Widget, FinalizerPtr a)
    mkWidget (IO (Ptr Widget) -> IO Widget) -> IO (Ptr Widget) -> IO Widget
    forall a b. (a -> b) -> a -> b
    $
      (\(InfoBar ForeignPtr InfoBar
    arg1) -> ForeignPtr InfoBar
    -> (Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget)
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr InfoBar
    arg1 ((Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget))
    -> (Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget)
    forall a b. (a -> b) -> a -> b
    $ \Ptr InfoBar
    argPtr1 ->Ptr InfoBar -> IO (Ptr Widget)
    gtk_info_bar_get_action_area Ptr InfoBar
    argPtr1)
    {-# LINE 220 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
        (toInfoBar self)

    -- | Returns the content area of @infoBar@.
    --
    -- * Available since Gtk+ version 2.18
    --
    infoBarGetContentArea :: InfoBarClass self => self
     -> IO Widget -- ^ returns the content area.
    infoBarGetContentArea :: forall self. InfoBarClass self => self -> IO Widget
    infoBarGetContentArea self
    self =
      (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
    -> IO (Ptr Widget) -> IO Widget
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    makeNewObject (ForeignPtr Widget -> Widget, FinalizerPtr Widget)
    forall {a}. (ForeignPtr Widget -> Widget, FinalizerPtr a)
    mkWidget (IO (Ptr Widget) -> IO Widget) -> IO (Ptr Widget) -> IO Widget
    forall a b. (a -> b) -> a -> b
    $
      (\(InfoBar ForeignPtr InfoBar
    arg1) -> ForeignPtr InfoBar
    -> (Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget)
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr InfoBar
    arg1 ((Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget))
    -> (Ptr InfoBar -> IO (Ptr Widget)) -> IO (Ptr Widget)
    forall a b. (a -> b) -> a -> b
    $ \Ptr InfoBar
    argPtr1 ->Ptr InfoBar -> IO (Ptr Widget)
    gtk_info_bar_get_content_area Ptr InfoBar
    argPtr1)
    {-# LINE 231 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}
        (toInfoBar self)

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

    -- | The type of the message.
    --
    -- The type is used to determine the colors to use in the info bar.
    --
    -- If the type is 'MessageOther', no info bar is painted but the colors are still set.
    --
    -- Default value: 'MessageInfo'
    --
    -- * Available since Gtk+ version 2.18
    --
    infoBarMessageType :: InfoBarClass self => Attr self MessageType
    infoBarMessageType :: forall self. InfoBarClass self => Attr self MessageType
    infoBarMessageType = String -> GType -> Attr self MessageType
    forall gobj enum.
    (GObjectClass gobj, Enum enum) =>
    String -> GType -> Attr gobj enum
    newAttrFromEnumProperty String
    "message-type"
                           GType
    gtk_message_type_get_type
    {-# LINE 249 "./Graphics/UI/Gtk/Display/InfoBar.chs" #-}

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

    -- | The 'close' signal is a keybinding signal which gets emitted when the user uses a keybinding to
    -- dismiss the info bar.
    --
    -- The default binding for this signal is the Escape key.
    --
    -- Since 2.18
    infoBarClose :: InfoBarClass self => Signal self (IO ())
    infoBarClose :: forall self. InfoBarClass self => Signal self (IO ())
    infoBarClose = (Bool -> self -> IO () -> IO (ConnectId self))
    -> Signal self (IO ())
    forall object handler.
    (Bool -> object -> handler -> IO (ConnectId object))
    -> Signal object handler
    Signal (String -> Bool -> self -> IO () -> IO (ConnectId self)
    forall obj.
    GObjectClass obj =>
    String -> Bool -> obj -> IO () -> IO (ConnectId obj)
    connect_NONE__NONE String
    "close")

    -- | Emitted when an action widget is clicked or the application programmer
    -- calls 'dialogResponse'. The @responseId@ depends on which action widget was
    -- clicked.
    --
    -- * Available since Gtk+ version 2.18
    --
    infoBarResponse :: InfoBarClass self => Signal self (Int -> IO ())
    infoBarResponse :: forall self. InfoBarClass self => Signal self (Int -> IO ())
    infoBarResponse = (Bool -> self -> (Int -> IO ()) -> IO (ConnectId self))
    -> Signal self (Int -> IO ())
    forall object handler.
    (Bool -> object -> handler -> IO (ConnectId object))
    -> Signal object handler
    Signal (String -> Bool -> self -> (Int -> IO ()) -> IO (ConnectId self)
    forall obj.
    GObjectClass obj =>
    String -> Bool -> obj -> (Int -> IO ()) -> IO (ConnectId obj)
    connect_INT__NONE String
    "response")

    foreign import ccall safe "gtk_info_bar_new"
      gtk_info_bar_new :: (IO (Ptr Widget))

    foreign import ccall safe "gtk_info_bar_add_action_widget"
      gtk_info_bar_add_action_widget :: ((Ptr InfoBar) -> ((Ptr Widget) -> (CInt -> (IO ()))))

    foreign import ccall safe "gtk_info_bar_add_button"
      gtk_info_bar_add_button :: ((Ptr InfoBar) -> ((Ptr CChar) -> (CInt -> (IO (Ptr Widget)))))

    foreign import ccall safe "gtk_info_bar_set_response_sensitive"
      gtk_info_bar_set_response_sensitive :: ((Ptr InfoBar) -> (CInt -> (CInt -> (IO ()))))

    foreign import ccall safe "gtk_info_bar_set_default_response"
      gtk_info_bar_set_default_response :: ((Ptr InfoBar) -> (CInt -> (IO ())))

    foreign import ccall safe "gtk_info_bar_response"
      gtk_info_bar_response :: ((Ptr InfoBar) -> (CInt -> (IO ())))

    foreign import ccall safe "gtk_info_bar_get_action_area"
      gtk_info_bar_get_action_area :: ((Ptr InfoBar) -> (IO (Ptr Widget)))

    foreign import ccall safe "gtk_info_bar_get_content_area"
      gtk_info_bar_get_content_area :: ((Ptr InfoBar) -> (IO (Ptr Widget)))

    foreign import ccall unsafe "gtk_message_type_get_type"
      gtk_message_type_get_type :: CULong