    {-# LINE 2 "./Graphics/UI/Gtk/ModelView/CellRendererToggle.chs" #-}
    -- -*-haskell-*-
    -- GIMP Toolkit (GTK) CellRendererToggle
    --
    -- Author : Axel Simon
    --
    -- Created: 23 May 2001
    --
    -- Copyright (C) 1999-2005 Axel Simon
    --
    -- 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.
    --
    -- |
    -- Maintainer : gtk2hs-users@lists.sourceforge.net
    -- Stability : provisional
    -- Portability : portable (depends on GHC)
    --
    -- Renders a toggle button in a cell
    --
    module Graphics.UI.Gtk.ModelView.CellRendererToggle (
    -- * Detail
    --
    -- | 'CellRendererToggle' renders a toggle button in a cell. The button is
    -- drawn as a radio or checkbutton, depending on the radio property. When
    -- activated, it emits the toggled signal.

    -- * Class Hierarchy
    -- |
    -- @
    -- | 'GObject'
    -- | +----'Object'
    -- | +----'CellRenderer'
    -- | +----CellRendererToggle
    -- @

    -- * Types
      CellRendererToggle,
      CellRendererToggleClass,
      castToCellRendererToggle, gTypeCellRendererToggle,
      toCellRendererToggle,

    -- * Constructors
      cellRendererToggleNew,

    -- * Methods
      cellRendererToggleGetRadio,
      cellRendererToggleSetRadio,
      cellRendererToggleGetActive,
      cellRendererToggleSetActive,

    -- * Attributes
      cellToggleActive,
      cellToggleInconsistent,
      cellToggleActivatable,
      cellToggleRadio,
      cellToggleIndicatorSize,

    -- * Signals
      cellToggled,

    -- * Deprecated

      ) where

    import Control.Monad (liftM)

    import System.Glib.FFI
    import System.Glib.UTFString
    import System.Glib.Attributes (Attr)
    import System.Glib.Properties (newAttrFromBoolProperty,
                                                     newAttrFromIntProperty)
    import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
    import Graphics.UI.Gtk.Types
    {-# LINE 85 "./Graphics/UI/Gtk/ModelView/CellRendererToggle.chs" #-}
    import Graphics.UI.Gtk.Signals
    {-# LINE 86 "./Graphics/UI/Gtk/ModelView/CellRendererToggle.chs" #-}

    {-# LINE 88 "./Graphics/UI/Gtk/ModelView/CellRendererToggle.chs" #-}

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

    -- %hash c:bafb d:640f
    -- | Creates a new 'CellRendererToggle'. Adjust rendering parameters using
    -- object properties. Object properties can be set globally (with
    -- 'System.Glib.Attributes.set'). Also, within a
    -- 'Graphics.UI.Gtk.ModelView.TreeViewColumn', you can bind a property to a
    -- value in a 'Graphics.UI.Gtk.ModelView.TreeModel.TreeModel' using
    -- 'Graphics.UI.Gtk.ModelView.CellLayout.cellLayoutSetAttributes'. For
    -- example, you can bind the 'cellToggleActive' property on the cell renderer
    -- to a boolean value in the model, thus causing the check button to reflect
    -- the state of the model.
    --
    cellRendererToggleNew :: IO CellRendererToggle
    cellRendererToggleNew :: IO CellRendererToggle
    cellRendererToggleNew =
      (ForeignPtr CellRendererToggle -> CellRendererToggle,
     FinalizerPtr CellRendererToggle)
    -> IO (Ptr CellRendererToggle) -> IO CellRendererToggle
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    makeNewObject (ForeignPtr CellRendererToggle -> CellRendererToggle,
     FinalizerPtr CellRendererToggle)
    forall {a}.
    (ForeignPtr CellRendererToggle -> CellRendererToggle,
     FinalizerPtr a)
    mkCellRendererToggle (IO (Ptr CellRendererToggle) -> IO CellRendererToggle)
    -> IO (Ptr CellRendererToggle) -> IO CellRendererToggle
    forall a b. (a -> b) -> a -> b
    $
      (Ptr CellRenderer -> Ptr CellRendererToggle)
    -> IO (Ptr CellRenderer) -> IO (Ptr CellRendererToggle)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM (Ptr CellRenderer -> Ptr CellRendererToggle
    forall a b. Ptr a -> Ptr b
    castPtr :: Ptr CellRenderer -> Ptr CellRendererToggle) (IO (Ptr CellRenderer) -> IO (Ptr CellRendererToggle))
    -> IO (Ptr CellRenderer) -> IO (Ptr CellRendererToggle)
    forall a b. (a -> b) -> a -> b
    $
      IO (Ptr CellRenderer)
    gtk_cell_renderer_toggle_new
    {-# LINE 108 "./Graphics/UI/Gtk/ModelView/CellRendererToggle.chs" #-}

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

    -- %hash c:133b d:c428
    -- | If @radio@ is @True@, the cell renderer renders a radio toggle (i.e. a
    -- toggle in a group of mutually-exclusive toggles). If @False@, it renders a
    -- check toggle (a standalone boolean option). This can be set globally for
    -- the cell renderer, or changed just before rendering each cell in the model
    -- (for 'TreeView', you set up a per-row setting using 'TreeViewColumn' to
    -- associate model columns with cell renderer properties).
    --
    cellRendererToggleSetRadio :: CellRendererToggleClass self => self
     -> Bool -- ^ @radio@ - @True@ to make the toggle look like a radio button
     -> IO ()
    cellRendererToggleSetRadio :: forall self. CellRendererToggleClass self => self -> Bool -> IO ()
    cellRendererToggleSetRadio self
    self Bool
    radio =
      (\(CellRendererToggle ForeignPtr CellRendererToggle
    arg1) CInt
    arg2 -> ForeignPtr CellRendererToggle
    -> (Ptr CellRendererToggle -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr CellRendererToggle
    arg1 ((Ptr CellRendererToggle -> IO ()) -> IO ())
    -> (Ptr CellRendererToggle -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr CellRendererToggle
    argPtr1 ->Ptr CellRendererToggle -> CInt -> IO ()
    gtk_cell_renderer_toggle_set_radio Ptr CellRendererToggle
    argPtr1 CInt
    arg2)
    {-# LINE 125 "./Graphics/UI/Gtk/ModelView/CellRendererToggle.chs" #-}
        (toCellRendererToggle self)
        (Bool -> CInt
    forall a. Num a => Bool -> a
    fromBool Bool
    radio)

    -- %hash c:7f39 d:fe9f
    -- | Returns whether we\'re rendering radio toggles rather than checkboxes.
    --
    cellRendererToggleGetRadio :: CellRendererToggleClass self => self
     -> IO Bool -- ^ returns @True@ if we\'re rendering radio toggles rather than
                -- checkboxes
    cellRendererToggleGetRadio :: forall self. CellRendererToggleClass self => self -> IO Bool
    cellRendererToggleGetRadio self
    self =
      (CInt -> Bool) -> IO CInt -> IO Bool
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CInt -> Bool
    forall a. (Eq a, Num a) => a -> Bool
    toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
    forall a b. (a -> b) -> a -> b
    $
      (\(CellRendererToggle ForeignPtr CellRendererToggle
    arg1) -> ForeignPtr CellRendererToggle
    -> (Ptr CellRendererToggle -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr CellRendererToggle
    arg1 ((Ptr CellRendererToggle -> IO CInt) -> IO CInt)
    -> (Ptr CellRendererToggle -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr CellRendererToggle
    argPtr1 ->Ptr CellRendererToggle -> IO CInt
    gtk_cell_renderer_toggle_get_radio Ptr CellRendererToggle
    argPtr1)
    {-# LINE 137 "./Graphics/UI/Gtk/ModelView/CellRendererToggle.chs" #-}
        (toCellRendererToggle self)

    -- %hash c:4974 d:3d45
    -- | Returns whether the cell renderer is active. See
    -- 'cellRendererToggleSetActive'.
    --
    cellRendererToggleGetActive :: CellRendererToggleClass self => self
     -> IO Bool -- ^ returns @True@ if the cell renderer is active.
    cellRendererToggleGetActive :: forall self. CellRendererToggleClass self => self -> IO Bool
    cellRendererToggleGetActive self
    self =
      (CInt -> Bool) -> IO CInt -> IO Bool
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM CInt -> Bool
    forall a. (Eq a, Num a) => a -> Bool
    toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
    forall a b. (a -> b) -> a -> b
    $
      (\(CellRendererToggle ForeignPtr CellRendererToggle
    arg1) -> ForeignPtr CellRendererToggle
    -> (Ptr CellRendererToggle -> IO CInt) -> IO CInt
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr CellRendererToggle
    arg1 ((Ptr CellRendererToggle -> IO CInt) -> IO CInt)
    -> (Ptr CellRendererToggle -> IO CInt) -> IO CInt
    forall a b. (a -> b) -> a -> b
    $ \Ptr CellRendererToggle
    argPtr1 ->Ptr CellRendererToggle -> IO CInt
    gtk_cell_renderer_toggle_get_active Ptr CellRendererToggle
    argPtr1)
    {-# LINE 148 "./Graphics/UI/Gtk/ModelView/CellRendererToggle.chs" #-}
        (toCellRendererToggle self)

    -- %hash c:8420 d:5177
    -- | Activates or deactivates a cell renderer.
    --
    cellRendererToggleSetActive :: CellRendererToggleClass self => self
     -> Bool -- ^ @setting@ - the value to set.
     -> IO ()
    cellRendererToggleSetActive :: forall self. CellRendererToggleClass self => self -> Bool -> IO ()
    cellRendererToggleSetActive self
    self Bool
    setting =
      (\(CellRendererToggle ForeignPtr CellRendererToggle
    arg1) CInt
    arg2 -> ForeignPtr CellRendererToggle
    -> (Ptr CellRendererToggle -> IO ()) -> IO ()
    forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
    withForeignPtr ForeignPtr CellRendererToggle
    arg1 ((Ptr CellRendererToggle -> IO ()) -> IO ())
    -> (Ptr CellRendererToggle -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr CellRendererToggle
    argPtr1 ->Ptr CellRendererToggle -> CInt -> IO ()
    gtk_cell_renderer_toggle_set_active Ptr CellRendererToggle
    argPtr1 CInt
    arg2)
    {-# LINE 158 "./Graphics/UI/Gtk/ModelView/CellRendererToggle.chs" #-}
        (toCellRendererToggle self)
        (Bool -> CInt
    forall a. Num a => Bool -> a
    fromBool Bool
    setting)

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

    -- %hash c:aed9 d:ab32
    -- | The toggle state of the button.
    --
    -- Default value: @False@
    --
    cellToggleActive :: CellRendererToggleClass self => Attr self Bool
    cellToggleActive :: forall self. CellRendererToggleClass self => Attr self Bool
    cellToggleActive = String -> Attr self Bool
    forall gobj. GObjectClass gobj => String -> Attr gobj Bool
    newAttrFromBoolProperty String
    "active"

    -- %hash c:85c8 d:8ab1
    -- | The inconsistent state of the button.
    --
    -- Default value: @False@
    --
    cellToggleInconsistent :: CellRendererToggleClass self => Attr self Bool
    cellToggleInconsistent :: forall self. CellRendererToggleClass self => Attr self Bool
    cellToggleInconsistent = String -> Attr self Bool
    forall gobj. GObjectClass gobj => String -> Attr gobj Bool
    newAttrFromBoolProperty String
    "inconsistent"

    -- %hash c:74e5 d:e41e
    -- | The toggle button can be activated.
    --
    -- Default value: @True@
    --
    cellToggleActivatable :: CellRendererToggleClass self => Attr self Bool
    cellToggleActivatable :: forall self. CellRendererToggleClass self => Attr self Bool
    cellToggleActivatable = String -> Attr self Bool
    forall gobj. GObjectClass gobj => String -> Attr gobj Bool
    newAttrFromBoolProperty String
    "activatable"

    -- %hash c:61f2 d:5449
    -- | Draw the toggle button as a radio button.
    --
    -- Default value: @False@
    --
    cellToggleRadio :: CellRendererToggleClass self => Attr self Bool
    cellToggleRadio :: forall self. CellRendererToggleClass self => Attr self Bool
    cellToggleRadio = String -> Attr self Bool
    forall gobj. GObjectClass gobj => String -> Attr gobj Bool
    newAttrFromBoolProperty String
    "radio"

    -- %hash c:698 d:47b4
    -- | Size of check or radio indicator.
    --
    -- Allowed values: >= 0
    --
    -- Default value: 12
    --
    cellToggleIndicatorSize :: CellRendererToggleClass self => Attr self Int
    cellToggleIndicatorSize :: forall self. CellRendererToggleClass self => Attr self Int
    cellToggleIndicatorSize = String -> Attr self Int
    forall gobj. GObjectClass gobj => String -> Attr gobj Int
    newAttrFromIntProperty String
    "indicator-size"

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

    -- %hash c:33ab d:1ba3
    -- | The 'cellToggled' signal is emitted when the cell is toggled. The string
    -- represents a 'TreePath' into the model and can be converted using
    -- 'stringToTreePath'.
    --
    cellToggled :: (CellRendererToggleClass self, GlibString string) => Signal self (string -> IO ())
    cellToggled :: forall self string.
    (CellRendererToggleClass self, GlibString string) =>
    Signal self (string -> IO ())
    cellToggled = (Bool -> self -> (string -> IO ()) -> IO (ConnectId self))
    -> Signal self (string -> IO ())
    forall object handler.
    (Bool -> object -> handler -> IO (ConnectId object))
    -> Signal object handler
    Signal (String -> Bool -> self -> (string -> IO ()) -> IO (ConnectId self)
    forall a' obj.
    (GlibString a', GObjectClass obj) =>
    String -> Bool -> obj -> (a' -> IO ()) -> IO (ConnectId obj)
    connect_GLIBSTRING__NONE String
    "toggled")

    --------------------
    -- Deprecated Signals

    foreign import ccall unsafe "gtk_cell_renderer_toggle_new"
      gtk_cell_renderer_toggle_new :: (IO (Ptr CellRenderer))

    foreign import ccall safe "gtk_cell_renderer_toggle_set_radio"
      gtk_cell_renderer_toggle_set_radio :: ((Ptr CellRendererToggle) -> (CInt -> (IO ())))

    foreign import ccall safe "gtk_cell_renderer_toggle_get_radio"
      gtk_cell_renderer_toggle_get_radio :: ((Ptr CellRendererToggle) -> (IO CInt))

    foreign import ccall unsafe "gtk_cell_renderer_toggle_get_active"
      gtk_cell_renderer_toggle_get_active :: ((Ptr CellRendererToggle) -> (IO CInt))

    foreign import ccall safe "gtk_cell_renderer_toggle_set_active"
      gtk_cell_renderer_toggle_set_active :: ((Ptr CellRendererToggle) -> (CInt -> (IO ())))