{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- An interface for session items that provide a PipeWire link.

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

module GI.Wp.Interfaces.SiLink
    ( 

-- * Exported types
    SiLink(..)                              ,
    IsSiLink                                ,
    toSiLink                                ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [abortActivation]("GI.Wp.Objects.Object#g:method:abortActivation"), [activate]("GI.Wp.Objects.Object#g:method:activate"), [activateClosure]("GI.Wp.Objects.Object#g:method:activateClosure"), [activateFinish]("GI.Wp.Objects.Object#g:method:activateFinish"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [configure]("GI.Wp.Objects.SessionItem#g:method:configure"), [deactivate]("GI.Wp.Objects.Object#g:method:deactivate"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isConfigured]("GI.Wp.Objects.SessionItem#g:method:isConfigured"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [register]("GI.Wp.Objects.SessionItem#g:method:register"), [remove]("GI.Wp.Objects.SessionItem#g:method:remove"), [reset]("GI.Wp.Objects.SessionItem#g:method:reset"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [testActiveFeatures]("GI.Wp.Objects.Object#g:method:testActiveFeatures"), [testSupportedFeatures]("GI.Wp.Objects.Object#g:method:testSupportedFeatures"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [updateFeatures]("GI.Wp.Objects.Object#g:method:updateFeatures"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getActiveFeatures]("GI.Wp.Objects.Object#g:method:getActiveFeatures"), [getAssociatedProxy]("GI.Wp.Objects.SessionItem#g:method:getAssociatedProxy"), [getAssociatedProxyId]("GI.Wp.Objects.SessionItem#g:method:getAssociatedProxyId"), [getCore]("GI.Wp.Objects.Object#g:method:getCore"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getId]("GI.Wp.Objects.Object#g:method:getId"), [getInItem]("GI.Wp.Interfaces.SiLink#g:method:getInItem"), [getOutItem]("GI.Wp.Interfaces.SiLink#g:method:getOutItem"), [getProperties]("GI.Wp.Interfaces.SiLink#g:method:getProperties"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getRegistrationInfo]("GI.Wp.Interfaces.SiLink#g:method:getRegistrationInfo"), [getSupportedFeatures]("GI.Wp.Objects.Object#g:method:getSupportedFeatures").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperties]("GI.Wp.Objects.SessionItem#g:method:setProperties"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveSiLinkMethod                     ,
#endif

-- ** getInItem #method:getInItem#

#if defined(ENABLE_OVERLOADING)
    SiLinkGetInItemMethodInfo               ,
#endif
    siLinkGetInItem                         ,


-- ** getOutItem #method:getOutItem#

#if defined(ENABLE_OVERLOADING)
    SiLinkGetOutItemMethodInfo              ,
#endif
    siLinkGetOutItem                        ,


-- ** getProperties #method:getProperties#

#if defined(ENABLE_OVERLOADING)
    SiLinkGetPropertiesMethodInfo           ,
#endif
    siLinkGetProperties                     ,


-- ** getRegistrationInfo #method:getRegistrationInfo#

#if defined(ENABLE_OVERLOADING)
    SiLinkGetRegistrationInfoMethodInfo     ,
#endif
    siLinkGetRegistrationInfo               ,




 -- * Signals


-- ** linkPropertiesChanged #signal:linkPropertiesChanged#

    SiLinkLinkPropertiesChangedCallback     ,
#if defined(ENABLE_OVERLOADING)
    SiLinkLinkPropertiesChangedSignalInfo   ,
#endif
    afterSiLinkLinkPropertiesChanged        ,
    onSiLinkLinkPropertiesChanged           ,




    ) 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.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.MainContext as GLib.MainContext
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Wp.Callbacks as Wp.Callbacks
import {-# SOURCE #-} qualified GI.Wp.Enums as Wp.Enums
import {-# SOURCE #-} qualified GI.Wp.Flags as Wp.Flags
import {-# SOURCE #-} qualified GI.Wp.Interfaces.SiAcquisition as Wp.SiAcquisition
import {-# SOURCE #-} qualified GI.Wp.Interfaces.SiLinkable as Wp.SiLinkable
import {-# SOURCE #-} qualified GI.Wp.Objects.Conf as Wp.Conf
import {-# SOURCE #-} qualified GI.Wp.Objects.Core as Wp.Core
import {-# SOURCE #-} qualified GI.Wp.Objects.Object as Wp.Object
import {-# SOURCE #-} qualified GI.Wp.Objects.ObjectManager as Wp.ObjectManager
import {-# SOURCE #-} qualified GI.Wp.Objects.Proxy as Wp.Proxy
import {-# SOURCE #-} qualified GI.Wp.Objects.SessionItem as Wp.SessionItem
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.ObjectInterest as Wp.ObjectInterest
import {-# SOURCE #-} qualified GI.Wp.Structs.Properties as Wp.Properties
import {-# SOURCE #-} qualified GI.Wp.Structs.SpaJson as Wp.SpaJson

#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Wp.Interfaces.SiLinkable as Wp.SiLinkable
import {-# SOURCE #-} qualified GI.Wp.Objects.Object as Wp.Object
import {-# SOURCE #-} qualified GI.Wp.Objects.SessionItem as Wp.SessionItem
import {-# SOURCE #-} qualified GI.Wp.Structs.Properties as Wp.Properties

#endif

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

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

foreign import ccall "wp_si_link_get_type"
    c_wp_si_link_get_type :: IO B.Types.GType

instance B.Types.TypedObject SiLink where
    glibType = c_wp_si_link_get_type

instance B.Types.GObject SiLink

-- | Type class for types which can be safely cast to t'SiLink', for instance with `toSiLink`.
class (SP.GObject o, O.IsDescendantOf SiLink o) => IsSiLink o
instance (SP.GObject o, O.IsDescendantOf SiLink o) => IsSiLink o

instance O.HasParentTypes SiLink
type instance O.ParentTypes SiLink = '[GObject.Object.Object, Wp.SessionItem.SessionItem, Wp.Object.Object]

-- | Cast to t'SiLink', for types for which this is known to be safe. For general casts, use 'Data.GI.Base.ManagedPtr.castTo'.
toSiLink :: (MIO.MonadIO m, IsSiLink o) => o -> m SiLink
toSiLink = MIO.liftIO . B.ManagedPtr.unsafeCastTo SiLink

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

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SiLink
type instance O.AttributeList SiLink = SiLinkAttributeList
type SiLinkAttributeList = ('[ '("activeFeatures", Wp.Object.ObjectActiveFeaturesPropertyInfo), '("core", Wp.Object.ObjectCorePropertyInfo), '("id", Wp.Object.ObjectIdPropertyInfo), '("properties", Wp.SessionItem.SessionItemPropertiesPropertyInfo), '("supportedFeatures", Wp.Object.ObjectSupportedFeaturesPropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveSiLinkMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveSiLinkMethod "abortActivation" o = Wp.Object.ObjectAbortActivationMethodInfo
    ResolveSiLinkMethod "activate" o = Wp.Object.ObjectActivateMethodInfo
    ResolveSiLinkMethod "activateClosure" o = Wp.Object.ObjectActivateClosureMethodInfo
    ResolveSiLinkMethod "activateFinish" o = Wp.Object.ObjectActivateFinishMethodInfo
    ResolveSiLinkMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveSiLinkMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveSiLinkMethod "configure" o = Wp.SessionItem.SessionItemConfigureMethodInfo
    ResolveSiLinkMethod "deactivate" o = Wp.Object.ObjectDeactivateMethodInfo
    ResolveSiLinkMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveSiLinkMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveSiLinkMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveSiLinkMethod "isConfigured" o = Wp.SessionItem.SessionItemIsConfiguredMethodInfo
    ResolveSiLinkMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveSiLinkMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveSiLinkMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveSiLinkMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveSiLinkMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveSiLinkMethod "register" o = Wp.SessionItem.SessionItemRegisterMethodInfo
    ResolveSiLinkMethod "remove" o = Wp.SessionItem.SessionItemRemoveMethodInfo
    ResolveSiLinkMethod "reset" o = Wp.SessionItem.SessionItemResetMethodInfo
    ResolveSiLinkMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveSiLinkMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveSiLinkMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveSiLinkMethod "testActiveFeatures" o = Wp.Object.ObjectTestActiveFeaturesMethodInfo
    ResolveSiLinkMethod "testSupportedFeatures" o = Wp.Object.ObjectTestSupportedFeaturesMethodInfo
    ResolveSiLinkMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveSiLinkMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveSiLinkMethod "updateFeatures" o = Wp.Object.ObjectUpdateFeaturesMethodInfo
    ResolveSiLinkMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveSiLinkMethod "getActiveFeatures" o = Wp.Object.ObjectGetActiveFeaturesMethodInfo
    ResolveSiLinkMethod "getAssociatedProxy" o = Wp.SessionItem.SessionItemGetAssociatedProxyMethodInfo
    ResolveSiLinkMethod "getAssociatedProxyId" o = Wp.SessionItem.SessionItemGetAssociatedProxyIdMethodInfo
    ResolveSiLinkMethod "getCore" o = Wp.Object.ObjectGetCoreMethodInfo
    ResolveSiLinkMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveSiLinkMethod "getId" o = Wp.Object.ObjectGetIdMethodInfo
    ResolveSiLinkMethod "getInItem" o = SiLinkGetInItemMethodInfo
    ResolveSiLinkMethod "getOutItem" o = SiLinkGetOutItemMethodInfo
    ResolveSiLinkMethod "getProperties" o = SiLinkGetPropertiesMethodInfo
    ResolveSiLinkMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveSiLinkMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveSiLinkMethod "getRegistrationInfo" o = SiLinkGetRegistrationInfoMethodInfo
    ResolveSiLinkMethod "getSupportedFeatures" o = Wp.Object.ObjectGetSupportedFeaturesMethodInfo
    ResolveSiLinkMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveSiLinkMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveSiLinkMethod "setProperties" o = Wp.SessionItem.SessionItemSetPropertiesMethodInfo
    ResolveSiLinkMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveSiLinkMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveSiLinkMethod t SiLink, O.OverloadedMethod info SiLink p) => OL.IsLabel t (SiLink -> 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 ~ ResolveSiLinkMethod t SiLink, O.OverloadedMethod info SiLink p, R.HasField t SiLink p) => R.HasField t SiLink p where
    getField = O.overloadedMethod @info

#endif

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

#endif

-- method SiLink::get_in_item
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SiLink" }
--           , argCType = Just "WpSiLink*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the session item" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SiLinkable" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_si_link_get_in_item" wp_si_link_get_in_item :: 
    Ptr SiLink ->                           -- self : TInterface (Name {namespace = "Wp", name = "SiLink"})
    IO (Ptr Wp.SiLinkable.SiLinkable)

-- | Gets the input item linked by the link.
siLinkGetInItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsSiLink a) =>
    a
    -- ^ /@self@/: the session item
    -> m Wp.SiLinkable.SiLinkable
    -- ^ __Returns:__ the input item that is linked by this link
siLinkGetInItem self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_si_link_get_in_item self'
    checkUnexpectedReturnNULL "siLinkGetInItem" result
    result' <- (newObject Wp.SiLinkable.SiLinkable) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SiLinkGetInItemMethodInfo
instance (signature ~ (m Wp.SiLinkable.SiLinkable), MonadIO m, IsSiLink a) => O.OverloadedMethod SiLinkGetInItemMethodInfo a signature where
    overloadedMethod = siLinkGetInItem

instance O.OverloadedMethodInfo SiLinkGetInItemMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Interfaces.SiLink.siLinkGetInItem",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Interfaces-SiLink.html#v:siLinkGetInItem"
        })


#endif

-- method SiLink::get_out_item
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SiLink" }
--           , argCType = Just "WpSiLink*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the session item" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "SiLinkable" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_si_link_get_out_item" wp_si_link_get_out_item :: 
    Ptr SiLink ->                           -- self : TInterface (Name {namespace = "Wp", name = "SiLink"})
    IO (Ptr Wp.SiLinkable.SiLinkable)

-- | Gets the output item linked by the link.
siLinkGetOutItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsSiLink a) =>
    a
    -- ^ /@self@/: the session item
    -> m Wp.SiLinkable.SiLinkable
    -- ^ __Returns:__ the output item that is linked by this link
siLinkGetOutItem self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_si_link_get_out_item self'
    checkUnexpectedReturnNULL "siLinkGetOutItem" result
    result' <- (newObject Wp.SiLinkable.SiLinkable) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SiLinkGetOutItemMethodInfo
instance (signature ~ (m Wp.SiLinkable.SiLinkable), MonadIO m, IsSiLink a) => O.OverloadedMethod SiLinkGetOutItemMethodInfo a signature where
    overloadedMethod = siLinkGetOutItem

instance O.OverloadedMethodInfo SiLinkGetOutItemMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Interfaces.SiLink.siLinkGetOutItem",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Interfaces-SiLink.html#v:siLinkGetOutItem"
        })


#endif

-- method SiLink::get_properties
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SiLink" }
--           , argCType = Just "WpSiLink*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the session item" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "Properties" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_si_link_get_properties" wp_si_link_get_properties :: 
    Ptr SiLink ->                           -- self : TInterface (Name {namespace = "Wp", name = "SiLink"})
    IO (Ptr Wp.Properties.Properties)

-- | Gets the properties of the link.
siLinkGetProperties ::
    (B.CallStack.HasCallStack, MonadIO m, IsSiLink a) =>
    a
    -- ^ /@self@/: the session item
    -> m (Maybe Wp.Properties.Properties)
    -- ^ __Returns:__ the properties of the link
siLinkGetProperties self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_si_link_get_properties self'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapBoxed Wp.Properties.Properties) result'
        return result''
    touchManagedPtr self
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data SiLinkGetPropertiesMethodInfo
instance (signature ~ (m (Maybe Wp.Properties.Properties)), MonadIO m, IsSiLink a) => O.OverloadedMethod SiLinkGetPropertiesMethodInfo a signature where
    overloadedMethod = siLinkGetProperties

instance O.OverloadedMethodInfo SiLinkGetPropertiesMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Interfaces.SiLink.siLinkGetProperties",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Interfaces-SiLink.html#v:siLinkGetProperties"
        })


#endif

-- method SiLink::get_registration_info
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "SiLink" }
--           , argCType = Just "WpSiLink*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the session item" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just TVariant
-- throws : False
-- Skip return : False

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

-- | This should return information that is used for registering the link, as a GVariant of type a{ss} that contains additional properties to be added to the list of global properties.
siLinkGetRegistrationInfo ::
    (B.CallStack.HasCallStack, MonadIO m, IsSiLink a) =>
    a
    -- ^ /@self@/: the session item
    -> m GVariant
    -- ^ __Returns:__ registration info for the link
siLinkGetRegistrationInfo self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_si_link_get_registration_info self'
    checkUnexpectedReturnNULL "siLinkGetRegistrationInfo" result
    result' <- B.GVariant.wrapGVariantPtr result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data SiLinkGetRegistrationInfoMethodInfo
instance (signature ~ (m GVariant), MonadIO m, IsSiLink a) => O.OverloadedMethod SiLinkGetRegistrationInfoMethodInfo a signature where
    overloadedMethod = siLinkGetRegistrationInfo

instance O.OverloadedMethodInfo SiLinkGetRegistrationInfoMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Interfaces.SiLink.siLinkGetRegistrationInfo",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Interfaces-SiLink.html#v:siLinkGetRegistrationInfo"
        })


#endif

-- signal SiLink::link-properties-changed
-- | /No description available in the introspection data./
type SiLinkLinkPropertiesChangedCallback =
    IO ()

type C_SiLinkLinkPropertiesChangedCallback =
    Ptr SiLink ->                           -- object
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_SiLinkLinkPropertiesChangedCallback`.
foreign import ccall "wrapper"
    mk_SiLinkLinkPropertiesChangedCallback :: C_SiLinkLinkPropertiesChangedCallback -> IO (FunPtr C_SiLinkLinkPropertiesChangedCallback)

wrap_SiLinkLinkPropertiesChangedCallback :: 
    GObject a => (a -> SiLinkLinkPropertiesChangedCallback) ->
    C_SiLinkLinkPropertiesChangedCallback
wrap_SiLinkLinkPropertiesChangedCallback gi'cb gi'selfPtr _ = do
    B.ManagedPtr.withNewObject gi'selfPtr $ \gi'self -> gi'cb (Coerce.coerce gi'self) 


-- | Connect a signal handler for the [linkPropertiesChanged](#signal:linkPropertiesChanged) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' siLink #linkPropertiesChanged callback
-- @
-- 
-- 
onSiLinkLinkPropertiesChanged :: (IsSiLink a, MonadIO m) => a -> ((?self :: a) => SiLinkLinkPropertiesChangedCallback) -> m SignalHandlerId
onSiLinkLinkPropertiesChanged obj cb = liftIO $ do
    let wrapped self = let ?self = self in cb
    let wrapped' = wrap_SiLinkLinkPropertiesChangedCallback wrapped
    wrapped'' <- mk_SiLinkLinkPropertiesChangedCallback wrapped'
    connectSignalFunPtr obj "link-properties-changed" wrapped'' SignalConnectBefore Nothing

-- | Connect a signal handler for the [linkPropertiesChanged](#signal:linkPropertiesChanged) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' siLink #linkPropertiesChanged callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterSiLinkLinkPropertiesChanged :: (IsSiLink a, MonadIO m) => a -> ((?self :: a) => SiLinkLinkPropertiesChangedCallback) -> m SignalHandlerId
afterSiLinkLinkPropertiesChanged obj cb = liftIO $ do
    let wrapped self = let ?self = self in cb
    let wrapped' = wrap_SiLinkLinkPropertiesChangedCallback wrapped
    wrapped'' <- mk_SiLinkLinkPropertiesChangedCallback wrapped'
    connectSignalFunPtr obj "link-properties-changed" wrapped'' SignalConnectAfter Nothing


#if defined(ENABLE_OVERLOADING)
data SiLinkLinkPropertiesChangedSignalInfo
instance SignalInfo SiLinkLinkPropertiesChangedSignalInfo where
    type HaskellCallbackType SiLinkLinkPropertiesChangedSignalInfo = SiLinkLinkPropertiesChangedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_SiLinkLinkPropertiesChangedCallback cb
        cb'' <- mk_SiLinkLinkPropertiesChangedCallback cb'
        connectSignalFunPtr obj "link-properties-changed" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Interfaces.SiLink::link-properties-changed"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Interfaces-SiLink.html#g:signal:linkPropertiesChanged"})

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList SiLink = SiLinkSignalList
type SiLinkSignalList = ('[ '("linkPropertiesChanged", SiLinkLinkPropertiesChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])

#endif


