{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- WpSettingSpec holds the specification of a setting.

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

module GI.Wp.Structs.SettingsSpec
    ( 

-- * Exported types
    SettingsSpec(..)                        ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [checkValue]("GI.Wp.Structs.SettingsSpec#g:method:checkValue"), [ref]("GI.Wp.Structs.SettingsSpec#g:method:ref"), [unref]("GI.Wp.Structs.SettingsSpec#g:method:unref").
-- 
-- ==== Getters
-- [getDefaultValue]("GI.Wp.Structs.SettingsSpec#g:method:getDefaultValue"), [getDescription]("GI.Wp.Structs.SettingsSpec#g:method:getDescription"), [getMaxValue]("GI.Wp.Structs.SettingsSpec#g:method:getMaxValue"), [getMinValue]("GI.Wp.Structs.SettingsSpec#g:method:getMinValue"), [getName]("GI.Wp.Structs.SettingsSpec#g:method:getName"), [getValueType]("GI.Wp.Structs.SettingsSpec#g:method:getValueType").
-- 
-- ==== Setters
-- /None/.

#if defined(ENABLE_OVERLOADING)
    ResolveSettingsSpecMethod               ,
#endif

-- ** checkValue #method:checkValue#

#if defined(ENABLE_OVERLOADING)
    SettingsSpecCheckValueMethodInfo        ,
#endif
    settingsSpecCheckValue                  ,


-- ** getDefaultValue #method:getDefaultValue#

#if defined(ENABLE_OVERLOADING)
    SettingsSpecGetDefaultValueMethodInfo   ,
#endif
    settingsSpecGetDefaultValue             ,


-- ** getDescription #method:getDescription#

#if defined(ENABLE_OVERLOADING)
    SettingsSpecGetDescriptionMethodInfo    ,
#endif
    settingsSpecGetDescription              ,


-- ** getMaxValue #method:getMaxValue#

#if defined(ENABLE_OVERLOADING)
    SettingsSpecGetMaxValueMethodInfo       ,
#endif
    settingsSpecGetMaxValue                 ,


-- ** getMinValue #method:getMinValue#

#if defined(ENABLE_OVERLOADING)
    SettingsSpecGetMinValueMethodInfo       ,
#endif
    settingsSpecGetMinValue                 ,


-- ** getName #method:getName#

#if defined(ENABLE_OVERLOADING)
    SettingsSpecGetNameMethodInfo           ,
#endif
    settingsSpecGetName                     ,


-- ** getValueType #method:getValueType#

#if defined(ENABLE_OVERLOADING)
    SettingsSpecGetValueTypeMethodInfo      ,
#endif
    settingsSpecGetValueType                ,


-- ** ref #method:ref#

#if defined(ENABLE_OVERLOADING)
    SettingsSpecRefMethodInfo               ,
#endif
    settingsSpecRef                         ,


-- ** unref #method:unref#

#if defined(ENABLE_OVERLOADING)
    SettingsSpecUnrefMethodInfo             ,
#endif
    settingsSpecUnref                       ,




    ) 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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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 GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT

-- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
#if MIN_VERSION_base(4,18,0)
import qualified GI.Wp.Callbacks as Wp.Callbacks
import {-# SOURCE #-} qualified GI.Wp.Enums as Wp.Enums
import {-# SOURCE #-} qualified GI.Wp.Structs.Iterator as Wp.Iterator
import {-# SOURCE #-} qualified GI.Wp.Structs.IteratorMethods as Wp.IteratorMethods
import {-# SOURCE #-} qualified GI.Wp.Structs.SpaJson as Wp.SpaJson

#else
import {-# SOURCE #-} qualified GI.Wp.Enums as Wp.Enums
import {-# SOURCE #-} qualified GI.Wp.Structs.SpaJson as Wp.SpaJson

#endif

-- | Memory-managed wrapper type.
newtype SettingsSpec = SettingsSpec (SP.ManagedPtr SettingsSpec)
    deriving (Eq)

instance SP.ManagedPtrNewtype SettingsSpec where
    toManagedPtr (SettingsSpec p) = p

foreign import ccall "wp_settings_spec_get_type" c_wp_settings_spec_get_type :: 
    IO GType

type instance O.ParentTypes SettingsSpec = '[]
instance O.HasParentTypes SettingsSpec

instance B.Types.TypedObject SettingsSpec where
    glibType = c_wp_settings_spec_get_type

instance B.Types.GBoxed SettingsSpec

-- | Convert t'SettingsSpec' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe SettingsSpec) where
    gvalueGType_ = c_wp_settings_spec_get_type
    gvalueSet_ gv P.Nothing = B.GValue.set_boxed gv (FP.nullPtr :: FP.Ptr SettingsSpec)
    gvalueSet_ gv (P.Just obj) = B.ManagedPtr.withManagedPtr obj (B.GValue.set_boxed gv)
    gvalueGet_ gv = do
        ptr <- B.GValue.get_boxed gv :: IO (Ptr SettingsSpec)
        if ptr /= FP.nullPtr
        then P.Just <$> B.ManagedPtr.newBoxed SettingsSpec ptr
        else return P.Nothing
        
    


#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SettingsSpec
type instance O.AttributeList SettingsSpec = SettingsSpecAttributeList
type SettingsSpecAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif

-- method SettingsSpec::check_value
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "SettingsSpec" }
--           , argCType = Just "WpSettingsSpec*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the settings spec object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the value to check" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "wp_settings_spec_check_value" wp_settings_spec_check_value :: 
    Ptr SettingsSpec ->                     -- self : TInterface (Name {namespace = "Wp", name = "SettingsSpec"})
    Ptr Wp.SpaJson.SpaJson ->               -- value : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    IO CInt

-- | Checks whether a value is compatible with the spec or not.
settingsSpecCheckValue ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SettingsSpec
    -- ^ /@self@/: the settings spec object
    -> Wp.SpaJson.SpaJson
    -- ^ /@value@/: the value to check
    -> m Bool
    -- ^ __Returns:__ TRUE if the value is compatible with the spec, FALSE otherwise
settingsSpecCheckValue self value = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    value' <- unsafeManagedPtrGetPtr value
    result <- wp_settings_spec_check_value self' value'
    let result' = (/= 0) result
    touchManagedPtr self
    touchManagedPtr value
    return result'

#if defined(ENABLE_OVERLOADING)
data SettingsSpecCheckValueMethodInfo
instance (signature ~ (Wp.SpaJson.SpaJson -> m Bool), MonadIO m) => O.OverloadedMethod SettingsSpecCheckValueMethodInfo SettingsSpec signature where
    overloadedMethod = settingsSpecCheckValue

instance O.OverloadedMethodInfo SettingsSpecCheckValueMethodInfo SettingsSpec where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SettingsSpec.settingsSpecCheckValue",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Structs-SettingsSpec.html#v:settingsSpecCheckValue"
        })


#endif

-- method SettingsSpec::get_default_value
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "SettingsSpec" }
--           , argCType = Just "WpSettingsSpec*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the settings spec object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SpaJson" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_settings_spec_get_default_value" wp_settings_spec_get_default_value :: 
    Ptr SettingsSpec ->                     -- self : TInterface (Name {namespace = "Wp", name = "SettingsSpec"})
    IO (Ptr Wp.SpaJson.SpaJson)

-- | Gets the default value of a settings spec.
settingsSpecGetDefaultValue ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SettingsSpec
    -- ^ /@self@/: the settings spec object
    -> m Wp.SpaJson.SpaJson
    -- ^ __Returns:__ the default value of the settings spec
settingsSpecGetDefaultValue self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_settings_spec_get_default_value self'
    checkUnexpectedReturnNULL "settingsSpecGetDefaultValue" result
    result' <- (wrapBoxed Wp.SpaJson.SpaJson) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SettingsSpecGetDefaultValueMethodInfo
instance (signature ~ (m Wp.SpaJson.SpaJson), MonadIO m) => O.OverloadedMethod SettingsSpecGetDefaultValueMethodInfo SettingsSpec signature where
    overloadedMethod = settingsSpecGetDefaultValue

instance O.OverloadedMethodInfo SettingsSpecGetDefaultValueMethodInfo SettingsSpec where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SettingsSpec.settingsSpecGetDefaultValue",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Structs-SettingsSpec.html#v:settingsSpecGetDefaultValue"
        })


#endif

-- method SettingsSpec::get_description
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "SettingsSpec" }
--           , argCType = Just "WpSettingsSpec*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the settings spec object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "wp_settings_spec_get_description" wp_settings_spec_get_description :: 
    Ptr SettingsSpec ->                     -- self : TInterface (Name {namespace = "Wp", name = "SettingsSpec"})
    IO CString

-- | Gets the description of a settings spec.
settingsSpecGetDescription ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SettingsSpec
    -- ^ /@self@/: the settings spec object
    -> m T.Text
    -- ^ __Returns:__ the description of the settings spec
settingsSpecGetDescription self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_settings_spec_get_description self'
    checkUnexpectedReturnNULL "settingsSpecGetDescription" result
    result' <- cstringToText result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SettingsSpecGetDescriptionMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.OverloadedMethod SettingsSpecGetDescriptionMethodInfo SettingsSpec signature where
    overloadedMethod = settingsSpecGetDescription

instance O.OverloadedMethodInfo SettingsSpecGetDescriptionMethodInfo SettingsSpec where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SettingsSpec.settingsSpecGetDescription",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Structs-SettingsSpec.html#v:settingsSpecGetDescription"
        })


#endif

-- method SettingsSpec::get_max_value
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "SettingsSpec" }
--           , argCType = Just "WpSettingsSpec*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the settings spec object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SpaJson" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_settings_spec_get_max_value" wp_settings_spec_get_max_value :: 
    Ptr SettingsSpec ->                     -- self : TInterface (Name {namespace = "Wp", name = "SettingsSpec"})
    IO (Ptr Wp.SpaJson.SpaJson)

-- | Gets the maximum value of a settings spec.
settingsSpecGetMaxValue ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SettingsSpec
    -- ^ /@self@/: the settings spec object
    -> m (Maybe Wp.SpaJson.SpaJson)
    -- ^ __Returns:__ the maximum value of the settings spec, or NULL if the spec type is not WP_SETTINGS_SPEC_TYPE_INT or WP_SETTINGS_SPEC_TYPE_FLOAT
settingsSpecGetMaxValue self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_settings_spec_get_max_value self'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapBoxed Wp.SpaJson.SpaJson) result'
        return result''
    touchManagedPtr self
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data SettingsSpecGetMaxValueMethodInfo
instance (signature ~ (m (Maybe Wp.SpaJson.SpaJson)), MonadIO m) => O.OverloadedMethod SettingsSpecGetMaxValueMethodInfo SettingsSpec signature where
    overloadedMethod = settingsSpecGetMaxValue

instance O.OverloadedMethodInfo SettingsSpecGetMaxValueMethodInfo SettingsSpec where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SettingsSpec.settingsSpecGetMaxValue",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Structs-SettingsSpec.html#v:settingsSpecGetMaxValue"
        })


#endif

-- method SettingsSpec::get_min_value
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "SettingsSpec" }
--           , argCType = Just "WpSettingsSpec*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the settings spec object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SpaJson" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_settings_spec_get_min_value" wp_settings_spec_get_min_value :: 
    Ptr SettingsSpec ->                     -- self : TInterface (Name {namespace = "Wp", name = "SettingsSpec"})
    IO (Ptr Wp.SpaJson.SpaJson)

-- | Gets the minimum value of a settings spec.
settingsSpecGetMinValue ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SettingsSpec
    -- ^ /@self@/: the settings spec object
    -> m (Maybe Wp.SpaJson.SpaJson)
    -- ^ __Returns:__ the minimum value of the settings spec, or NULL if the spec type is not WP_SETTINGS_SPEC_TYPE_INT or WP_SETTINGS_SPEC_TYPE_FLOAT
settingsSpecGetMinValue self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_settings_spec_get_min_value self'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapBoxed Wp.SpaJson.SpaJson) result'
        return result''
    touchManagedPtr self
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data SettingsSpecGetMinValueMethodInfo
instance (signature ~ (m (Maybe Wp.SpaJson.SpaJson)), MonadIO m) => O.OverloadedMethod SettingsSpecGetMinValueMethodInfo SettingsSpec signature where
    overloadedMethod = settingsSpecGetMinValue

instance O.OverloadedMethodInfo SettingsSpecGetMinValueMethodInfo SettingsSpec where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SettingsSpec.settingsSpecGetMinValue",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Structs-SettingsSpec.html#v:settingsSpecGetMinValue"
        })


#endif

-- method SettingsSpec::get_name
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "SettingsSpec" }
--           , argCType = Just "WpSettingsSpec*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the settings spec object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "wp_settings_spec_get_name" wp_settings_spec_get_name :: 
    Ptr SettingsSpec ->                     -- self : TInterface (Name {namespace = "Wp", name = "SettingsSpec"})
    IO CString

-- | Gets the human-readable name of a settings spec.
settingsSpecGetName ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SettingsSpec
    -- ^ /@self@/: the settings spec object
    -> m (Maybe T.Text)
    -- ^ __Returns:__ the human-readable name of the settings spec, or NULL if none
settingsSpecGetName self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_settings_spec_get_name self'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- cstringToText result'
        return result''
    touchManagedPtr self
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data SettingsSpecGetNameMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m) => O.OverloadedMethod SettingsSpecGetNameMethodInfo SettingsSpec signature where
    overloadedMethod = settingsSpecGetName

instance O.OverloadedMethodInfo SettingsSpecGetNameMethodInfo SettingsSpec where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SettingsSpec.settingsSpecGetName",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Structs-SettingsSpec.html#v:settingsSpecGetName"
        })


#endif

-- method SettingsSpec::get_value_type
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "SettingsSpec" }
--           , argCType = Just "WpSettingsSpec*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the settings spec object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Wp" , name = "SettingsSpecType" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_settings_spec_get_value_type" wp_settings_spec_get_value_type :: 
    Ptr SettingsSpec ->                     -- self : TInterface (Name {namespace = "Wp", name = "SettingsSpec"})
    IO CUInt

-- | Gets the type of a settings spec.
settingsSpecGetValueType ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SettingsSpec
    -- ^ /@self@/: the settings spec object
    -> m Wp.Enums.SettingsSpecType
    -- ^ __Returns:__ the type of the settings spec
settingsSpecGetValueType self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_settings_spec_get_value_type self'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SettingsSpecGetValueTypeMethodInfo
instance (signature ~ (m Wp.Enums.SettingsSpecType), MonadIO m) => O.OverloadedMethod SettingsSpecGetValueTypeMethodInfo SettingsSpec signature where
    overloadedMethod = settingsSpecGetValueType

instance O.OverloadedMethodInfo SettingsSpecGetValueTypeMethodInfo SettingsSpec where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SettingsSpec.settingsSpecGetValueType",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Structs-SettingsSpec.html#v:settingsSpecGetValueType"
        })


#endif

-- method SettingsSpec::ref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "SettingsSpec" }
--           , argCType = Just "WpSettingsSpec*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a settings spec object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SettingsSpec" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_settings_spec_ref" wp_settings_spec_ref :: 
    Ptr SettingsSpec ->                     -- self : TInterface (Name {namespace = "Wp", name = "SettingsSpec"})
    IO (Ptr SettingsSpec)

-- | Increases the reference count of a settings spec object.
settingsSpecRef ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SettingsSpec
    -- ^ /@self@/: a settings spec object
    -> m SettingsSpec
    -- ^ __Returns:__ /@self@/ with an additional reference count on it
settingsSpecRef self = liftIO $ do
    self' <- unsafeManagedPtrGetPtr self
    result <- wp_settings_spec_ref self'
    checkUnexpectedReturnNULL "settingsSpecRef" result
    result' <- (wrapBoxed SettingsSpec) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SettingsSpecRefMethodInfo
instance (signature ~ (m SettingsSpec), MonadIO m) => O.OverloadedMethod SettingsSpecRefMethodInfo SettingsSpec signature where
    overloadedMethod = settingsSpecRef

instance O.OverloadedMethodInfo SettingsSpecRefMethodInfo SettingsSpec where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SettingsSpec.settingsSpecRef",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Structs-SettingsSpec.html#v:settingsSpecRef"
        })


#endif

-- method SettingsSpec::unref
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "SettingsSpec" }
--           , argCType = Just "WpSettingsSpec*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a settings spec object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "wp_settings_spec_unref" wp_settings_spec_unref :: 
    Ptr SettingsSpec ->                     -- self : TInterface (Name {namespace = "Wp", name = "SettingsSpec"})
    IO ()

-- | Decreases the reference count on /@self@/ and frees it when the ref count reaches zero.
settingsSpecUnref ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    SettingsSpec
    -- ^ /@self@/: a settings spec object
    -> m ()
settingsSpecUnref self = liftIO $ do
    self' <- B.ManagedPtr.disownBoxed self
    wp_settings_spec_unref self'
    touchManagedPtr self
    return ()

#if defined(ENABLE_OVERLOADING)
data SettingsSpecUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod SettingsSpecUnrefMethodInfo SettingsSpec signature where
    overloadedMethod = settingsSpecUnref

instance O.OverloadedMethodInfo SettingsSpecUnrefMethodInfo SettingsSpec where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Structs.SettingsSpec.settingsSpecUnref",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Structs-SettingsSpec.html#v:settingsSpecUnref"
        })


#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveSettingsSpecMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveSettingsSpecMethod "checkValue" o = SettingsSpecCheckValueMethodInfo
    ResolveSettingsSpecMethod "ref" o = SettingsSpecRefMethodInfo
    ResolveSettingsSpecMethod "unref" o = SettingsSpecUnrefMethodInfo
    ResolveSettingsSpecMethod "getDefaultValue" o = SettingsSpecGetDefaultValueMethodInfo
    ResolveSettingsSpecMethod "getDescription" o = SettingsSpecGetDescriptionMethodInfo
    ResolveSettingsSpecMethod "getMaxValue" o = SettingsSpecGetMaxValueMethodInfo
    ResolveSettingsSpecMethod "getMinValue" o = SettingsSpecGetMinValueMethodInfo
    ResolveSettingsSpecMethod "getName" o = SettingsSpecGetNameMethodInfo
    ResolveSettingsSpecMethod "getValueType" o = SettingsSpecGetValueTypeMethodInfo
    ResolveSettingsSpecMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveSettingsSpecMethod t SettingsSpec, O.OverloadedMethod info SettingsSpec p) => OL.IsLabel t (SettingsSpec -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveSettingsSpecMethod t SettingsSpec, O.OverloadedMethod info SettingsSpec p, R.HasField t SettingsSpec p) => R.HasField t SettingsSpec p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveSettingsSpecMethod t SettingsSpec, O.OverloadedMethodInfo info SettingsSpec) => OL.IsLabel t (O.MethodProxy info SettingsSpec) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif


