{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)

/No description available in the introspection data./
-}

#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
       && !defined(__HADDOCK_VERSION__))

module GI.Handy.Objects.HeaderGroup
    (

-- * Exported types
    HeaderGroup(..)                         ,
    IsHeaderGroup                           ,
    toHeaderGroup                           ,
    noHeaderGroup                           ,


 -- * Methods
-- ** addHeaderBar #method:addHeaderBar#

#if ENABLE_OVERLOADING
    HeaderGroupAddHeaderBarMethodInfo       ,
#endif
    headerGroupAddHeaderBar                 ,


-- ** getFocus #method:getFocus#

#if ENABLE_OVERLOADING
    HeaderGroupGetFocusMethodInfo           ,
#endif
    headerGroupGetFocus                     ,


-- ** getHeaderBars #method:getHeaderBars#

#if ENABLE_OVERLOADING
    HeaderGroupGetHeaderBarsMethodInfo      ,
#endif
    headerGroupGetHeaderBars                ,


-- ** new #method:new#

    headerGroupNew                          ,


-- ** removeHeaderBar #method:removeHeaderBar#

#if ENABLE_OVERLOADING
    HeaderGroupRemoveHeaderBarMethodInfo    ,
#endif
    headerGroupRemoveHeaderBar              ,


-- ** setFocus #method:setFocus#

#if ENABLE_OVERLOADING
    HeaderGroupSetFocusMethodInfo           ,
#endif
    headerGroupSetFocus                     ,




 -- * Properties
-- ** focus #attr:focus#
{- | The the currently focused header bar. If 'Nothing', the decoration will be
spread as if the header bars of the group were only one, otherwise the
focused header bar will be the only one to receive the decoration.
-}
#if ENABLE_OVERLOADING
    HeaderGroupFocusPropertyInfo            ,
#endif
    clearHeaderGroupFocus                   ,
    constructHeaderGroupFocus               ,
    getHeaderGroupFocus                     ,
#if ENABLE_OVERLOADING
    headerGroupFocus                        ,
#endif
    setHeaderGroupFocus                     ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gtk.Interfaces.Buildable as Gtk.Buildable
import qualified GI.Gtk.Objects.HeaderBar as Gtk.HeaderBar

-- | Memory-managed wrapper type.
newtype HeaderGroup = HeaderGroup (ManagedPtr HeaderGroup)
foreign import ccall "hdy_header_group_get_type"
    c_hdy_header_group_get_type :: IO GType

instance GObject HeaderGroup where
    gobjectType = c_hdy_header_group_get_type


-- | Type class for types which can be safely cast to `HeaderGroup`, for instance with `toHeaderGroup`.
class (GObject o, O.IsDescendantOf HeaderGroup o) => IsHeaderGroup o
instance (GObject o, O.IsDescendantOf HeaderGroup o) => IsHeaderGroup o

instance O.HasParentTypes HeaderGroup
type instance O.ParentTypes HeaderGroup = '[GObject.Object.Object, Gtk.Buildable.Buildable]

-- | Cast to `HeaderGroup`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toHeaderGroup :: (MonadIO m, IsHeaderGroup o) => o -> m HeaderGroup
toHeaderGroup = liftIO . unsafeCastTo HeaderGroup

-- | A convenience alias for `Nothing` :: `Maybe` `HeaderGroup`.
noHeaderGroup :: Maybe HeaderGroup
noHeaderGroup = Nothing

#if ENABLE_OVERLOADING
type family ResolveHeaderGroupMethod (t :: Symbol) (o :: *) :: * where
    ResolveHeaderGroupMethod "addChild" o = Gtk.Buildable.BuildableAddChildMethodInfo
    ResolveHeaderGroupMethod "addHeaderBar" o = HeaderGroupAddHeaderBarMethodInfo
    ResolveHeaderGroupMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveHeaderGroupMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveHeaderGroupMethod "constructChild" o = Gtk.Buildable.BuildableConstructChildMethodInfo
    ResolveHeaderGroupMethod "customFinished" o = Gtk.Buildable.BuildableCustomFinishedMethodInfo
    ResolveHeaderGroupMethod "customTagEnd" o = Gtk.Buildable.BuildableCustomTagEndMethodInfo
    ResolveHeaderGroupMethod "customTagStart" o = Gtk.Buildable.BuildableCustomTagStartMethodInfo
    ResolveHeaderGroupMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveHeaderGroupMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveHeaderGroupMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveHeaderGroupMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveHeaderGroupMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveHeaderGroupMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveHeaderGroupMethod "parserFinished" o = Gtk.Buildable.BuildableParserFinishedMethodInfo
    ResolveHeaderGroupMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveHeaderGroupMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveHeaderGroupMethod "removeHeaderBar" o = HeaderGroupRemoveHeaderBarMethodInfo
    ResolveHeaderGroupMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveHeaderGroupMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveHeaderGroupMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveHeaderGroupMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveHeaderGroupMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveHeaderGroupMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveHeaderGroupMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveHeaderGroupMethod "getFocus" o = HeaderGroupGetFocusMethodInfo
    ResolveHeaderGroupMethod "getHeaderBars" o = HeaderGroupGetHeaderBarsMethodInfo
    ResolveHeaderGroupMethod "getInternalChild" o = Gtk.Buildable.BuildableGetInternalChildMethodInfo
    ResolveHeaderGroupMethod "getName" o = Gtk.Buildable.BuildableGetNameMethodInfo
    ResolveHeaderGroupMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveHeaderGroupMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveHeaderGroupMethod "setBuildableProperty" o = Gtk.Buildable.BuildableSetBuildablePropertyMethodInfo
    ResolveHeaderGroupMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveHeaderGroupMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveHeaderGroupMethod "setFocus" o = HeaderGroupSetFocusMethodInfo
    ResolveHeaderGroupMethod "setName" o = Gtk.Buildable.BuildableSetNameMethodInfo
    ResolveHeaderGroupMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveHeaderGroupMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveHeaderGroupMethod t HeaderGroup, O.MethodInfo info HeaderGroup p) => OL.IsLabel t (HeaderGroup -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

#endif

-- VVV Prop "focus"
   -- Type: TInterface (Name {namespace = "Gtk", name = "HeaderBar"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just True,Just True)

{- |
Get the value of the “@focus@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' headerGroup #focus
@
-}
getHeaderGroupFocus :: (MonadIO m, IsHeaderGroup o) => o -> m (Maybe Gtk.HeaderBar.HeaderBar)
getHeaderGroupFocus obj = liftIO $ B.Properties.getObjectPropertyObject obj "focus" Gtk.HeaderBar.HeaderBar

{- |
Set the value of the “@focus@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' headerGroup [ #focus 'Data.GI.Base.Attributes.:=' value ]
@
-}
setHeaderGroupFocus :: (MonadIO m, IsHeaderGroup o, Gtk.HeaderBar.IsHeaderBar a) => o -> a -> m ()
setHeaderGroupFocus obj val = liftIO $ B.Properties.setObjectPropertyObject obj "focus" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@focus@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructHeaderGroupFocus :: (IsHeaderGroup o, Gtk.HeaderBar.IsHeaderBar a) => a -> IO (GValueConstruct o)
constructHeaderGroupFocus val = B.Properties.constructObjectPropertyObject "focus" (Just val)

{- |
Set the value of the “@focus@” property to `Nothing`.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.clear' #focus
@
-}
clearHeaderGroupFocus :: (MonadIO m, IsHeaderGroup o) => o -> m ()
clearHeaderGroupFocus obj = liftIO $ B.Properties.setObjectPropertyObject obj "focus" (Nothing :: Maybe Gtk.HeaderBar.HeaderBar)

#if ENABLE_OVERLOADING
data HeaderGroupFocusPropertyInfo
instance AttrInfo HeaderGroupFocusPropertyInfo where
    type AttrAllowedOps HeaderGroupFocusPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint HeaderGroupFocusPropertyInfo = Gtk.HeaderBar.IsHeaderBar
    type AttrBaseTypeConstraint HeaderGroupFocusPropertyInfo = IsHeaderGroup
    type AttrGetType HeaderGroupFocusPropertyInfo = (Maybe Gtk.HeaderBar.HeaderBar)
    type AttrLabel HeaderGroupFocusPropertyInfo = "focus"
    type AttrOrigin HeaderGroupFocusPropertyInfo = HeaderGroup
    attrGet _ = getHeaderGroupFocus
    attrSet _ = setHeaderGroupFocus
    attrConstruct _ = constructHeaderGroupFocus
    attrClear _ = clearHeaderGroupFocus
#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList HeaderGroup
type instance O.AttributeList HeaderGroup = HeaderGroupAttributeList
type HeaderGroupAttributeList = ('[ '("focus", HeaderGroupFocusPropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
headerGroupFocus :: AttrLabelProxy "focus"
headerGroupFocus = AttrLabelProxy

#endif

#if ENABLE_OVERLOADING
type instance O.SignalList HeaderGroup = HeaderGroupSignalList
type HeaderGroupSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method HeaderGroup::new
-- method type : Constructor
-- Args : []
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Handy", name = "HeaderGroup"}))
-- throws : False
-- Skip return : False

foreign import ccall "hdy_header_group_new" hdy_header_group_new ::
    IO (Ptr HeaderGroup)

{- |
/No description available in the introspection data./
-}
headerGroupNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m HeaderGroup
headerGroupNew  = liftIO $ do
    result <- hdy_header_group_new
    checkUnexpectedReturnNULL "headerGroupNew" result
    result' <- (wrapObject HeaderGroup) result
    return result'

#if ENABLE_OVERLOADING
#endif

-- method HeaderGroup::add_header_bar
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Handy", name = "HeaderGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #HdyHeaderGroup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "header_bar", argType = TInterface (Name {namespace = "Gtk", name = "HeaderBar"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GtkHeaderBar to add", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hdy_header_group_add_header_bar" hdy_header_group_add_header_bar ::
    Ptr HeaderGroup ->                      -- self : TInterface (Name {namespace = "Handy", name = "HeaderGroup"})
    Ptr Gtk.HeaderBar.HeaderBar ->          -- header_bar : TInterface (Name {namespace = "Gtk", name = "HeaderBar"})
    IO ()

{- |
Adds a header bar to a 'GI.Handy.Objects.HeaderGroup.HeaderGroup'. The decoration layout of the
widgets will be edited depending on their position in the composite header
bar, the start widget displaying only the start of the user\'s decoration
layout and the end widget displaying only its end while widgets in the middle
won\'t display anything. A header bar can be set as having the focus to
display all the decorations. See 'GI.Gtk.Objects.HeaderBar.headerBarSetDecorationLayout'.

When the widget is destroyed or no longer referenced elsewhere, it will
be removed from the header group.
-}
headerGroupAddHeaderBar ::
    (B.CallStack.HasCallStack, MonadIO m, IsHeaderGroup a, Gtk.HeaderBar.IsHeaderBar b) =>
    a
    {- ^ /@self@/: a 'GI.Handy.Objects.HeaderGroup.HeaderGroup' -}
    -> b
    {- ^ /@headerBar@/: the 'GI.Gtk.Objects.HeaderBar.HeaderBar' to add -}
    -> m ()
headerGroupAddHeaderBar self headerBar = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    headerBar' <- unsafeManagedPtrCastPtr headerBar
    hdy_header_group_add_header_bar self' headerBar'
    touchManagedPtr self
    touchManagedPtr headerBar
    return ()

#if ENABLE_OVERLOADING
data HeaderGroupAddHeaderBarMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsHeaderGroup a, Gtk.HeaderBar.IsHeaderBar b) => O.MethodInfo HeaderGroupAddHeaderBarMethodInfo a signature where
    overloadedMethod _ = headerGroupAddHeaderBar

#endif

-- method HeaderGroup::get_focus
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Handy", name = "HeaderGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #HdyHeaderGroup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "HeaderBar"}))
-- throws : False
-- Skip return : False

foreign import ccall "hdy_header_group_get_focus" hdy_header_group_get_focus ::
    Ptr HeaderGroup ->                      -- self : TInterface (Name {namespace = "Handy", name = "HeaderGroup"})
    IO (Ptr Gtk.HeaderBar.HeaderBar)

{- |
/No description available in the introspection data./
-}
headerGroupGetFocus ::
    (B.CallStack.HasCallStack, MonadIO m, IsHeaderGroup a) =>
    a
    {- ^ /@self@/: a 'GI.Handy.Objects.HeaderGroup.HeaderGroup' -}
    -> m (Maybe Gtk.HeaderBar.HeaderBar)
    {- ^ __Returns:__ The currently focused header bar -}
headerGroupGetFocus self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- hdy_header_group_get_focus self'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newObject Gtk.HeaderBar.HeaderBar) result'
        return result''
    touchManagedPtr self
    return maybeResult

#if ENABLE_OVERLOADING
data HeaderGroupGetFocusMethodInfo
instance (signature ~ (m (Maybe Gtk.HeaderBar.HeaderBar)), MonadIO m, IsHeaderGroup a) => O.MethodInfo HeaderGroupGetFocusMethodInfo a signature where
    overloadedMethod _ = headerGroupGetFocus

#endif

-- method HeaderGroup::get_header_bars
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Handy", name = "HeaderGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #HdyHeaderGroup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TGSList (TInterface (Name {namespace = "Gtk", name = "HeaderBar"})))
-- throws : False
-- Skip return : False

foreign import ccall "hdy_header_group_get_header_bars" hdy_header_group_get_header_bars ::
    Ptr HeaderGroup ->                      -- self : TInterface (Name {namespace = "Handy", name = "HeaderGroup"})
    IO (Ptr (GSList (Ptr Gtk.HeaderBar.HeaderBar)))

{- |
Returns the list of headerbars associated with /@self@/.
-}
headerGroupGetHeaderBars ::
    (B.CallStack.HasCallStack, MonadIO m, IsHeaderGroup a) =>
    a
    {- ^ /@self@/: a 'GI.Handy.Objects.HeaderGroup.HeaderGroup' -}
    -> m [Gtk.HeaderBar.HeaderBar]
    {- ^ __Returns:__ a 'GI.GLib.Structs.SList.SList' of
  headerbars. The list is owned by libhandy and should not be modified. -}
headerGroupGetHeaderBars self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- hdy_header_group_get_header_bars self'
    result' <- unpackGSList result
    result'' <- mapM (newObject Gtk.HeaderBar.HeaderBar) result'
    touchManagedPtr self
    return result''

#if ENABLE_OVERLOADING
data HeaderGroupGetHeaderBarsMethodInfo
instance (signature ~ (m [Gtk.HeaderBar.HeaderBar]), MonadIO m, IsHeaderGroup a) => O.MethodInfo HeaderGroupGetHeaderBarsMethodInfo a signature where
    overloadedMethod _ = headerGroupGetHeaderBars

#endif

-- method HeaderGroup::remove_header_bar
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Handy", name = "HeaderGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #HdyHeaderGroup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "header_bar", argType = TInterface (Name {namespace = "Gtk", name = "HeaderBar"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GtkHeaderBar to remove", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hdy_header_group_remove_header_bar" hdy_header_group_remove_header_bar ::
    Ptr HeaderGroup ->                      -- self : TInterface (Name {namespace = "Handy", name = "HeaderGroup"})
    Ptr Gtk.HeaderBar.HeaderBar ->          -- header_bar : TInterface (Name {namespace = "Gtk", name = "HeaderBar"})
    IO ()

{- |
Removes a widget from a 'GI.Handy.Objects.HeaderGroup.HeaderGroup'
-}
headerGroupRemoveHeaderBar ::
    (B.CallStack.HasCallStack, MonadIO m, IsHeaderGroup a, Gtk.HeaderBar.IsHeaderBar b) =>
    a
    {- ^ /@self@/: a 'GI.Handy.Objects.HeaderGroup.HeaderGroup' -}
    -> b
    {- ^ /@headerBar@/: the 'GI.Gtk.Objects.HeaderBar.HeaderBar' to remove -}
    -> m ()
headerGroupRemoveHeaderBar self headerBar = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    headerBar' <- unsafeManagedPtrCastPtr headerBar
    hdy_header_group_remove_header_bar self' headerBar'
    touchManagedPtr self
    touchManagedPtr headerBar
    return ()

#if ENABLE_OVERLOADING
data HeaderGroupRemoveHeaderBarMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsHeaderGroup a, Gtk.HeaderBar.IsHeaderBar b) => O.MethodInfo HeaderGroupRemoveHeaderBarMethodInfo a signature where
    overloadedMethod _ = headerGroupRemoveHeaderBar

#endif

-- method HeaderGroup::set_focus
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "Handy", name = "HeaderGroup"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #HdyHeaderGroup", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "header_bar", argType = TInterface (Name {namespace = "Gtk", name = "HeaderBar"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GtkHeaderBar of @self, or %NULL", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "hdy_header_group_set_focus" hdy_header_group_set_focus ::
    Ptr HeaderGroup ->                      -- self : TInterface (Name {namespace = "Handy", name = "HeaderGroup"})
    Ptr Gtk.HeaderBar.HeaderBar ->          -- header_bar : TInterface (Name {namespace = "Gtk", name = "HeaderBar"})
    IO ()

{- |
Sets the the currently focused header bar. If /@headerBar@/ is 'Nothing', the
decoration will be spread as if the header bars of the group were only one,
otherwise /@headerBar@/ will be the only one to receive the decoration.
-}
headerGroupSetFocus ::
    (B.CallStack.HasCallStack, MonadIO m, IsHeaderGroup a, Gtk.HeaderBar.IsHeaderBar b) =>
    a
    {- ^ /@self@/: a 'GI.Handy.Objects.HeaderGroup.HeaderGroup' -}
    -> Maybe (b)
    {- ^ /@headerBar@/: a 'GI.Gtk.Objects.HeaderBar.HeaderBar' of /@self@/, or 'Nothing' -}
    -> m ()
headerGroupSetFocus self headerBar = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeHeaderBar <- case headerBar of
        Nothing -> return nullPtr
        Just jHeaderBar -> do
            jHeaderBar' <- unsafeManagedPtrCastPtr jHeaderBar
            return jHeaderBar'
    hdy_header_group_set_focus self' maybeHeaderBar
    touchManagedPtr self
    whenJust headerBar touchManagedPtr
    return ()

#if ENABLE_OVERLOADING
data HeaderGroupSetFocusMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsHeaderGroup a, Gtk.HeaderBar.IsHeaderBar b) => O.MethodInfo HeaderGroupSetFocusMethodInfo a signature where
    overloadedMethod _ = headerGroupSetFocus

#endif