{- |
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.OSTree.Structs.BootloaderInterface
    (

-- * Exported types
    BootloaderInterface(..)                 ,
    newZeroBootloaderInterface              ,
    noBootloaderInterface                   ,


 -- * Properties
-- ** gIface #attr:gIface#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    bootloaderInterface_gIface              ,
#endif
    getBootloaderInterfaceGIface            ,


-- ** getName #attr:getName#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    bootloaderInterface_getName             ,
#endif
    clearBootloaderInterfaceGetName         ,
    getBootloaderInterfaceGetName           ,
    setBootloaderInterfaceGetName           ,


-- ** isAtomic #attr:isAtomic#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    bootloaderInterface_isAtomic            ,
#endif
    clearBootloaderInterfaceIsAtomic        ,
    getBootloaderInterfaceIsAtomic          ,
    setBootloaderInterfaceIsAtomic          ,


-- ** query #attr:query#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    bootloaderInterface_query               ,
#endif
    clearBootloaderInterfaceQuery           ,
    getBootloaderInterfaceQuery             ,
    setBootloaderInterfaceQuery             ,




    ) 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.Structs.TypeInterface as GObject.TypeInterface
import qualified GI.OSTree.Callbacks as OSTree.Callbacks

-- | Memory-managed wrapper type.
newtype BootloaderInterface = BootloaderInterface (ManagedPtr BootloaderInterface)
instance WrappedPtr BootloaderInterface where
    wrappedPtrCalloc = callocBytes 48
    wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 48 >=> wrapPtr BootloaderInterface)
    wrappedPtrFree = Just ptr_to_g_free

-- | Construct a `BootloaderInterface` struct initialized to zero.
newZeroBootloaderInterface :: MonadIO m => m BootloaderInterface
newZeroBootloaderInterface = liftIO $ wrappedPtrCalloc >>= wrapPtr BootloaderInterface

instance tag ~ 'AttrSet => Constructible BootloaderInterface tag where
    new _ attrs = do
        o <- newZeroBootloaderInterface
        GI.Attributes.set o attrs
        return o


-- | A convenience alias for `Nothing` :: `Maybe` `BootloaderInterface`.
noBootloaderInterface :: Maybe BootloaderInterface
noBootloaderInterface = Nothing

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

@
'Data.GI.Base.Attributes.get' bootloaderInterface #gIface
@
-}
getBootloaderInterfaceGIface :: MonadIO m => BootloaderInterface -> m GObject.TypeInterface.TypeInterface
getBootloaderInterfaceGIface s = liftIO $ withManagedPtr s $ \ptr -> do
    let val = ptr `plusPtr` 0 :: (Ptr GObject.TypeInterface.TypeInterface)
    val' <- (newPtr GObject.TypeInterface.TypeInterface) val
    return val'

#if ENABLE_OVERLOADING
data BootloaderInterfaceGIfaceFieldInfo
instance AttrInfo BootloaderInterfaceGIfaceFieldInfo where
    type AttrAllowedOps BootloaderInterfaceGIfaceFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint BootloaderInterfaceGIfaceFieldInfo = (~) (Ptr GObject.TypeInterface.TypeInterface)
    type AttrBaseTypeConstraint BootloaderInterfaceGIfaceFieldInfo = (~) BootloaderInterface
    type AttrGetType BootloaderInterfaceGIfaceFieldInfo = GObject.TypeInterface.TypeInterface
    type AttrLabel BootloaderInterfaceGIfaceFieldInfo = "g_iface"
    type AttrOrigin BootloaderInterfaceGIfaceFieldInfo = BootloaderInterface
    attrGet _ = getBootloaderInterfaceGIface
    attrSet _ = undefined
    attrConstruct = undefined
    attrClear _ = undefined

bootloaderInterface_gIface :: AttrLabelProxy "gIface"
bootloaderInterface_gIface = AttrLabelProxy

#endif


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

@
'Data.GI.Base.Attributes.get' bootloaderInterface #query
@
-}
getBootloaderInterfaceQuery :: MonadIO m => BootloaderInterface -> m (Maybe OSTree.Callbacks.BootloaderInterfaceQueryFieldCallback)
getBootloaderInterfaceQuery s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 16) :: IO (FunPtr OSTree.Callbacks.C_BootloaderInterfaceQueryFieldCallback)
    result <- SP.convertFunPtrIfNonNull val $ \val' -> do
        let val'' = OSTree.Callbacks.dynamic_BootloaderInterfaceQueryFieldCallback val'
        return val''
    return result

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

@
'Data.GI.Base.Attributes.set' bootloaderInterface [ #query 'Data.GI.Base.Attributes.:=' value ]
@
-}
setBootloaderInterfaceQuery :: MonadIO m => BootloaderInterface -> FunPtr OSTree.Callbacks.C_BootloaderInterfaceQueryFieldCallback -> m ()
setBootloaderInterfaceQuery s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 16) (val :: FunPtr OSTree.Callbacks.C_BootloaderInterfaceQueryFieldCallback)

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

@
'Data.GI.Base.Attributes.clear' #query
@
-}
clearBootloaderInterfaceQuery :: MonadIO m => BootloaderInterface -> m ()
clearBootloaderInterfaceQuery s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 16) (FP.nullFunPtr :: FunPtr OSTree.Callbacks.C_BootloaderInterfaceQueryFieldCallback)

#if ENABLE_OVERLOADING
data BootloaderInterfaceQueryFieldInfo
instance AttrInfo BootloaderInterfaceQueryFieldInfo where
    type AttrAllowedOps BootloaderInterfaceQueryFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint BootloaderInterfaceQueryFieldInfo = (~) (FunPtr OSTree.Callbacks.C_BootloaderInterfaceQueryFieldCallback)
    type AttrBaseTypeConstraint BootloaderInterfaceQueryFieldInfo = (~) BootloaderInterface
    type AttrGetType BootloaderInterfaceQueryFieldInfo = Maybe OSTree.Callbacks.BootloaderInterfaceQueryFieldCallback
    type AttrLabel BootloaderInterfaceQueryFieldInfo = "query"
    type AttrOrigin BootloaderInterfaceQueryFieldInfo = BootloaderInterface
    attrGet _ = getBootloaderInterfaceQuery
    attrSet _ = setBootloaderInterfaceQuery
    attrConstruct = undefined
    attrClear _ = clearBootloaderInterfaceQuery

bootloaderInterface_query :: AttrLabelProxy "query"
bootloaderInterface_query = AttrLabelProxy

#endif


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

@
'Data.GI.Base.Attributes.get' bootloaderInterface #getName
@
-}
getBootloaderInterfaceGetName :: MonadIO m => BootloaderInterface -> m (Maybe OSTree.Callbacks.BootloaderInterfaceGetNameFieldCallback)
getBootloaderInterfaceGetName s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 24) :: IO (FunPtr OSTree.Callbacks.C_BootloaderInterfaceGetNameFieldCallback)
    result <- SP.convertFunPtrIfNonNull val $ \val' -> do
        let val'' = OSTree.Callbacks.dynamic_BootloaderInterfaceGetNameFieldCallback val'
        return val''
    return result

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

@
'Data.GI.Base.Attributes.set' bootloaderInterface [ #getName 'Data.GI.Base.Attributes.:=' value ]
@
-}
setBootloaderInterfaceGetName :: MonadIO m => BootloaderInterface -> FunPtr OSTree.Callbacks.C_BootloaderInterfaceGetNameFieldCallback -> m ()
setBootloaderInterfaceGetName s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 24) (val :: FunPtr OSTree.Callbacks.C_BootloaderInterfaceGetNameFieldCallback)

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

@
'Data.GI.Base.Attributes.clear' #getName
@
-}
clearBootloaderInterfaceGetName :: MonadIO m => BootloaderInterface -> m ()
clearBootloaderInterfaceGetName s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 24) (FP.nullFunPtr :: FunPtr OSTree.Callbacks.C_BootloaderInterfaceGetNameFieldCallback)

#if ENABLE_OVERLOADING
data BootloaderInterfaceGetNameFieldInfo
instance AttrInfo BootloaderInterfaceGetNameFieldInfo where
    type AttrAllowedOps BootloaderInterfaceGetNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint BootloaderInterfaceGetNameFieldInfo = (~) (FunPtr OSTree.Callbacks.C_BootloaderInterfaceGetNameFieldCallback)
    type AttrBaseTypeConstraint BootloaderInterfaceGetNameFieldInfo = (~) BootloaderInterface
    type AttrGetType BootloaderInterfaceGetNameFieldInfo = Maybe OSTree.Callbacks.BootloaderInterfaceGetNameFieldCallback
    type AttrLabel BootloaderInterfaceGetNameFieldInfo = "get_name"
    type AttrOrigin BootloaderInterfaceGetNameFieldInfo = BootloaderInterface
    attrGet _ = getBootloaderInterfaceGetName
    attrSet _ = setBootloaderInterfaceGetName
    attrConstruct = undefined
    attrClear _ = clearBootloaderInterfaceGetName

bootloaderInterface_getName :: AttrLabelProxy "getName"
bootloaderInterface_getName = AttrLabelProxy

#endif


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

@
'Data.GI.Base.Attributes.get' bootloaderInterface #isAtomic
@
-}
getBootloaderInterfaceIsAtomic :: MonadIO m => BootloaderInterface -> m (Maybe OSTree.Callbacks.BootloaderInterfaceIsAtomicFieldCallback)
getBootloaderInterfaceIsAtomic s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 40) :: IO (FunPtr OSTree.Callbacks.C_BootloaderInterfaceIsAtomicFieldCallback)
    result <- SP.convertFunPtrIfNonNull val $ \val' -> do
        let val'' = OSTree.Callbacks.dynamic_BootloaderInterfaceIsAtomicFieldCallback val'
        return val''
    return result

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

@
'Data.GI.Base.Attributes.set' bootloaderInterface [ #isAtomic 'Data.GI.Base.Attributes.:=' value ]
@
-}
setBootloaderInterfaceIsAtomic :: MonadIO m => BootloaderInterface -> FunPtr OSTree.Callbacks.C_BootloaderInterfaceIsAtomicFieldCallback -> m ()
setBootloaderInterfaceIsAtomic s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 40) (val :: FunPtr OSTree.Callbacks.C_BootloaderInterfaceIsAtomicFieldCallback)

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

@
'Data.GI.Base.Attributes.clear' #isAtomic
@
-}
clearBootloaderInterfaceIsAtomic :: MonadIO m => BootloaderInterface -> m ()
clearBootloaderInterfaceIsAtomic s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 40) (FP.nullFunPtr :: FunPtr OSTree.Callbacks.C_BootloaderInterfaceIsAtomicFieldCallback)

#if ENABLE_OVERLOADING
data BootloaderInterfaceIsAtomicFieldInfo
instance AttrInfo BootloaderInterfaceIsAtomicFieldInfo where
    type AttrAllowedOps BootloaderInterfaceIsAtomicFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint BootloaderInterfaceIsAtomicFieldInfo = (~) (FunPtr OSTree.Callbacks.C_BootloaderInterfaceIsAtomicFieldCallback)
    type AttrBaseTypeConstraint BootloaderInterfaceIsAtomicFieldInfo = (~) BootloaderInterface
    type AttrGetType BootloaderInterfaceIsAtomicFieldInfo = Maybe OSTree.Callbacks.BootloaderInterfaceIsAtomicFieldCallback
    type AttrLabel BootloaderInterfaceIsAtomicFieldInfo = "is_atomic"
    type AttrOrigin BootloaderInterfaceIsAtomicFieldInfo = BootloaderInterface
    attrGet _ = getBootloaderInterfaceIsAtomic
    attrSet _ = setBootloaderInterfaceIsAtomic
    attrConstruct = undefined
    attrClear _ = clearBootloaderInterfaceIsAtomic

bootloaderInterface_isAtomic :: AttrLabelProxy "isAtomic"
bootloaderInterface_isAtomic = AttrLabelProxy

#endif



#if ENABLE_OVERLOADING
instance O.HasAttributeList BootloaderInterface
type instance O.AttributeList BootloaderInterface = BootloaderInterfaceAttributeList
type BootloaderInterfaceAttributeList = ('[ '("gIface", BootloaderInterfaceGIfaceFieldInfo), '("query", BootloaderInterfaceQueryFieldInfo), '("getName", BootloaderInterfaceGetNameFieldInfo), '("isAtomic", BootloaderInterfaceIsAtomicFieldInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
type family ResolveBootloaderInterfaceMethod (t :: Symbol) (o :: *) :: * where
    ResolveBootloaderInterfaceMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveBootloaderInterfaceMethod t BootloaderInterface, O.MethodInfo info BootloaderInterface p) => OL.IsLabel t (BootloaderInterface -> 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