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

The 'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager' type is the base type for service- and
client-side implementations of the standardized
<http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager org.freedesktop.DBus.ObjectManager>
interface.

See 'GI.Gio.Objects.DBusObjectManagerClient.DBusObjectManagerClient' for the client-side implementation
and 'GI.Gio.Objects.DBusObjectManagerServer.DBusObjectManagerServer' for the service-side implementation.
-}

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

module GI.Gio.Interfaces.DBusObjectManager
    (

-- * Exported types
    DBusObjectManager(..)                   ,
    noDBusObjectManager                     ,
    IsDBusObjectManager                     ,
    toDBusObjectManager                     ,


 -- * Methods
-- ** getInterface #method:getInterface#

#if ENABLE_OVERLOADING
    DBusObjectManagerGetInterfaceMethodInfo ,
#endif
    dBusObjectManagerGetInterface           ,


-- ** getObject #method:getObject#

#if ENABLE_OVERLOADING
    DBusObjectManagerGetObjectMethodInfo    ,
#endif
    dBusObjectManagerGetObject              ,


-- ** getObjectPath #method:getObjectPath#

#if ENABLE_OVERLOADING
    DBusObjectManagerGetObjectPathMethodInfo,
#endif
    dBusObjectManagerGetObjectPath          ,


-- ** getObjects #method:getObjects#

#if ENABLE_OVERLOADING
    DBusObjectManagerGetObjectsMethodInfo   ,
#endif
    dBusObjectManagerGetObjects             ,




 -- * Signals
-- ** interfaceAdded #signal:interfaceAdded#

    C_DBusObjectManagerInterfaceAddedCallback,
    DBusObjectManagerInterfaceAddedCallback ,
#if ENABLE_OVERLOADING
    DBusObjectManagerInterfaceAddedSignalInfo,
#endif
    afterDBusObjectManagerInterfaceAdded    ,
    genClosure_DBusObjectManagerInterfaceAdded,
    mk_DBusObjectManagerInterfaceAddedCallback,
    noDBusObjectManagerInterfaceAddedCallback,
    onDBusObjectManagerInterfaceAdded       ,
    wrap_DBusObjectManagerInterfaceAddedCallback,


-- ** interfaceRemoved #signal:interfaceRemoved#

    C_DBusObjectManagerInterfaceRemovedCallback,
    DBusObjectManagerInterfaceRemovedCallback,
#if ENABLE_OVERLOADING
    DBusObjectManagerInterfaceRemovedSignalInfo,
#endif
    afterDBusObjectManagerInterfaceRemoved  ,
    genClosure_DBusObjectManagerInterfaceRemoved,
    mk_DBusObjectManagerInterfaceRemovedCallback,
    noDBusObjectManagerInterfaceRemovedCallback,
    onDBusObjectManagerInterfaceRemoved     ,
    wrap_DBusObjectManagerInterfaceRemovedCallback,


-- ** objectAdded #signal:objectAdded#

    C_DBusObjectManagerObjectAddedCallback  ,
    DBusObjectManagerObjectAddedCallback    ,
#if ENABLE_OVERLOADING
    DBusObjectManagerObjectAddedSignalInfo  ,
#endif
    afterDBusObjectManagerObjectAdded       ,
    genClosure_DBusObjectManagerObjectAdded ,
    mk_DBusObjectManagerObjectAddedCallback ,
    noDBusObjectManagerObjectAddedCallback  ,
    onDBusObjectManagerObjectAdded          ,
    wrap_DBusObjectManagerObjectAddedCallback,


-- ** objectRemoved #signal:objectRemoved#

    C_DBusObjectManagerObjectRemovedCallback,
    DBusObjectManagerObjectRemovedCallback  ,
#if ENABLE_OVERLOADING
    DBusObjectManagerObjectRemovedSignalInfo,
#endif
    afterDBusObjectManagerObjectRemoved     ,
    genClosure_DBusObjectManagerObjectRemoved,
    mk_DBusObjectManagerObjectRemovedCallback,
    noDBusObjectManagerObjectRemovedCallback,
    onDBusObjectManagerObjectRemoved        ,
    wrap_DBusObjectManagerObjectRemovedCallback,




    ) 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.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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Interfaces.DBusInterface as Gio.DBusInterface
import {-# SOURCE #-} qualified GI.Gio.Interfaces.DBusObject as Gio.DBusObject

-- interface DBusObjectManager 
-- | Memory-managed wrapper type.
newtype DBusObjectManager = DBusObjectManager (ManagedPtr DBusObjectManager)
-- | A convenience alias for `Nothing` :: `Maybe` `DBusObjectManager`.
noDBusObjectManager :: Maybe DBusObjectManager
noDBusObjectManager = Nothing

-- signal DBusObjectManager::interface-added
{- |
Emitted when /@interface@/ is added to /@object@/.

This signal exists purely as a convenience to avoid having to
connect signals to all objects managed by /@manager@/.

/Since: 2.30/
-}
type DBusObjectManagerInterfaceAddedCallback =
    Gio.DBusObject.DBusObject
    {- ^ /@object@/: The 'GI.Gio.Interfaces.DBusObject.DBusObject' on which an interface was added. -}
    -> Gio.DBusInterface.DBusInterface
    {- ^ /@interface@/: The 'GI.Gio.Interfaces.DBusInterface.DBusInterface' that was added. -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `DBusObjectManagerInterfaceAddedCallback`@.
noDBusObjectManagerInterfaceAddedCallback :: Maybe DBusObjectManagerInterfaceAddedCallback
noDBusObjectManagerInterfaceAddedCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_DBusObjectManagerInterfaceAddedCallback =
    Ptr () ->                               -- object
    Ptr Gio.DBusObject.DBusObject ->
    Ptr Gio.DBusInterface.DBusInterface ->
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `Closure`.
genClosure_DBusObjectManagerInterfaceAdded :: DBusObjectManagerInterfaceAddedCallback -> IO Closure
genClosure_DBusObjectManagerInterfaceAdded cb = do
    let cb' = wrap_DBusObjectManagerInterfaceAddedCallback cb
    mk_DBusObjectManagerInterfaceAddedCallback cb' >>= newCClosure


-- | Wrap a `DBusObjectManagerInterfaceAddedCallback` into a `C_DBusObjectManagerInterfaceAddedCallback`.
wrap_DBusObjectManagerInterfaceAddedCallback ::
    DBusObjectManagerInterfaceAddedCallback ->
    C_DBusObjectManagerInterfaceAddedCallback
wrap_DBusObjectManagerInterfaceAddedCallback _cb _ object interface _ = do
    object' <- (newObject Gio.DBusObject.DBusObject) object
    interface' <- (newObject Gio.DBusInterface.DBusInterface) interface
    _cb  object' interface'


{- |
Connect a signal handler for the “@interface-added@” 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' dBusObjectManager #interfaceAdded callback
@
-}
onDBusObjectManagerInterfaceAdded :: (IsDBusObjectManager a, MonadIO m) => a -> DBusObjectManagerInterfaceAddedCallback -> m SignalHandlerId
onDBusObjectManagerInterfaceAdded obj cb = liftIO $ do
    let cb' = wrap_DBusObjectManagerInterfaceAddedCallback cb
    cb'' <- mk_DBusObjectManagerInterfaceAddedCallback cb'
    connectSignalFunPtr obj "interface-added" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@interface-added@” 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' dBusObjectManager #interfaceAdded callback
@
-}
afterDBusObjectManagerInterfaceAdded :: (IsDBusObjectManager a, MonadIO m) => a -> DBusObjectManagerInterfaceAddedCallback -> m SignalHandlerId
afterDBusObjectManagerInterfaceAdded obj cb = liftIO $ do
    let cb' = wrap_DBusObjectManagerInterfaceAddedCallback cb
    cb'' <- mk_DBusObjectManagerInterfaceAddedCallback cb'
    connectSignalFunPtr obj "interface-added" cb'' SignalConnectAfter


-- signal DBusObjectManager::interface-removed
{- |
Emitted when /@interface@/ has been removed from /@object@/.

This signal exists purely as a convenience to avoid having to
connect signals to all objects managed by /@manager@/.

/Since: 2.30/
-}
type DBusObjectManagerInterfaceRemovedCallback =
    Gio.DBusObject.DBusObject
    {- ^ /@object@/: The 'GI.Gio.Interfaces.DBusObject.DBusObject' on which an interface was removed. -}
    -> Gio.DBusInterface.DBusInterface
    {- ^ /@interface@/: The 'GI.Gio.Interfaces.DBusInterface.DBusInterface' that was removed. -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `DBusObjectManagerInterfaceRemovedCallback`@.
noDBusObjectManagerInterfaceRemovedCallback :: Maybe DBusObjectManagerInterfaceRemovedCallback
noDBusObjectManagerInterfaceRemovedCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_DBusObjectManagerInterfaceRemovedCallback =
    Ptr () ->                               -- object
    Ptr Gio.DBusObject.DBusObject ->
    Ptr Gio.DBusInterface.DBusInterface ->
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `Closure`.
genClosure_DBusObjectManagerInterfaceRemoved :: DBusObjectManagerInterfaceRemovedCallback -> IO Closure
genClosure_DBusObjectManagerInterfaceRemoved cb = do
    let cb' = wrap_DBusObjectManagerInterfaceRemovedCallback cb
    mk_DBusObjectManagerInterfaceRemovedCallback cb' >>= newCClosure


-- | Wrap a `DBusObjectManagerInterfaceRemovedCallback` into a `C_DBusObjectManagerInterfaceRemovedCallback`.
wrap_DBusObjectManagerInterfaceRemovedCallback ::
    DBusObjectManagerInterfaceRemovedCallback ->
    C_DBusObjectManagerInterfaceRemovedCallback
wrap_DBusObjectManagerInterfaceRemovedCallback _cb _ object interface _ = do
    object' <- (newObject Gio.DBusObject.DBusObject) object
    interface' <- (newObject Gio.DBusInterface.DBusInterface) interface
    _cb  object' interface'


{- |
Connect a signal handler for the “@interface-removed@” 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' dBusObjectManager #interfaceRemoved callback
@
-}
onDBusObjectManagerInterfaceRemoved :: (IsDBusObjectManager a, MonadIO m) => a -> DBusObjectManagerInterfaceRemovedCallback -> m SignalHandlerId
onDBusObjectManagerInterfaceRemoved obj cb = liftIO $ do
    let cb' = wrap_DBusObjectManagerInterfaceRemovedCallback cb
    cb'' <- mk_DBusObjectManagerInterfaceRemovedCallback cb'
    connectSignalFunPtr obj "interface-removed" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@interface-removed@” 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' dBusObjectManager #interfaceRemoved callback
@
-}
afterDBusObjectManagerInterfaceRemoved :: (IsDBusObjectManager a, MonadIO m) => a -> DBusObjectManagerInterfaceRemovedCallback -> m SignalHandlerId
afterDBusObjectManagerInterfaceRemoved obj cb = liftIO $ do
    let cb' = wrap_DBusObjectManagerInterfaceRemovedCallback cb
    cb'' <- mk_DBusObjectManagerInterfaceRemovedCallback cb'
    connectSignalFunPtr obj "interface-removed" cb'' SignalConnectAfter


-- signal DBusObjectManager::object-added
{- |
Emitted when /@object@/ is added to /@manager@/.

/Since: 2.30/
-}
type DBusObjectManagerObjectAddedCallback =
    Gio.DBusObject.DBusObject
    {- ^ /@object@/: The 'GI.Gio.Interfaces.DBusObject.DBusObject' that was added. -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `DBusObjectManagerObjectAddedCallback`@.
noDBusObjectManagerObjectAddedCallback :: Maybe DBusObjectManagerObjectAddedCallback
noDBusObjectManagerObjectAddedCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_DBusObjectManagerObjectAddedCallback =
    Ptr () ->                               -- object
    Ptr Gio.DBusObject.DBusObject ->
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `Closure`.
genClosure_DBusObjectManagerObjectAdded :: DBusObjectManagerObjectAddedCallback -> IO Closure
genClosure_DBusObjectManagerObjectAdded cb = do
    let cb' = wrap_DBusObjectManagerObjectAddedCallback cb
    mk_DBusObjectManagerObjectAddedCallback cb' >>= newCClosure


-- | Wrap a `DBusObjectManagerObjectAddedCallback` into a `C_DBusObjectManagerObjectAddedCallback`.
wrap_DBusObjectManagerObjectAddedCallback ::
    DBusObjectManagerObjectAddedCallback ->
    C_DBusObjectManagerObjectAddedCallback
wrap_DBusObjectManagerObjectAddedCallback _cb _ object _ = do
    object' <- (newObject Gio.DBusObject.DBusObject) object
    _cb  object'


{- |
Connect a signal handler for the “@object-added@” 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' dBusObjectManager #objectAdded callback
@
-}
onDBusObjectManagerObjectAdded :: (IsDBusObjectManager a, MonadIO m) => a -> DBusObjectManagerObjectAddedCallback -> m SignalHandlerId
onDBusObjectManagerObjectAdded obj cb = liftIO $ do
    let cb' = wrap_DBusObjectManagerObjectAddedCallback cb
    cb'' <- mk_DBusObjectManagerObjectAddedCallback cb'
    connectSignalFunPtr obj "object-added" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@object-added@” 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' dBusObjectManager #objectAdded callback
@
-}
afterDBusObjectManagerObjectAdded :: (IsDBusObjectManager a, MonadIO m) => a -> DBusObjectManagerObjectAddedCallback -> m SignalHandlerId
afterDBusObjectManagerObjectAdded obj cb = liftIO $ do
    let cb' = wrap_DBusObjectManagerObjectAddedCallback cb
    cb'' <- mk_DBusObjectManagerObjectAddedCallback cb'
    connectSignalFunPtr obj "object-added" cb'' SignalConnectAfter


-- signal DBusObjectManager::object-removed
{- |
Emitted when /@object@/ is removed from /@manager@/.

/Since: 2.30/
-}
type DBusObjectManagerObjectRemovedCallback =
    Gio.DBusObject.DBusObject
    {- ^ /@object@/: The 'GI.Gio.Interfaces.DBusObject.DBusObject' that was removed. -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `DBusObjectManagerObjectRemovedCallback`@.
noDBusObjectManagerObjectRemovedCallback :: Maybe DBusObjectManagerObjectRemovedCallback
noDBusObjectManagerObjectRemovedCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_DBusObjectManagerObjectRemovedCallback =
    Ptr () ->                               -- object
    Ptr Gio.DBusObject.DBusObject ->
    Ptr () ->                               -- user_data
    IO ()

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

-- | Wrap the callback into a `Closure`.
genClosure_DBusObjectManagerObjectRemoved :: DBusObjectManagerObjectRemovedCallback -> IO Closure
genClosure_DBusObjectManagerObjectRemoved cb = do
    let cb' = wrap_DBusObjectManagerObjectRemovedCallback cb
    mk_DBusObjectManagerObjectRemovedCallback cb' >>= newCClosure


-- | Wrap a `DBusObjectManagerObjectRemovedCallback` into a `C_DBusObjectManagerObjectRemovedCallback`.
wrap_DBusObjectManagerObjectRemovedCallback ::
    DBusObjectManagerObjectRemovedCallback ->
    C_DBusObjectManagerObjectRemovedCallback
wrap_DBusObjectManagerObjectRemovedCallback _cb _ object _ = do
    object' <- (newObject Gio.DBusObject.DBusObject) object
    _cb  object'


{- |
Connect a signal handler for the “@object-removed@” 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' dBusObjectManager #objectRemoved callback
@
-}
onDBusObjectManagerObjectRemoved :: (IsDBusObjectManager a, MonadIO m) => a -> DBusObjectManagerObjectRemovedCallback -> m SignalHandlerId
onDBusObjectManagerObjectRemoved obj cb = liftIO $ do
    let cb' = wrap_DBusObjectManagerObjectRemovedCallback cb
    cb'' <- mk_DBusObjectManagerObjectRemovedCallback cb'
    connectSignalFunPtr obj "object-removed" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@object-removed@” 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' dBusObjectManager #objectRemoved callback
@
-}
afterDBusObjectManagerObjectRemoved :: (IsDBusObjectManager a, MonadIO m) => a -> DBusObjectManagerObjectRemovedCallback -> m SignalHandlerId
afterDBusObjectManagerObjectRemoved obj cb = liftIO $ do
    let cb' = wrap_DBusObjectManagerObjectRemovedCallback cb
    cb'' <- mk_DBusObjectManagerObjectRemovedCallback cb'
    connectSignalFunPtr obj "object-removed" cb'' SignalConnectAfter


#if ENABLE_OVERLOADING
data DBusObjectManagerInterfaceAddedSignalInfo
instance SignalInfo DBusObjectManagerInterfaceAddedSignalInfo where
    type HaskellCallbackType DBusObjectManagerInterfaceAddedSignalInfo = DBusObjectManagerInterfaceAddedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_DBusObjectManagerInterfaceAddedCallback cb
        cb'' <- mk_DBusObjectManagerInterfaceAddedCallback cb'
        connectSignalFunPtr obj "interface-added" cb'' connectMode

data DBusObjectManagerInterfaceRemovedSignalInfo
instance SignalInfo DBusObjectManagerInterfaceRemovedSignalInfo where
    type HaskellCallbackType DBusObjectManagerInterfaceRemovedSignalInfo = DBusObjectManagerInterfaceRemovedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_DBusObjectManagerInterfaceRemovedCallback cb
        cb'' <- mk_DBusObjectManagerInterfaceRemovedCallback cb'
        connectSignalFunPtr obj "interface-removed" cb'' connectMode

data DBusObjectManagerObjectAddedSignalInfo
instance SignalInfo DBusObjectManagerObjectAddedSignalInfo where
    type HaskellCallbackType DBusObjectManagerObjectAddedSignalInfo = DBusObjectManagerObjectAddedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_DBusObjectManagerObjectAddedCallback cb
        cb'' <- mk_DBusObjectManagerObjectAddedCallback cb'
        connectSignalFunPtr obj "object-added" cb'' connectMode

data DBusObjectManagerObjectRemovedSignalInfo
instance SignalInfo DBusObjectManagerObjectRemovedSignalInfo where
    type HaskellCallbackType DBusObjectManagerObjectRemovedSignalInfo = DBusObjectManagerObjectRemovedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_DBusObjectManagerObjectRemovedCallback cb
        cb'' <- mk_DBusObjectManagerObjectRemovedCallback cb'
        connectSignalFunPtr obj "object-removed" cb'' connectMode

type instance O.SignalList DBusObjectManager = DBusObjectManagerSignalList
type DBusObjectManagerSignalList = ('[ '("interfaceAdded", DBusObjectManagerInterfaceAddedSignalInfo), '("interfaceRemoved", DBusObjectManagerInterfaceRemovedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("objectAdded", DBusObjectManagerObjectAddedSignalInfo), '("objectRemoved", DBusObjectManagerObjectRemovedSignalInfo)] :: [(Symbol, *)])

#endif

foreign import ccall "g_dbus_object_manager_get_type"
    c_g_dbus_object_manager_get_type :: IO GType

instance GObject DBusObjectManager where
    gobjectType _ = c_g_dbus_object_manager_get_type


-- | Type class for types which can be safely cast to `DBusObjectManager`, for instance with `toDBusObjectManager`.
class GObject o => IsDBusObjectManager o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError DBusObjectManager a) =>
    IsDBusObjectManager a
#endif
instance IsDBusObjectManager DBusObjectManager
instance GObject.Object.IsObject DBusObjectManager

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

#if ENABLE_OVERLOADING
instance O.HasAttributeList DBusObjectManager
type instance O.AttributeList DBusObjectManager = DBusObjectManagerAttributeList
type DBusObjectManagerAttributeList = ('[ ] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
#endif

#if ENABLE_OVERLOADING
type family ResolveDBusObjectManagerMethod (t :: Symbol) (o :: *) :: * where
    ResolveDBusObjectManagerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDBusObjectManagerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDBusObjectManagerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDBusObjectManagerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDBusObjectManagerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveDBusObjectManagerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDBusObjectManagerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDBusObjectManagerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDBusObjectManagerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDBusObjectManagerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDBusObjectManagerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDBusObjectManagerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDBusObjectManagerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDBusObjectManagerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDBusObjectManagerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDBusObjectManagerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDBusObjectManagerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDBusObjectManagerMethod "getInterface" o = DBusObjectManagerGetInterfaceMethodInfo
    ResolveDBusObjectManagerMethod "getObject" o = DBusObjectManagerGetObjectMethodInfo
    ResolveDBusObjectManagerMethod "getObjectPath" o = DBusObjectManagerGetObjectPathMethodInfo
    ResolveDBusObjectManagerMethod "getObjects" o = DBusObjectManagerGetObjectsMethodInfo
    ResolveDBusObjectManagerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDBusObjectManagerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDBusObjectManagerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDBusObjectManagerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDBusObjectManagerMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveDBusObjectManagerMethod t DBusObjectManager, O.MethodInfo info DBusObjectManager p) => O.IsLabelProxy t (DBusObjectManager -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDBusObjectManagerMethod t DBusObjectManager, O.MethodInfo info DBusObjectManager p) => O.IsLabel t (DBusObjectManager -> 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

#endif

-- method DBusObjectManager::get_interface
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "manager", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManager"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusObjectManager.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Object path to lookup.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "interface_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "D-Bus interface name to lookup.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DBusInterface"}))
-- throws : False
-- Skip return : False

foreign import ccall "g_dbus_object_manager_get_interface" g_dbus_object_manager_get_interface ::
    Ptr DBusObjectManager ->                -- manager : TInterface (Name {namespace = "Gio", name = "DBusObjectManager"})
    CString ->                              -- object_path : TBasicType TUTF8
    CString ->                              -- interface_name : TBasicType TUTF8
    IO (Ptr Gio.DBusInterface.DBusInterface)

{- |
Gets the interface proxy for /@interfaceName@/ at /@objectPath@/, if
any.

/Since: 2.30/
-}
dBusObjectManagerGetInterface ::
    (B.CallStack.HasCallStack, MonadIO m, IsDBusObjectManager a) =>
    a
    {- ^ /@manager@/: A 'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'. -}
    -> T.Text
    {- ^ /@objectPath@/: Object path to lookup. -}
    -> T.Text
    {- ^ /@interfaceName@/: D-Bus interface name to lookup. -}
    -> m Gio.DBusInterface.DBusInterface
    {- ^ __Returns:__ A 'GI.Gio.Interfaces.DBusInterface.DBusInterface' instance or 'Nothing'. Free
  with 'GI.GObject.Objects.Object.objectUnref'. -}
dBusObjectManagerGetInterface manager objectPath interfaceName = liftIO $ do
    manager' <- unsafeManagedPtrCastPtr manager
    objectPath' <- textToCString objectPath
    interfaceName' <- textToCString interfaceName
    result <- g_dbus_object_manager_get_interface manager' objectPath' interfaceName'
    checkUnexpectedReturnNULL "dBusObjectManagerGetInterface" result
    result' <- (wrapObject Gio.DBusInterface.DBusInterface) result
    touchManagedPtr manager
    freeMem objectPath'
    freeMem interfaceName'
    return result'

#if ENABLE_OVERLOADING
data DBusObjectManagerGetInterfaceMethodInfo
instance (signature ~ (T.Text -> T.Text -> m Gio.DBusInterface.DBusInterface), MonadIO m, IsDBusObjectManager a) => O.MethodInfo DBusObjectManagerGetInterfaceMethodInfo a signature where
    overloadedMethod _ = dBusObjectManagerGetInterface

#endif

-- method DBusObjectManager::get_object
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "manager", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManager"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusObjectManager.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "object_path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Object path to lookup.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "DBusObject"}))
-- throws : False
-- Skip return : False

foreign import ccall "g_dbus_object_manager_get_object" g_dbus_object_manager_get_object ::
    Ptr DBusObjectManager ->                -- manager : TInterface (Name {namespace = "Gio", name = "DBusObjectManager"})
    CString ->                              -- object_path : TBasicType TUTF8
    IO (Ptr Gio.DBusObject.DBusObject)

{- |
Gets the 'GI.Gio.Objects.DBusObjectProxy.DBusObjectProxy' at /@objectPath@/, if any.

/Since: 2.30/
-}
dBusObjectManagerGetObject ::
    (B.CallStack.HasCallStack, MonadIO m, IsDBusObjectManager a) =>
    a
    {- ^ /@manager@/: A 'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'. -}
    -> T.Text
    {- ^ /@objectPath@/: Object path to lookup. -}
    -> m Gio.DBusObject.DBusObject
    {- ^ __Returns:__ A 'GI.Gio.Interfaces.DBusObject.DBusObject' or 'Nothing'. Free with
  'GI.GObject.Objects.Object.objectUnref'. -}
dBusObjectManagerGetObject manager objectPath = liftIO $ do
    manager' <- unsafeManagedPtrCastPtr manager
    objectPath' <- textToCString objectPath
    result <- g_dbus_object_manager_get_object manager' objectPath'
    checkUnexpectedReturnNULL "dBusObjectManagerGetObject" result
    result' <- (wrapObject Gio.DBusObject.DBusObject) result
    touchManagedPtr manager
    freeMem objectPath'
    return result'

#if ENABLE_OVERLOADING
data DBusObjectManagerGetObjectMethodInfo
instance (signature ~ (T.Text -> m Gio.DBusObject.DBusObject), MonadIO m, IsDBusObjectManager a) => O.MethodInfo DBusObjectManagerGetObjectMethodInfo a signature where
    overloadedMethod _ = dBusObjectManagerGetObject

#endif

-- method DBusObjectManager::get_object_path
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "manager", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManager"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusObjectManager.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "g_dbus_object_manager_get_object_path" g_dbus_object_manager_get_object_path ::
    Ptr DBusObjectManager ->                -- manager : TInterface (Name {namespace = "Gio", name = "DBusObjectManager"})
    IO CString

{- |
Gets the object path that /@manager@/ is for.

/Since: 2.30/
-}
dBusObjectManagerGetObjectPath ::
    (B.CallStack.HasCallStack, MonadIO m, IsDBusObjectManager a) =>
    a
    {- ^ /@manager@/: A 'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'. -}
    -> m T.Text
    {- ^ __Returns:__ A string owned by /@manager@/. Do not free. -}
dBusObjectManagerGetObjectPath manager = liftIO $ do
    manager' <- unsafeManagedPtrCastPtr manager
    result <- g_dbus_object_manager_get_object_path manager'
    checkUnexpectedReturnNULL "dBusObjectManagerGetObjectPath" result
    result' <- cstringToText result
    touchManagedPtr manager
    return result'

#if ENABLE_OVERLOADING
data DBusObjectManagerGetObjectPathMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDBusObjectManager a) => O.MethodInfo DBusObjectManagerGetObjectPathMethodInfo a signature where
    overloadedMethod _ = dBusObjectManagerGetObjectPath

#endif

-- method DBusObjectManager::get_objects
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "manager", argType = TInterface (Name {namespace = "Gio", name = "DBusObjectManager"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GDBusObjectManager.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TGList (TInterface (Name {namespace = "Gio", name = "DBusObject"})))
-- throws : False
-- Skip return : False

foreign import ccall "g_dbus_object_manager_get_objects" g_dbus_object_manager_get_objects ::
    Ptr DBusObjectManager ->                -- manager : TInterface (Name {namespace = "Gio", name = "DBusObjectManager"})
    IO (Ptr (GList (Ptr Gio.DBusObject.DBusObject)))

{- |
Gets all 'GI.Gio.Interfaces.DBusObject.DBusObject' objects known to /@manager@/.

/Since: 2.30/
-}
dBusObjectManagerGetObjects ::
    (B.CallStack.HasCallStack, MonadIO m, IsDBusObjectManager a) =>
    a
    {- ^ /@manager@/: A 'GI.Gio.Interfaces.DBusObjectManager.DBusObjectManager'. -}
    -> m [Gio.DBusObject.DBusObject]
    {- ^ __Returns:__ A list of
  'GI.Gio.Interfaces.DBusObject.DBusObject' objects. The returned list should be freed with
  @/g_list_free()/@ after each element has been freed with
  'GI.GObject.Objects.Object.objectUnref'. -}
dBusObjectManagerGetObjects manager = liftIO $ do
    manager' <- unsafeManagedPtrCastPtr manager
    result <- g_dbus_object_manager_get_objects manager'
    result' <- unpackGList result
    result'' <- mapM (wrapObject Gio.DBusObject.DBusObject) result'
    g_list_free result
    touchManagedPtr manager
    return result''

#if ENABLE_OVERLOADING
data DBusObjectManagerGetObjectsMethodInfo
instance (signature ~ (m [Gio.DBusObject.DBusObject]), MonadIO m, IsDBusObjectManager a) => O.MethodInfo DBusObjectManagerGetObjectsMethodInfo a signature where
    overloadedMethod _ = dBusObjectManagerGetObjects

#endif