    {-# LINE 2 "./Graphics/UI/Gtk/ModelView/CellRendererAccel.chs" #-}
    -- -*-haskell-*-
    -- GIMP Toolkit (GTK) Widget CellRendererAccel
    --
    -- Author : Andy Stewart
    --
    -- Created: 25 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.
    --
    -- |
    -- Maintainer : gtk2hs-users@lists.sourceforge.net
    -- Stability : provisional
    -- Portability : portable (depends on GHC)
    --
    -- Renders a keyboard accelerator in a cell
    --
    -- * Module available since Gtk+ version 2.10
    --
    module Graphics.UI.Gtk.ModelView.CellRendererAccel (

    -- * Detail
    --
    -- | 'CellRendererAccel' displays a keyboard accelerator (i.e. a key
    -- combination like \<Control>-a). If the cell renderer is editable, the
    -- accelerator can be changed by simply typing the new combination.
    --
    -- The 'CellRendererAccel' cell renderer was added in Gtk+ 2.10.

    -- * Class Hierarchy
    --
    -- |
    -- @
    -- | 'GObject'
    -- | +----'Object'
    -- | +----'CellRenderer'
    -- | +----'CellRendererText'
    -- | +----CellRendererAccel
    -- @

    -- * Types
      CellRendererAccel,
      CellRendererAccelClass,
      castToCellRendererAccel,
      toCellRendererAccel,

    -- * Enums
      CellRendererAccelMode(..),

    -- * Constructors
      cellRendererAccelNew,

    -- * Attributes
      cellRendererAccelAccelKey,
      cellRendererAccelAccelMods,
      cellRendererAccelKeycode,
      cellRendererAccelAccelMode,

    -- * Signals
      accelEdited,
      accelCleared,

      ) 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.Gdk.Enums (Modifier)
    import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
    import Graphics.UI.Gtk.Gdk.Keys (KeyVal, KeyCode)
    import Graphics.UI.Gtk.Signals
    {-# LINE 86 "./Graphics/UI/Gtk/ModelView/CellRendererAccel.chs" #-}
    import Graphics.UI.Gtk.Types
    {-# LINE 87 "./Graphics/UI/Gtk/ModelView/CellRendererAccel.chs" #-}

    {-# LINE 89 "./Graphics/UI/Gtk/ModelView/CellRendererAccel.chs" #-}

    --------------------
    -- Enums
    data CellRendererAccelMode = CellRendererAccelModeGtk
                               | CellRendererAccelModeOther
                               | CellRendererAccelModeModifierTap
                               deriving (Int -> CellRendererAccelMode
    CellRendererAccelMode -> Int
    CellRendererAccelMode -> [CellRendererAccelMode]
    CellRendererAccelMode -> CellRendererAccelMode
    CellRendererAccelMode
    -> CellRendererAccelMode -> [CellRendererAccelMode]
    CellRendererAccelMode
    -> CellRendererAccelMode
    -> CellRendererAccelMode
    -> [CellRendererAccelMode]
    (CellRendererAccelMode -> CellRendererAccelMode)
    -> (CellRendererAccelMode -> CellRendererAccelMode)
    -> (Int -> CellRendererAccelMode)
    -> (CellRendererAccelMode -> Int)
    -> (CellRendererAccelMode -> [CellRendererAccelMode])
    -> (CellRendererAccelMode
        -> CellRendererAccelMode -> [CellRendererAccelMode])
    -> (CellRendererAccelMode
        -> CellRendererAccelMode -> [CellRendererAccelMode])
    -> (CellRendererAccelMode
        -> CellRendererAccelMode
        -> CellRendererAccelMode
        -> [CellRendererAccelMode])
    -> Enum CellRendererAccelMode
    forall a.
    (a -> a)
    -> (a -> a)
    -> (Int -> a)
    -> (a -> Int)
    -> (a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> a -> [a])
    -> Enum a
    $csucc :: CellRendererAccelMode -> CellRendererAccelMode
    succ :: CellRendererAccelMode -> CellRendererAccelMode
    $cpred :: CellRendererAccelMode -> CellRendererAccelMode
    pred :: CellRendererAccelMode -> CellRendererAccelMode
    $ctoEnum :: Int -> CellRendererAccelMode
    toEnum :: Int -> CellRendererAccelMode
    $cfromEnum :: CellRendererAccelMode -> Int
    fromEnum :: CellRendererAccelMode -> Int
    $cenumFrom :: CellRendererAccelMode -> [CellRendererAccelMode]
    enumFrom :: CellRendererAccelMode -> [CellRendererAccelMode]
    $cenumFromThen :: CellRendererAccelMode
    -> CellRendererAccelMode -> [CellRendererAccelMode]
    enumFromThen :: CellRendererAccelMode
    -> CellRendererAccelMode -> [CellRendererAccelMode]
    $cenumFromTo :: CellRendererAccelMode
    -> CellRendererAccelMode -> [CellRendererAccelMode]
    enumFromTo :: CellRendererAccelMode
    -> CellRendererAccelMode -> [CellRendererAccelMode]
    $cenumFromThenTo :: CellRendererAccelMode
    -> CellRendererAccelMode
    -> CellRendererAccelMode
    -> [CellRendererAccelMode]
    enumFromThenTo :: CellRendererAccelMode
    -> CellRendererAccelMode
    -> CellRendererAccelMode
    -> [CellRendererAccelMode]
    Enum,CellRendererAccelMode
    CellRendererAccelMode
    -> CellRendererAccelMode -> Bounded CellRendererAccelMode
    forall a. a -> a -> Bounded a
    $cminBound :: CellRendererAccelMode
    minBound :: CellRendererAccelMode
    $cmaxBound :: CellRendererAccelMode
    maxBound :: CellRendererAccelMode
    Bounded,CellRendererAccelMode -> CellRendererAccelMode -> Bool
    (CellRendererAccelMode -> CellRendererAccelMode -> Bool)
    -> (CellRendererAccelMode -> CellRendererAccelMode -> Bool)
    -> Eq CellRendererAccelMode
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: CellRendererAccelMode -> CellRendererAccelMode -> Bool
    == :: CellRendererAccelMode -> CellRendererAccelMode -> Bool
    $c/= :: CellRendererAccelMode -> CellRendererAccelMode -> Bool
    /= :: CellRendererAccelMode -> CellRendererAccelMode -> Bool
    Eq,Int -> CellRendererAccelMode -> ShowS
    [CellRendererAccelMode] -> ShowS
    CellRendererAccelMode -> String
    (Int -> CellRendererAccelMode -> ShowS)
    -> (CellRendererAccelMode -> String)
    -> ([CellRendererAccelMode] -> ShowS)
    -> Show CellRendererAccelMode
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> CellRendererAccelMode -> ShowS
    showsPrec :: Int -> CellRendererAccelMode -> ShowS
    $cshow :: CellRendererAccelMode -> String
    show :: CellRendererAccelMode -> String
    $cshowList :: [CellRendererAccelMode] -> ShowS
    showList :: [CellRendererAccelMode] -> ShowS
    Show)

    {-# LINE 94 "./Graphics/UI/Gtk/ModelView/CellRendererAccel.chs" #-}

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

    -- | Creates a new 'CellRendererAccel'.
    --
    -- * Available since Gtk+ version 2.10
    --
    cellRendererAccelNew :: IO CellRendererAccel
    cellRendererAccelNew :: IO CellRendererAccel
    cellRendererAccelNew =
      (ForeignPtr CellRendererAccel -> CellRendererAccel,
     FinalizerPtr CellRendererAccel)
    -> IO (Ptr CellRendererAccel) -> IO CellRendererAccel
    forall obj.
    GObjectClass obj =>
    (ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
    makeNewObject (ForeignPtr CellRendererAccel -> CellRendererAccel,
     FinalizerPtr CellRendererAccel)
    forall {a}.
    (ForeignPtr CellRendererAccel -> CellRendererAccel, FinalizerPtr a)
    mkCellRendererAccel (IO (Ptr CellRendererAccel) -> IO CellRendererAccel)
    -> IO (Ptr CellRendererAccel) -> IO CellRendererAccel
    forall a b. (a -> b) -> a -> b
    $ (Ptr CellRenderer -> Ptr CellRendererAccel)
    -> IO (Ptr CellRenderer) -> IO (Ptr CellRendererAccel)
    forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
    liftM Ptr CellRenderer -> Ptr CellRendererAccel
    forall a b. Ptr a -> Ptr b
    castPtr (IO (Ptr CellRenderer) -> IO (Ptr CellRendererAccel))
    -> IO (Ptr CellRenderer) -> IO (Ptr CellRendererAccel)
    forall a b. (a -> b) -> a -> b
    $
      IO (Ptr CellRenderer)
    gtk_cell_renderer_accel_new
    {-# LINE 106 "./Graphics/UI/Gtk/ModelView/CellRendererAccel.chs" #-}

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

    -- | The keyval of the accelerator.
    --
    -- Allowed values: <= GMaxint
    --
    -- Default value: 0
    --
    -- * Available since Gtk+ version 2.10
    --
    cellRendererAccelAccelKey :: CellRendererAccelClass self => Attr self Int
    cellRendererAccelAccelKey :: forall self. CellRendererAccelClass self => Attr self Int
    cellRendererAccelAccelKey = String -> Attr self Int
    forall gobj. GObjectClass gobj => String -> Attr gobj Int
    newAttrFromUIntProperty String
    "accel-key"

    -- | The modifier mask of the accelerator.
    --
    -- * Available since Gtk+ version 2.10
    --
    cellRendererAccelAccelMods :: CellRendererAccelClass self => Attr self [Modifier]
    cellRendererAccelAccelMods :: forall self. CellRendererAccelClass self => Attr self [Modifier]
    cellRendererAccelAccelMods = String -> GType -> Attr self [Modifier]
    forall gobj flag.
    (GObjectClass gobj, Flags flag) =>
    String -> GType -> Attr gobj [flag]
    newAttrFromFlagsProperty String
    "accel-mods"
                                   GType
    gdk_modifier_type_get_type
    {-# LINE 128 "./Graphics/UI/Gtk/ModelView/CellRendererAccel.chs" #-}

    -- | The hardware keycode of the accelerator. Note that the hardware keycode is only relevant if the key
    -- does not have a keyval. Normally, the keyboard configuration should assign keyvals to all keys.
    --
    -- Allowed values: <= GMaxint
    --
    -- Default value: 0
    --
    -- * Available since Gtk+ version 2.10
    --
    cellRendererAccelKeycode :: CellRendererAccelClass self => Attr self Int
    cellRendererAccelKeycode :: forall self. CellRendererAccelClass self => Attr self Int
    cellRendererAccelKeycode = String -> Attr self Int
    forall gobj. GObjectClass gobj => String -> Attr gobj Int
    newAttrFromUIntProperty String
    "keycode"

    -- | Determines if the edited accelerators are GTK+ accelerators. If they are, consumed modifiers are
    -- suppressed, only accelerators accepted by GTK+ are allowed, and the accelerators are rendered in the
    -- same way as they are in menus.
    --
    -- Default value: 'CellRendererAccelModeGtk'
    --
    -- * Available since Gtk+ version 2.10
    --
    cellRendererAccelAccelMode :: CellRendererAccelClass self => Attr self CellRendererAccelMode
    cellRendererAccelAccelMode :: forall self.
    CellRendererAccelClass self =>
    Attr self CellRendererAccelMode
    cellRendererAccelAccelMode = String -> GType -> Attr self CellRendererAccelMode
    forall gobj enum.
    (GObjectClass gobj, Enum enum) =>
    String -> GType -> Attr gobj enum
    newAttrFromEnumProperty String
    "accel-mode"
                                   GType
    gtk_cell_renderer_accel_mode_get_type
    {-# LINE 152 "./Graphics/UI/Gtk/ModelView/CellRendererAccel.chs" #-}

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

    -- | Gets emitted when the user has selected a new accelerator.
    --
    -- * Available since Gtk+ version 2.10
    --
    accelEdited :: (CellRendererAccelClass self, GlibString string) => Signal self (string -> KeyVal -> Modifier -> KeyCode -> IO ())
    accelEdited :: forall self string.
    (CellRendererAccelClass self, GlibString string) =>
    Signal self (string -> KeyVal -> Modifier -> KeyCode -> IO ())
    accelEdited = (Bool
     -> self
     -> (string -> KeyVal -> Modifier -> KeyCode -> IO ())
     -> IO (ConnectId self))
    -> Signal self (string -> KeyVal -> Modifier -> KeyCode -> IO ())
    forall object handler.
    (Bool -> object -> handler -> IO (ConnectId object))
    -> Signal object handler
    Signal (\Bool
    after self
    obj string -> KeyVal -> Modifier -> KeyCode -> IO ()
    user -> String
    -> Bool
    -> self
    -> (string -> Int -> Modifier -> Int -> IO ())
    -> IO (ConnectId self)
    forall a' c obj.
    (GlibString a', Enum c, GObjectClass obj) =>
    String
    -> Bool
    -> obj
    -> (a' -> Int -> c -> Int -> IO ())
    -> IO (ConnectId obj)
    connect_GLIBSTRING_INT_ENUM_INT__NONE String
    "accel_edited" Bool
    after self
    obj
                          (\ string
    path Int
    keyval Modifier
    modifier Int
    keycode ->
                            string -> KeyVal -> Modifier -> KeyCode -> IO ()
    user string
    path (Int -> KeyVal
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Int
    keyval) Modifier
    modifier (Int -> KeyCode
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Int
    keycode)))

    -- | Gets emitted when the user has removed the accelerator.
    --
    -- * Available since Gtk+ version 2.10
    --
    accelCleared :: (CellRendererAccelClass self, GlibString string) => Signal self (string -> IO ())
    accelCleared :: forall self string.
    (CellRendererAccelClass self, GlibString string) =>
    Signal self (string -> IO ())
    accelCleared = (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
    "accel_cleared")

    foreign import ccall safe "gtk_cell_renderer_accel_new"
      gtk_cell_renderer_accel_new :: (IO (Ptr CellRenderer))

    foreign import ccall unsafe "gdk_modifier_type_get_type"
      gdk_modifier_type_get_type :: CULong

    foreign import ccall unsafe "gtk_cell_renderer_accel_mode_get_type"
      gtk_cell_renderer_accel_mode_get_type :: CULong