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


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- /No description available in the introspection data./
-- 
-- /Since: 1.16/

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

module GI.NM.Objects.DeviceWifiP2P
    ( 

-- * Exported types
    DeviceWifiP2P(..)                       ,
    IsDeviceWifiP2P                         ,
    toDeviceWifiP2P                         ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [connectionCompatible]("GI.NM.Objects.Device#g:method:connectionCompatible"), [connectionValid]("GI.NM.Objects.Device#g:method:connectionValid"), [delete]("GI.NM.Objects.Device#g:method:delete"), [deleteAsync]("GI.NM.Objects.Device#g:method:deleteAsync"), [deleteFinish]("GI.NM.Objects.Device#g:method:deleteFinish"), [disconnect]("GI.NM.Objects.Device#g:method:disconnect"), [disconnectAsync]("GI.NM.Objects.Device#g:method:disconnectAsync"), [disconnectFinish]("GI.NM.Objects.Device#g:method:disconnectFinish"), [filterConnections]("GI.NM.Objects.Device#g:method:filterConnections"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [isReal]("GI.NM.Objects.Device#g:method:isReal"), [isSoftware]("GI.NM.Objects.Device#g:method:isSoftware"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [reapply]("GI.NM.Objects.Device#g:method:reapply"), [reapplyAsync]("GI.NM.Objects.Device#g:method:reapplyAsync"), [reapplyFinish]("GI.NM.Objects.Device#g:method:reapplyFinish"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [startFind]("GI.NM.Objects.DeviceWifiP2P#g:method:startFind"), [startFindFinish]("GI.NM.Objects.DeviceWifiP2P#g:method:startFindFinish"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [stopFind]("GI.NM.Objects.DeviceWifiP2P#g:method:stopFind"), [stopFindFinish]("GI.NM.Objects.DeviceWifiP2P#g:method:stopFindFinish"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getActiveConnection]("GI.NM.Objects.Device#g:method:getActiveConnection"), [getAppliedConnection]("GI.NM.Objects.Device#g:method:getAppliedConnection"), [getAppliedConnectionAsync]("GI.NM.Objects.Device#g:method:getAppliedConnectionAsync"), [getAppliedConnectionFinish]("GI.NM.Objects.Device#g:method:getAppliedConnectionFinish"), [getAutoconnect]("GI.NM.Objects.Device#g:method:getAutoconnect"), [getAvailableConnections]("GI.NM.Objects.Device#g:method:getAvailableConnections"), [getCapabilities]("GI.NM.Objects.Device#g:method:getCapabilities"), [getClient]("GI.NM.Objects.Object#g:method:getClient"), [getConnectivity]("GI.NM.Objects.Device#g:method:getConnectivity"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getDescription]("GI.NM.Objects.Device#g:method:getDescription"), [getDeviceType]("GI.NM.Objects.Device#g:method:getDeviceType"), [getDhcp4Config]("GI.NM.Objects.Device#g:method:getDhcp4Config"), [getDhcp6Config]("GI.NM.Objects.Device#g:method:getDhcp6Config"), [getDriver]("GI.NM.Objects.Device#g:method:getDriver"), [getDriverVersion]("GI.NM.Objects.Device#g:method:getDriverVersion"), [getFirmwareMissing]("GI.NM.Objects.Device#g:method:getFirmwareMissing"), [getFirmwareVersion]("GI.NM.Objects.Device#g:method:getFirmwareVersion"), [getHwAddress]("GI.NM.Objects.Device#g:method:getHwAddress"), [getIface]("GI.NM.Objects.Device#g:method:getIface"), [getInterfaceFlags]("GI.NM.Objects.Device#g:method:getInterfaceFlags"), [getIp4Config]("GI.NM.Objects.Device#g:method:getIp4Config"), [getIp6Config]("GI.NM.Objects.Device#g:method:getIp6Config"), [getIpIface]("GI.NM.Objects.Device#g:method:getIpIface"), [getLldpNeighbors]("GI.NM.Objects.Device#g:method:getLldpNeighbors"), [getManaged]("GI.NM.Objects.Device#g:method:getManaged"), [getMetered]("GI.NM.Objects.Device#g:method:getMetered"), [getMtu]("GI.NM.Objects.Device#g:method:getMtu"), [getNmPluginMissing]("GI.NM.Objects.Device#g:method:getNmPluginMissing"), [getPath]("GI.NM.Objects.Device#g:method:getPath"), [getPeerByPath]("GI.NM.Objects.DeviceWifiP2P#g:method:getPeerByPath"), [getPeers]("GI.NM.Objects.DeviceWifiP2P#g:method:getPeers"), [getPhysicalPortId]("GI.NM.Objects.Device#g:method:getPhysicalPortId"), [getPorts]("GI.NM.Objects.Device#g:method:getPorts"), [getProduct]("GI.NM.Objects.Device#g:method:getProduct"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getSettingType]("GI.NM.Objects.Device#g:method:getSettingType"), [getState]("GI.NM.Objects.Device#g:method:getState"), [getStateReason]("GI.NM.Objects.Device#g:method:getStateReason"), [getTypeDescription]("GI.NM.Objects.Device#g:method:getTypeDescription"), [getUdi]("GI.NM.Objects.Device#g:method:getUdi"), [getVendor]("GI.NM.Objects.Device#g:method:getVendor").
-- 
-- ==== Setters
-- [setAutoconnect]("GI.NM.Objects.Device#g:method:setAutoconnect"), [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setManaged]("GI.NM.Objects.Device#g:method:setManaged"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveDeviceWifiP2PMethod              ,
#endif

-- ** getPeerByPath #method:getPeerByPath#

#if defined(ENABLE_OVERLOADING)
    DeviceWifiP2PGetPeerByPathMethodInfo    ,
#endif
    deviceWifiP2PGetPeerByPath              ,


-- ** getPeers #method:getPeers#

#if defined(ENABLE_OVERLOADING)
    DeviceWifiP2PGetPeersMethodInfo         ,
#endif
    deviceWifiP2PGetPeers                   ,


-- ** startFind #method:startFind#

#if defined(ENABLE_OVERLOADING)
    DeviceWifiP2PStartFindMethodInfo        ,
#endif
    deviceWifiP2PStartFind                  ,


-- ** startFindFinish #method:startFindFinish#

#if defined(ENABLE_OVERLOADING)
    DeviceWifiP2PStartFindFinishMethodInfo  ,
#endif
    deviceWifiP2PStartFindFinish            ,


-- ** stopFind #method:stopFind#

#if defined(ENABLE_OVERLOADING)
    DeviceWifiP2PStopFindMethodInfo         ,
#endif
    deviceWifiP2PStopFind                   ,


-- ** stopFindFinish #method:stopFindFinish#

#if defined(ENABLE_OVERLOADING)
    DeviceWifiP2PStopFindFinishMethodInfo   ,
#endif
    deviceWifiP2PStopFindFinish             ,




 -- * Properties


-- ** peers #attr:peers#

#if defined(ENABLE_OVERLOADING)
    DeviceWifiP2PPeersPropertyInfo          ,
#endif
#if defined(ENABLE_OVERLOADING)
    deviceWifiP2PPeers                      ,
#endif




 -- * Signals


-- ** peerAdded #signal:peerAdded#

    DeviceWifiP2PPeerAddedCallback          ,
#if defined(ENABLE_OVERLOADING)
    DeviceWifiP2PPeerAddedSignalInfo        ,
#endif
    afterDeviceWifiP2PPeerAdded             ,
    onDeviceWifiP2PPeerAdded                ,


-- ** peerRemoved #signal:peerRemoved#

    DeviceWifiP2PPeerRemovedCallback        ,
#if defined(ENABLE_OVERLOADING)
    DeviceWifiP2PPeerRemovedSignalInfo      ,
#endif
    afterDeviceWifiP2PPeerRemoved           ,
    onDeviceWifiP2PPeerRemoved              ,




    ) 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.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.MainContext as GLib.MainContext
import qualified GI.GLib.Structs.VariantType as GLib.VariantType
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncInitable as Gio.AsyncInitable
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.DBusConnection as Gio.DBusConnection
import qualified GI.NM.Callbacks as NM.Callbacks
import {-# SOURCE #-} qualified GI.NM.Enums as NM.Enums
import {-# SOURCE #-} qualified GI.NM.Flags as NM.Flags
import {-# SOURCE #-} qualified GI.NM.Interfaces.Connection as NM.Connection
import {-# SOURCE #-} qualified GI.NM.Objects.ActiveConnection as NM.ActiveConnection
import {-# SOURCE #-} qualified GI.NM.Objects.Checkpoint as NM.Checkpoint
import {-# SOURCE #-} qualified GI.NM.Objects.Client as NM.Client
import {-# SOURCE #-} qualified GI.NM.Objects.Device as NM.Device
import {-# SOURCE #-} qualified GI.NM.Objects.DhcpConfig as NM.DhcpConfig
import {-# SOURCE #-} qualified GI.NM.Objects.IPConfig as NM.IPConfig
import {-# SOURCE #-} qualified GI.NM.Objects.Object as NM.Object
import {-# SOURCE #-} qualified GI.NM.Objects.RemoteConnection as NM.RemoteConnection
import {-# SOURCE #-} qualified GI.NM.Objects.Setting as NM.Setting
import {-# SOURCE #-} qualified GI.NM.Objects.Setting8021x as NM.Setting8021x
import {-# SOURCE #-} qualified GI.NM.Objects.SettingAdsl as NM.SettingAdsl
import {-# SOURCE #-} qualified GI.NM.Objects.SettingBluetooth as NM.SettingBluetooth
import {-# SOURCE #-} qualified GI.NM.Objects.SettingBond as NM.SettingBond
import {-# SOURCE #-} qualified GI.NM.Objects.SettingBridge as NM.SettingBridge
import {-# SOURCE #-} qualified GI.NM.Objects.SettingBridgePort as NM.SettingBridgePort
import {-# SOURCE #-} qualified GI.NM.Objects.SettingCdma as NM.SettingCdma
import {-# SOURCE #-} qualified GI.NM.Objects.SettingConnection as NM.SettingConnection
import {-# SOURCE #-} qualified GI.NM.Objects.SettingDcb as NM.SettingDcb
import {-# SOURCE #-} qualified GI.NM.Objects.SettingDummy as NM.SettingDummy
import {-# SOURCE #-} qualified GI.NM.Objects.SettingGeneric as NM.SettingGeneric
import {-# SOURCE #-} qualified GI.NM.Objects.SettingGsm as NM.SettingGsm
import {-# SOURCE #-} qualified GI.NM.Objects.SettingIP4Config as NM.SettingIP4Config
import {-# SOURCE #-} qualified GI.NM.Objects.SettingIP6Config as NM.SettingIP6Config
import {-# SOURCE #-} qualified GI.NM.Objects.SettingIPConfig as NM.SettingIPConfig
import {-# SOURCE #-} qualified GI.NM.Objects.SettingIPTunnel as NM.SettingIPTunnel
import {-# SOURCE #-} qualified GI.NM.Objects.SettingInfiniband as NM.SettingInfiniband
import {-# SOURCE #-} qualified GI.NM.Objects.SettingMacsec as NM.SettingMacsec
import {-# SOURCE #-} qualified GI.NM.Objects.SettingMacvlan as NM.SettingMacvlan
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOlpcMesh as NM.SettingOlpcMesh
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOvsBridge as NM.SettingOvsBridge
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOvsInterface as NM.SettingOvsInterface
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOvsPatch as NM.SettingOvsPatch
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOvsPort as NM.SettingOvsPort
import {-# SOURCE #-} qualified GI.NM.Objects.SettingPpp as NM.SettingPpp
import {-# SOURCE #-} qualified GI.NM.Objects.SettingPppoe as NM.SettingPppoe
import {-# SOURCE #-} qualified GI.NM.Objects.SettingProxy as NM.SettingProxy
import {-# SOURCE #-} qualified GI.NM.Objects.SettingSerial as NM.SettingSerial
import {-# SOURCE #-} qualified GI.NM.Objects.SettingTCConfig as NM.SettingTCConfig
import {-# SOURCE #-} qualified GI.NM.Objects.SettingTeam as NM.SettingTeam
import {-# SOURCE #-} qualified GI.NM.Objects.SettingTeamPort as NM.SettingTeamPort
import {-# SOURCE #-} qualified GI.NM.Objects.SettingTun as NM.SettingTun
import {-# SOURCE #-} qualified GI.NM.Objects.SettingVlan as NM.SettingVlan
import {-# SOURCE #-} qualified GI.NM.Objects.SettingVpn as NM.SettingVpn
import {-# SOURCE #-} qualified GI.NM.Objects.SettingVxlan as NM.SettingVxlan
import {-# SOURCE #-} qualified GI.NM.Objects.SettingWimax as NM.SettingWimax
import {-# SOURCE #-} qualified GI.NM.Objects.SettingWired as NM.SettingWired
import {-# SOURCE #-} qualified GI.NM.Objects.SettingWireless as NM.SettingWireless
import {-# SOURCE #-} qualified GI.NM.Objects.SettingWirelessSecurity as NM.SettingWirelessSecurity
import {-# SOURCE #-} qualified GI.NM.Objects.WifiP2PPeer as NM.WifiP2PPeer
import {-# SOURCE #-} qualified GI.NM.Structs.BridgeVlan as NM.BridgeVlan
import {-# SOURCE #-} qualified GI.NM.Structs.DnsEntry as NM.DnsEntry
import {-# SOURCE #-} qualified GI.NM.Structs.IPAddress as NM.IPAddress
import {-# SOURCE #-} qualified GI.NM.Structs.IPRoute as NM.IPRoute
import {-# SOURCE #-} qualified GI.NM.Structs.IPRoutingRule as NM.IPRoutingRule
import {-# SOURCE #-} qualified GI.NM.Structs.LldpNeighbor as NM.LldpNeighbor
import {-# SOURCE #-} qualified GI.NM.Structs.Range as NM.Range
import {-# SOURCE #-} qualified GI.NM.Structs.TCAction as NM.TCAction
import {-# SOURCE #-} qualified GI.NM.Structs.TCQdisc as NM.TCQdisc
import {-# SOURCE #-} qualified GI.NM.Structs.TCTfilter as NM.TCTfilter
import {-# SOURCE #-} qualified GI.NM.Structs.TeamLinkWatcher as NM.TeamLinkWatcher
import {-# SOURCE #-} qualified GI.NM.Structs.VariantAttributeSpec as NM.VariantAttributeSpec

#else
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 {-# SOURCE #-} qualified GI.NM.Objects.Device as NM.Device
import {-# SOURCE #-} qualified GI.NM.Objects.Object as NM.Object
import {-# SOURCE #-} qualified GI.NM.Objects.WifiP2PPeer as NM.WifiP2PPeer

#endif

-- | Memory-managed wrapper type.
newtype DeviceWifiP2P = DeviceWifiP2P (SP.ManagedPtr DeviceWifiP2P)
    deriving (DeviceWifiP2P -> DeviceWifiP2P -> Bool
(DeviceWifiP2P -> DeviceWifiP2P -> Bool)
-> (DeviceWifiP2P -> DeviceWifiP2P -> Bool) -> Eq DeviceWifiP2P
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DeviceWifiP2P -> DeviceWifiP2P -> Bool
== :: DeviceWifiP2P -> DeviceWifiP2P -> Bool
$c/= :: DeviceWifiP2P -> DeviceWifiP2P -> Bool
/= :: DeviceWifiP2P -> DeviceWifiP2P -> Bool
Eq)

instance SP.ManagedPtrNewtype DeviceWifiP2P where
    toManagedPtr :: DeviceWifiP2P -> ManagedPtr DeviceWifiP2P
toManagedPtr (DeviceWifiP2P ManagedPtr DeviceWifiP2P
p) = ManagedPtr DeviceWifiP2P
p

foreign import ccall "nm_device_wifi_p2p_get_type"
    c_nm_device_wifi_p2p_get_type :: IO B.Types.GType

instance B.Types.TypedObject DeviceWifiP2P where
    glibType :: IO GType
glibType = IO GType
c_nm_device_wifi_p2p_get_type

instance B.Types.GObject DeviceWifiP2P

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

instance O.HasParentTypes DeviceWifiP2P
type instance O.ParentTypes DeviceWifiP2P = '[NM.Device.Device, NM.Object.Object, GObject.Object.Object]

-- | Cast to t'DeviceWifiP2P', for types for which this is known to be safe. For general casts, use 'Data.GI.Base.ManagedPtr.castTo'.
toDeviceWifiP2P :: (MIO.MonadIO m, IsDeviceWifiP2P o) => o -> m DeviceWifiP2P
toDeviceWifiP2P :: forall (m :: * -> *) o.
(MonadIO m, IsDeviceWifiP2P o) =>
o -> m DeviceWifiP2P
toDeviceWifiP2P = IO DeviceWifiP2P -> m DeviceWifiP2P
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO DeviceWifiP2P -> m DeviceWifiP2P)
-> (o -> IO DeviceWifiP2P) -> o -> m DeviceWifiP2P
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr DeviceWifiP2P -> DeviceWifiP2P)
-> o -> IO DeviceWifiP2P
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr DeviceWifiP2P -> DeviceWifiP2P
DeviceWifiP2P

-- | Convert t'DeviceWifiP2P' 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 DeviceWifiP2P) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_nm_device_wifi_p2p_get_type
    gvalueSet_ :: Ptr GValue -> Maybe DeviceWifiP2P -> IO ()
gvalueSet_ Ptr GValue
gv Maybe DeviceWifiP2P
P.Nothing = Ptr GValue -> Ptr DeviceWifiP2P -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr DeviceWifiP2P
forall a. Ptr a
FP.nullPtr :: FP.Ptr DeviceWifiP2P)
    gvalueSet_ Ptr GValue
gv (P.Just DeviceWifiP2P
obj) = DeviceWifiP2P -> (Ptr DeviceWifiP2P -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DeviceWifiP2P
obj (Ptr GValue -> Ptr DeviceWifiP2P -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe DeviceWifiP2P)
gvalueGet_ Ptr GValue
gv = do
        Ptr DeviceWifiP2P
ptr <- Ptr GValue -> IO (Ptr DeviceWifiP2P)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr DeviceWifiP2P)
        if Ptr DeviceWifiP2P
ptr Ptr DeviceWifiP2P -> Ptr DeviceWifiP2P -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr DeviceWifiP2P
forall a. Ptr a
FP.nullPtr
        then DeviceWifiP2P -> Maybe DeviceWifiP2P
forall a. a -> Maybe a
P.Just (DeviceWifiP2P -> Maybe DeviceWifiP2P)
-> IO DeviceWifiP2P -> IO (Maybe DeviceWifiP2P)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr DeviceWifiP2P -> DeviceWifiP2P)
-> Ptr DeviceWifiP2P -> IO DeviceWifiP2P
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr DeviceWifiP2P -> DeviceWifiP2P
DeviceWifiP2P Ptr DeviceWifiP2P
ptr
        else Maybe DeviceWifiP2P -> IO (Maybe DeviceWifiP2P)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe DeviceWifiP2P
forall a. Maybe a
P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveDeviceWifiP2PMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveDeviceWifiP2PMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDeviceWifiP2PMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDeviceWifiP2PMethod "connectionCompatible" o = NM.Device.DeviceConnectionCompatibleMethodInfo
    ResolveDeviceWifiP2PMethod "connectionValid" o = NM.Device.DeviceConnectionValidMethodInfo
    ResolveDeviceWifiP2PMethod "delete" o = NM.Device.DeviceDeleteMethodInfo
    ResolveDeviceWifiP2PMethod "deleteAsync" o = NM.Device.DeviceDeleteAsyncMethodInfo
    ResolveDeviceWifiP2PMethod "deleteFinish" o = NM.Device.DeviceDeleteFinishMethodInfo
    ResolveDeviceWifiP2PMethod "disconnect" o = NM.Device.DeviceDisconnectMethodInfo
    ResolveDeviceWifiP2PMethod "disconnectAsync" o = NM.Device.DeviceDisconnectAsyncMethodInfo
    ResolveDeviceWifiP2PMethod "disconnectFinish" o = NM.Device.DeviceDisconnectFinishMethodInfo
    ResolveDeviceWifiP2PMethod "filterConnections" o = NM.Device.DeviceFilterConnectionsMethodInfo
    ResolveDeviceWifiP2PMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDeviceWifiP2PMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDeviceWifiP2PMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveDeviceWifiP2PMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDeviceWifiP2PMethod "isReal" o = NM.Device.DeviceIsRealMethodInfo
    ResolveDeviceWifiP2PMethod "isSoftware" o = NM.Device.DeviceIsSoftwareMethodInfo
    ResolveDeviceWifiP2PMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDeviceWifiP2PMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDeviceWifiP2PMethod "reapply" o = NM.Device.DeviceReapplyMethodInfo
    ResolveDeviceWifiP2PMethod "reapplyAsync" o = NM.Device.DeviceReapplyAsyncMethodInfo
    ResolveDeviceWifiP2PMethod "reapplyFinish" o = NM.Device.DeviceReapplyFinishMethodInfo
    ResolveDeviceWifiP2PMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDeviceWifiP2PMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDeviceWifiP2PMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDeviceWifiP2PMethod "startFind" o = DeviceWifiP2PStartFindMethodInfo
    ResolveDeviceWifiP2PMethod "startFindFinish" o = DeviceWifiP2PStartFindFinishMethodInfo
    ResolveDeviceWifiP2PMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDeviceWifiP2PMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDeviceWifiP2PMethod "stopFind" o = DeviceWifiP2PStopFindMethodInfo
    ResolveDeviceWifiP2PMethod "stopFindFinish" o = DeviceWifiP2PStopFindFinishMethodInfo
    ResolveDeviceWifiP2PMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDeviceWifiP2PMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDeviceWifiP2PMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDeviceWifiP2PMethod "getActiveConnection" o = NM.Device.DeviceGetActiveConnectionMethodInfo
    ResolveDeviceWifiP2PMethod "getAppliedConnection" o = NM.Device.DeviceGetAppliedConnectionMethodInfo
    ResolveDeviceWifiP2PMethod "getAppliedConnectionAsync" o = NM.Device.DeviceGetAppliedConnectionAsyncMethodInfo
    ResolveDeviceWifiP2PMethod "getAppliedConnectionFinish" o = NM.Device.DeviceGetAppliedConnectionFinishMethodInfo
    ResolveDeviceWifiP2PMethod "getAutoconnect" o = NM.Device.DeviceGetAutoconnectMethodInfo
    ResolveDeviceWifiP2PMethod "getAvailableConnections" o = NM.Device.DeviceGetAvailableConnectionsMethodInfo
    ResolveDeviceWifiP2PMethod "getCapabilities" o = NM.Device.DeviceGetCapabilitiesMethodInfo
    ResolveDeviceWifiP2PMethod "getClient" o = NM.Object.ObjectGetClientMethodInfo
    ResolveDeviceWifiP2PMethod "getConnectivity" o = NM.Device.DeviceGetConnectivityMethodInfo
    ResolveDeviceWifiP2PMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDeviceWifiP2PMethod "getDescription" o = NM.Device.DeviceGetDescriptionMethodInfo
    ResolveDeviceWifiP2PMethod "getDeviceType" o = NM.Device.DeviceGetDeviceTypeMethodInfo
    ResolveDeviceWifiP2PMethod "getDhcp4Config" o = NM.Device.DeviceGetDhcp4ConfigMethodInfo
    ResolveDeviceWifiP2PMethod "getDhcp6Config" o = NM.Device.DeviceGetDhcp6ConfigMethodInfo
    ResolveDeviceWifiP2PMethod "getDriver" o = NM.Device.DeviceGetDriverMethodInfo
    ResolveDeviceWifiP2PMethod "getDriverVersion" o = NM.Device.DeviceGetDriverVersionMethodInfo
    ResolveDeviceWifiP2PMethod "getFirmwareMissing" o = NM.Device.DeviceGetFirmwareMissingMethodInfo
    ResolveDeviceWifiP2PMethod "getFirmwareVersion" o = NM.Device.DeviceGetFirmwareVersionMethodInfo
    ResolveDeviceWifiP2PMethod "getHwAddress" o = NM.Device.DeviceGetHwAddressMethodInfo
    ResolveDeviceWifiP2PMethod "getIface" o = NM.Device.DeviceGetIfaceMethodInfo
    ResolveDeviceWifiP2PMethod "getInterfaceFlags" o = NM.Device.DeviceGetInterfaceFlagsMethodInfo
    ResolveDeviceWifiP2PMethod "getIp4Config" o = NM.Device.DeviceGetIp4ConfigMethodInfo
    ResolveDeviceWifiP2PMethod "getIp6Config" o = NM.Device.DeviceGetIp6ConfigMethodInfo
    ResolveDeviceWifiP2PMethod "getIpIface" o = NM.Device.DeviceGetIpIfaceMethodInfo
    ResolveDeviceWifiP2PMethod "getLldpNeighbors" o = NM.Device.DeviceGetLldpNeighborsMethodInfo
    ResolveDeviceWifiP2PMethod "getManaged" o = NM.Device.DeviceGetManagedMethodInfo
    ResolveDeviceWifiP2PMethod "getMetered" o = NM.Device.DeviceGetMeteredMethodInfo
    ResolveDeviceWifiP2PMethod "getMtu" o = NM.Device.DeviceGetMtuMethodInfo
    ResolveDeviceWifiP2PMethod "getNmPluginMissing" o = NM.Device.DeviceGetNmPluginMissingMethodInfo
    ResolveDeviceWifiP2PMethod "getPath" o = NM.Device.DeviceGetPathMethodInfo
    ResolveDeviceWifiP2PMethod "getPeerByPath" o = DeviceWifiP2PGetPeerByPathMethodInfo
    ResolveDeviceWifiP2PMethod "getPeers" o = DeviceWifiP2PGetPeersMethodInfo
    ResolveDeviceWifiP2PMethod "getPhysicalPortId" o = NM.Device.DeviceGetPhysicalPortIdMethodInfo
    ResolveDeviceWifiP2PMethod "getPorts" o = NM.Device.DeviceGetPortsMethodInfo
    ResolveDeviceWifiP2PMethod "getProduct" o = NM.Device.DeviceGetProductMethodInfo
    ResolveDeviceWifiP2PMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDeviceWifiP2PMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDeviceWifiP2PMethod "getSettingType" o = NM.Device.DeviceGetSettingTypeMethodInfo
    ResolveDeviceWifiP2PMethod "getState" o = NM.Device.DeviceGetStateMethodInfo
    ResolveDeviceWifiP2PMethod "getStateReason" o = NM.Device.DeviceGetStateReasonMethodInfo
    ResolveDeviceWifiP2PMethod "getTypeDescription" o = NM.Device.DeviceGetTypeDescriptionMethodInfo
    ResolveDeviceWifiP2PMethod "getUdi" o = NM.Device.DeviceGetUdiMethodInfo
    ResolveDeviceWifiP2PMethod "getVendor" o = NM.Device.DeviceGetVendorMethodInfo
    ResolveDeviceWifiP2PMethod "setAutoconnect" o = NM.Device.DeviceSetAutoconnectMethodInfo
    ResolveDeviceWifiP2PMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDeviceWifiP2PMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveDeviceWifiP2PMethod "setManaged" o = NM.Device.DeviceSetManagedMethodInfo
    ResolveDeviceWifiP2PMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDeviceWifiP2PMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

-- signal DeviceWifiP2P::peer-added
-- | Notifies that a t'GI.NM.Objects.WifiP2PPeer.WifiP2PPeer' is added to the Wi-Fi P2P device.
-- 
-- /Since: 1.16/
type DeviceWifiP2PPeerAddedCallback =
    GObject.Object.Object
    -- ^ /@peer@/: the new access point
    -> IO ()

type C_DeviceWifiP2PPeerAddedCallback =
    Ptr DeviceWifiP2P ->                    -- object
    Ptr GObject.Object.Object ->
    Ptr () ->                               -- user_data
    IO ()

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

wrap_DeviceWifiP2PPeerAddedCallback :: 
    GObject a => (a -> DeviceWifiP2PPeerAddedCallback) ->
    C_DeviceWifiP2PPeerAddedCallback
wrap_DeviceWifiP2PPeerAddedCallback :: forall a.
GObject a =>
(a -> DeviceWifiP2PPeerAddedCallback)
-> C_DeviceWifiP2PPeerAddedCallback
wrap_DeviceWifiP2PPeerAddedCallback a -> DeviceWifiP2PPeerAddedCallback
gi'cb Ptr DeviceWifiP2P
gi'selfPtr Ptr Object
peer Ptr ()
_ = do
    Object
peer' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
GObject.Object.Object) Ptr Object
peer
    Ptr DeviceWifiP2P -> (DeviceWifiP2P -> IO ()) -> IO ()
forall o b.
(HasCallStack, GObject o) =>
Ptr o -> (o -> IO b) -> IO b
B.ManagedPtr.withNewObject Ptr DeviceWifiP2P
gi'selfPtr ((DeviceWifiP2P -> IO ()) -> IO ())
-> (DeviceWifiP2P -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \DeviceWifiP2P
gi'self -> a -> DeviceWifiP2PPeerAddedCallback
gi'cb (DeviceWifiP2P -> a
forall a b. Coercible a b => a -> b
Coerce.coerce DeviceWifiP2P
gi'self)  Object
peer'


-- | Connect a signal handler for the [peerAdded](#signal:peerAdded) 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' deviceWifiP2P #peerAdded callback
-- @
-- 
-- 
onDeviceWifiP2PPeerAdded :: (IsDeviceWifiP2P a, MonadIO m) => a -> ((?self :: a) => DeviceWifiP2PPeerAddedCallback) -> m SignalHandlerId
onDeviceWifiP2PPeerAdded :: forall a (m :: * -> *).
(IsDeviceWifiP2P a, MonadIO m) =>
a
-> ((?self::a) => DeviceWifiP2PPeerAddedCallback)
-> m SignalHandlerId
onDeviceWifiP2PPeerAdded a
obj (?self::a) => DeviceWifiP2PPeerAddedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> DeviceWifiP2PPeerAddedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DeviceWifiP2PPeerAddedCallback
DeviceWifiP2PPeerAddedCallback
cb
    let wrapped' :: C_DeviceWifiP2PPeerAddedCallback
wrapped' = (a -> DeviceWifiP2PPeerAddedCallback)
-> C_DeviceWifiP2PPeerAddedCallback
forall a.
GObject a =>
(a -> DeviceWifiP2PPeerAddedCallback)
-> C_DeviceWifiP2PPeerAddedCallback
wrap_DeviceWifiP2PPeerAddedCallback a -> DeviceWifiP2PPeerAddedCallback
wrapped
    FunPtr C_DeviceWifiP2PPeerAddedCallback
wrapped'' <- C_DeviceWifiP2PPeerAddedCallback
-> IO (FunPtr C_DeviceWifiP2PPeerAddedCallback)
mk_DeviceWifiP2PPeerAddedCallback C_DeviceWifiP2PPeerAddedCallback
wrapped'
    a
-> Text
-> FunPtr C_DeviceWifiP2PPeerAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"peer-added" FunPtr C_DeviceWifiP2PPeerAddedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [peerAdded](#signal:peerAdded) 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' deviceWifiP2P #peerAdded 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.
-- 
afterDeviceWifiP2PPeerAdded :: (IsDeviceWifiP2P a, MonadIO m) => a -> ((?self :: a) => DeviceWifiP2PPeerAddedCallback) -> m SignalHandlerId
afterDeviceWifiP2PPeerAdded :: forall a (m :: * -> *).
(IsDeviceWifiP2P a, MonadIO m) =>
a
-> ((?self::a) => DeviceWifiP2PPeerAddedCallback)
-> m SignalHandlerId
afterDeviceWifiP2PPeerAdded a
obj (?self::a) => DeviceWifiP2PPeerAddedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> DeviceWifiP2PPeerAddedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DeviceWifiP2PPeerAddedCallback
DeviceWifiP2PPeerAddedCallback
cb
    let wrapped' :: C_DeviceWifiP2PPeerAddedCallback
wrapped' = (a -> DeviceWifiP2PPeerAddedCallback)
-> C_DeviceWifiP2PPeerAddedCallback
forall a.
GObject a =>
(a -> DeviceWifiP2PPeerAddedCallback)
-> C_DeviceWifiP2PPeerAddedCallback
wrap_DeviceWifiP2PPeerAddedCallback a -> DeviceWifiP2PPeerAddedCallback
wrapped
    FunPtr C_DeviceWifiP2PPeerAddedCallback
wrapped'' <- C_DeviceWifiP2PPeerAddedCallback
-> IO (FunPtr C_DeviceWifiP2PPeerAddedCallback)
mk_DeviceWifiP2PPeerAddedCallback C_DeviceWifiP2PPeerAddedCallback
wrapped'
    a
-> Text
-> FunPtr C_DeviceWifiP2PPeerAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"peer-added" FunPtr C_DeviceWifiP2PPeerAddedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data DeviceWifiP2PPeerAddedSignalInfo
instance SignalInfo DeviceWifiP2PPeerAddedSignalInfo where
    type HaskellCallbackType DeviceWifiP2PPeerAddedSignalInfo = DeviceWifiP2PPeerAddedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_DeviceWifiP2PPeerAddedCallback cb
        cb'' <- mk_DeviceWifiP2PPeerAddedCallback cb'
        connectSignalFunPtr obj "peer-added" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.DeviceWifiP2P::peer-added"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-DeviceWifiP2P.html#g:signal:peerAdded"})

#endif

-- signal DeviceWifiP2P::peer-removed
-- | Notifies that a t'GI.NM.Objects.WifiP2PPeer.WifiP2PPeer' is removed from the Wi-Fi P2P device.
-- 
-- /Since: 1.16/
type DeviceWifiP2PPeerRemovedCallback =
    GObject.Object.Object
    -- ^ /@peer@/: the removed access point
    -> IO ()

type C_DeviceWifiP2PPeerRemovedCallback =
    Ptr DeviceWifiP2P ->                    -- object
    Ptr GObject.Object.Object ->
    Ptr () ->                               -- user_data
    IO ()

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

wrap_DeviceWifiP2PPeerRemovedCallback :: 
    GObject a => (a -> DeviceWifiP2PPeerRemovedCallback) ->
    C_DeviceWifiP2PPeerRemovedCallback
wrap_DeviceWifiP2PPeerRemovedCallback :: forall a.
GObject a =>
(a -> DeviceWifiP2PPeerAddedCallback)
-> C_DeviceWifiP2PPeerAddedCallback
wrap_DeviceWifiP2PPeerRemovedCallback a -> DeviceWifiP2PPeerAddedCallback
gi'cb Ptr DeviceWifiP2P
gi'selfPtr Ptr Object
peer Ptr ()
_ = do
    Object
peer' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
GObject.Object.Object) Ptr Object
peer
    Ptr DeviceWifiP2P -> (DeviceWifiP2P -> IO ()) -> IO ()
forall o b.
(HasCallStack, GObject o) =>
Ptr o -> (o -> IO b) -> IO b
B.ManagedPtr.withNewObject Ptr DeviceWifiP2P
gi'selfPtr ((DeviceWifiP2P -> IO ()) -> IO ())
-> (DeviceWifiP2P -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \DeviceWifiP2P
gi'self -> a -> DeviceWifiP2PPeerAddedCallback
gi'cb (DeviceWifiP2P -> a
forall a b. Coercible a b => a -> b
Coerce.coerce DeviceWifiP2P
gi'self)  Object
peer'


-- | Connect a signal handler for the [peerRemoved](#signal:peerRemoved) 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' deviceWifiP2P #peerRemoved callback
-- @
-- 
-- 
onDeviceWifiP2PPeerRemoved :: (IsDeviceWifiP2P a, MonadIO m) => a -> ((?self :: a) => DeviceWifiP2PPeerRemovedCallback) -> m SignalHandlerId
onDeviceWifiP2PPeerRemoved :: forall a (m :: * -> *).
(IsDeviceWifiP2P a, MonadIO m) =>
a
-> ((?self::a) => DeviceWifiP2PPeerAddedCallback)
-> m SignalHandlerId
onDeviceWifiP2PPeerRemoved a
obj (?self::a) => DeviceWifiP2PPeerAddedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> DeviceWifiP2PPeerAddedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DeviceWifiP2PPeerAddedCallback
DeviceWifiP2PPeerAddedCallback
cb
    let wrapped' :: C_DeviceWifiP2PPeerAddedCallback
wrapped' = (a -> DeviceWifiP2PPeerAddedCallback)
-> C_DeviceWifiP2PPeerAddedCallback
forall a.
GObject a =>
(a -> DeviceWifiP2PPeerAddedCallback)
-> C_DeviceWifiP2PPeerAddedCallback
wrap_DeviceWifiP2PPeerRemovedCallback a -> DeviceWifiP2PPeerAddedCallback
wrapped
    FunPtr C_DeviceWifiP2PPeerAddedCallback
wrapped'' <- C_DeviceWifiP2PPeerAddedCallback
-> IO (FunPtr C_DeviceWifiP2PPeerAddedCallback)
mk_DeviceWifiP2PPeerRemovedCallback C_DeviceWifiP2PPeerAddedCallback
wrapped'
    a
-> Text
-> FunPtr C_DeviceWifiP2PPeerAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"peer-removed" FunPtr C_DeviceWifiP2PPeerAddedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [peerRemoved](#signal:peerRemoved) 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' deviceWifiP2P #peerRemoved 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.
-- 
afterDeviceWifiP2PPeerRemoved :: (IsDeviceWifiP2P a, MonadIO m) => a -> ((?self :: a) => DeviceWifiP2PPeerRemovedCallback) -> m SignalHandlerId
afterDeviceWifiP2PPeerRemoved :: forall a (m :: * -> *).
(IsDeviceWifiP2P a, MonadIO m) =>
a
-> ((?self::a) => DeviceWifiP2PPeerAddedCallback)
-> m SignalHandlerId
afterDeviceWifiP2PPeerRemoved a
obj (?self::a) => DeviceWifiP2PPeerAddedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let wrapped :: a -> DeviceWifiP2PPeerAddedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => DeviceWifiP2PPeerAddedCallback
DeviceWifiP2PPeerAddedCallback
cb
    let wrapped' :: C_DeviceWifiP2PPeerAddedCallback
wrapped' = (a -> DeviceWifiP2PPeerAddedCallback)
-> C_DeviceWifiP2PPeerAddedCallback
forall a.
GObject a =>
(a -> DeviceWifiP2PPeerAddedCallback)
-> C_DeviceWifiP2PPeerAddedCallback
wrap_DeviceWifiP2PPeerRemovedCallback a -> DeviceWifiP2PPeerAddedCallback
wrapped
    FunPtr C_DeviceWifiP2PPeerAddedCallback
wrapped'' <- C_DeviceWifiP2PPeerAddedCallback
-> IO (FunPtr C_DeviceWifiP2PPeerAddedCallback)
mk_DeviceWifiP2PPeerRemovedCallback C_DeviceWifiP2PPeerAddedCallback
wrapped'
    a
-> Text
-> FunPtr C_DeviceWifiP2PPeerAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"peer-removed" FunPtr C_DeviceWifiP2PPeerAddedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data DeviceWifiP2PPeerRemovedSignalInfo
instance SignalInfo DeviceWifiP2PPeerRemovedSignalInfo where
    type HaskellCallbackType DeviceWifiP2PPeerRemovedSignalInfo = DeviceWifiP2PPeerRemovedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_DeviceWifiP2PPeerRemovedCallback cb
        cb'' <- mk_DeviceWifiP2PPeerRemovedCallback cb'
        connectSignalFunPtr obj "peer-removed" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.DeviceWifiP2P::peer-removed"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-DeviceWifiP2P.html#g:signal:peerRemoved"})

#endif

--- XXX Duplicated object with different types:
  --- Name {namespace = "NM", name = "Device"} -> Property {propName = "path", propType = TBasicType TUTF8, propFlags = [PropertyReadable], propReadNullable = Just False, propWriteNullable = Nothing, propSetter = Nothing, propGetter = Just "get_path", propTransfer = TransferNothing, propDoc = Documentation {rawDocText = Just "The device path as exposed by the udev property ID_PATH.\n\nThe string is backslash escaped (C escaping) for invalid\ncharacters. The escaping can be reverted with g_strcompress(),\nhowever the result may not be valid UTF-8.", sinceVersion = Just "1.26"}, propDeprecated = Nothing}
  --- Name {namespace = "NM", name = "Object"} -> Property {propName = "path", propType = TBasicType TUTF8, propFlags = [PropertyReadable], propReadNullable = Just False, propWriteNullable = Nothing, propSetter = Nothing, propGetter = Just "get_path", propTransfer = TransferNothing, propDoc = Documentation {rawDocText = Just "The D-Bus object path.\n\nThe D-Bus path of an object instance never changes, even if the object\ngets removed from the cache. To see whether the object is still in the\ncache, check NMObject:client.", sinceVersion = Nothing}, propDeprecated = Nothing}
-- XXX Generation of property "peers" of object "DeviceWifiP2P" failed.
-- Not implemented: Don't know how to handle properties of type TPtrArray (TInterface (Name {namespace = "NM", name = "WifiP2PPeer"}))
#if defined(ENABLE_OVERLOADING)
-- XXX Placeholder
data DeviceWifiP2PPeersPropertyInfo
instance AttrInfo DeviceWifiP2PPeersPropertyInfo where
    type AttrAllowedOps DeviceWifiP2PPeersPropertyInfo = '[]
    type AttrSetTypeConstraint DeviceWifiP2PPeersPropertyInfo = (~) ()
    type AttrTransferTypeConstraint DeviceWifiP2PPeersPropertyInfo = (~) ()
    type AttrTransferType DeviceWifiP2PPeersPropertyInfo = ()
    type AttrBaseTypeConstraint DeviceWifiP2PPeersPropertyInfo = (~) ()
    type AttrGetType DeviceWifiP2PPeersPropertyInfo = ()
    type AttrLabel DeviceWifiP2PPeersPropertyInfo = ""
    type AttrOrigin DeviceWifiP2PPeersPropertyInfo = DeviceWifiP2P
    attrGet = undefined
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DeviceWifiP2P
type instance O.AttributeList DeviceWifiP2P = DeviceWifiP2PAttributeList
type DeviceWifiP2PAttributeList = ('[ '("activeConnection", NM.Device.DeviceActiveConnectionPropertyInfo), '("autoconnect", NM.Device.DeviceAutoconnectPropertyInfo), '("availableConnections", NM.Device.DeviceAvailableConnectionsPropertyInfo), '("capabilities", NM.Device.DeviceCapabilitiesPropertyInfo), '("client", NM.Object.ObjectClientPropertyInfo), '("deviceType", NM.Device.DeviceDeviceTypePropertyInfo), '("dhcp4Config", NM.Device.DeviceDhcp4ConfigPropertyInfo), '("dhcp6Config", NM.Device.DeviceDhcp6ConfigPropertyInfo), '("driver", NM.Device.DeviceDriverPropertyInfo), '("driverVersion", NM.Device.DeviceDriverVersionPropertyInfo), '("firmwareMissing", NM.Device.DeviceFirmwareMissingPropertyInfo), '("firmwareVersion", NM.Device.DeviceFirmwareVersionPropertyInfo), '("hwAddress", NM.Device.DeviceHwAddressPropertyInfo), '("interface", NM.Device.DeviceInterfacePropertyInfo), '("interfaceFlags", NM.Device.DeviceInterfaceFlagsPropertyInfo), '("ipInterface", NM.Device.DeviceIpInterfacePropertyInfo), '("ip4Config", NM.Device.DeviceIp4ConfigPropertyInfo), '("ip4Connectivity", NM.Device.DeviceIp4ConnectivityPropertyInfo), '("ip6Config", NM.Device.DeviceIp6ConfigPropertyInfo), '("ip6Connectivity", NM.Device.DeviceIp6ConnectivityPropertyInfo), '("lldpNeighbors", NM.Device.DeviceLldpNeighborsPropertyInfo), '("managed", NM.Device.DeviceManagedPropertyInfo), '("metered", NM.Device.DeviceMeteredPropertyInfo), '("mtu", NM.Device.DeviceMtuPropertyInfo), '("nmPluginMissing", NM.Device.DeviceNmPluginMissingPropertyInfo), '("path", NM.Device.DevicePathPropertyInfo), '("peers", DeviceWifiP2PPeersPropertyInfo), '("physicalPortId", NM.Device.DevicePhysicalPortIdPropertyInfo), '("ports", NM.Device.DevicePortsPropertyInfo), '("product", NM.Device.DeviceProductPropertyInfo), '("real", NM.Device.DeviceRealPropertyInfo), '("state", NM.Device.DeviceStatePropertyInfo), '("stateReason", NM.Device.DeviceStateReasonPropertyInfo), '("udi", NM.Device.DeviceUdiPropertyInfo), '("vendor", NM.Device.DeviceVendorPropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
deviceWifiP2PPeers :: AttrLabelProxy "peers"
deviceWifiP2PPeers = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList DeviceWifiP2P = DeviceWifiP2PSignalList
type DeviceWifiP2PSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo), '("peerAdded", DeviceWifiP2PPeerAddedSignalInfo), '("peerRemoved", DeviceWifiP2PPeerRemovedSignalInfo), '("stateChanged", NM.Device.DeviceStateChangedSignalInfo)] :: [(Symbol, DK.Type)])

#endif

-- method DeviceWifiP2P::get_peer_by_path
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "device"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "DeviceWifiP2P" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMDeviceWifiP2P" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "path"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the object path of the peer"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "NM" , name = "WifiP2PPeer" })
-- throws : False
-- Skip return : False

foreign import ccall "nm_device_wifi_p2p_get_peer_by_path" nm_device_wifi_p2p_get_peer_by_path :: 
    Ptr DeviceWifiP2P ->                    -- device : TInterface (Name {namespace = "NM", name = "DeviceWifiP2P"})
    CString ->                              -- path : TBasicType TUTF8
    IO (Ptr NM.WifiP2PPeer.WifiP2PPeer)

-- | Gets a t'GI.NM.Objects.WifiP2PPeer.WifiP2PPeer' by path.
-- 
-- /Since: 1.42/
deviceWifiP2PGetPeerByPath ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeviceWifiP2P a) =>
    a
    -- ^ /@device@/: a t'GI.NM.Objects.DeviceWifiP2P.DeviceWifiP2P'
    -> T.Text
    -- ^ /@path@/: the object path of the peer
    -> m NM.WifiP2PPeer.WifiP2PPeer
    -- ^ __Returns:__ the peer or 'P.Nothing' if none is found.
deviceWifiP2PGetPeerByPath :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeviceWifiP2P a) =>
a -> Text -> m WifiP2PPeer
deviceWifiP2PGetPeerByPath a
device Text
path = IO WifiP2PPeer -> m WifiP2PPeer
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO WifiP2PPeer -> m WifiP2PPeer)
-> IO WifiP2PPeer -> m WifiP2PPeer
forall a b. (a -> b) -> a -> b
$ do
    Ptr DeviceWifiP2P
device' <- a -> IO (Ptr DeviceWifiP2P)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
    CString
path' <- Text -> IO CString
textToCString Text
path
    Ptr WifiP2PPeer
result <- Ptr DeviceWifiP2P -> CString -> IO (Ptr WifiP2PPeer)
nm_device_wifi_p2p_get_peer_by_path Ptr DeviceWifiP2P
device' CString
path'
    Text -> Ptr WifiP2PPeer -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deviceWifiP2PGetPeerByPath" Ptr WifiP2PPeer
result
    WifiP2PPeer
result' <- ((ManagedPtr WifiP2PPeer -> WifiP2PPeer)
-> Ptr WifiP2PPeer -> IO WifiP2PPeer
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr WifiP2PPeer -> WifiP2PPeer
NM.WifiP2PPeer.WifiP2PPeer) Ptr WifiP2PPeer
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
    WifiP2PPeer -> IO WifiP2PPeer
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return WifiP2PPeer
result'

#if defined(ENABLE_OVERLOADING)
data DeviceWifiP2PGetPeerByPathMethodInfo
instance (signature ~ (T.Text -> m NM.WifiP2PPeer.WifiP2PPeer), MonadIO m, IsDeviceWifiP2P a) => O.OverloadedMethod DeviceWifiP2PGetPeerByPathMethodInfo a signature where
    overloadedMethod = deviceWifiP2PGetPeerByPath

instance O.OverloadedMethodInfo DeviceWifiP2PGetPeerByPathMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.DeviceWifiP2P.deviceWifiP2PGetPeerByPath",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-DeviceWifiP2P.html#v:deviceWifiP2PGetPeerByPath"
        })


#endif

-- method DeviceWifiP2P::get_peers
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "device"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "DeviceWifiP2P" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMDeviceWifiP2P" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TPtrArray
--                  (TInterface Name { namespace = "NM" , name = "WifiP2PPeer" }))
-- throws : False
-- Skip return : False

foreign import ccall "nm_device_wifi_p2p_get_peers" nm_device_wifi_p2p_get_peers :: 
    Ptr DeviceWifiP2P ->                    -- device : TInterface (Name {namespace = "NM", name = "DeviceWifiP2P"})
    IO (Ptr (GPtrArray (Ptr NM.WifiP2PPeer.WifiP2PPeer)))

-- | Gets all the found peers of the t'GI.NM.Objects.DeviceWifiP2P.DeviceWifiP2P'.
-- 
-- /Since: 1.16/
deviceWifiP2PGetPeers ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeviceWifiP2P a) =>
    a
    -- ^ /@device@/: a t'GI.NM.Objects.DeviceWifiP2P.DeviceWifiP2P'
    -> m [NM.WifiP2PPeer.WifiP2PPeer]
    -- ^ __Returns:__ a t'GI.GLib.Structs.PtrArray.PtrArray' containing all the
    --          found @/NMWifiP2PPeers/@.
    -- The returned array is owned by the client and should not be modified.
deviceWifiP2PGetPeers :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDeviceWifiP2P a) =>
a -> m [WifiP2PPeer]
deviceWifiP2PGetPeers a
device = IO [WifiP2PPeer] -> m [WifiP2PPeer]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [WifiP2PPeer] -> m [WifiP2PPeer])
-> IO [WifiP2PPeer] -> m [WifiP2PPeer]
forall a b. (a -> b) -> a -> b
$ do
    Ptr DeviceWifiP2P
device' <- a -> IO (Ptr DeviceWifiP2P)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
    Ptr (GPtrArray (Ptr WifiP2PPeer))
result <- Ptr DeviceWifiP2P -> IO (Ptr (GPtrArray (Ptr WifiP2PPeer)))
nm_device_wifi_p2p_get_peers Ptr DeviceWifiP2P
device'
    Text -> Ptr (GPtrArray (Ptr WifiP2PPeer)) -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"deviceWifiP2PGetPeers" Ptr (GPtrArray (Ptr WifiP2PPeer))
result
    [Ptr WifiP2PPeer]
result' <- Ptr (GPtrArray (Ptr WifiP2PPeer)) -> IO [Ptr WifiP2PPeer]
forall a. Ptr (GPtrArray (Ptr a)) -> IO [Ptr a]
unpackGPtrArray Ptr (GPtrArray (Ptr WifiP2PPeer))
result
    [WifiP2PPeer]
result'' <- (Ptr WifiP2PPeer -> IO WifiP2PPeer)
-> [Ptr WifiP2PPeer] -> IO [WifiP2PPeer]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM ((ManagedPtr WifiP2PPeer -> WifiP2PPeer)
-> Ptr WifiP2PPeer -> IO WifiP2PPeer
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr WifiP2PPeer -> WifiP2PPeer
NM.WifiP2PPeer.WifiP2PPeer) [Ptr WifiP2PPeer]
result'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
    [WifiP2PPeer] -> IO [WifiP2PPeer]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [WifiP2PPeer]
result''

#if defined(ENABLE_OVERLOADING)
data DeviceWifiP2PGetPeersMethodInfo
instance (signature ~ (m [NM.WifiP2PPeer.WifiP2PPeer]), MonadIO m, IsDeviceWifiP2P a) => O.OverloadedMethod DeviceWifiP2PGetPeersMethodInfo a signature where
    overloadedMethod = deviceWifiP2PGetPeers

instance O.OverloadedMethodInfo DeviceWifiP2PGetPeersMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.DeviceWifiP2P.deviceWifiP2PGetPeers",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-DeviceWifiP2P.html#v:deviceWifiP2PGetPeers"
        })


#endif

-- method DeviceWifiP2P::start_find
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "device"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "DeviceWifiP2P" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMDeviceWifiP2P" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "options"
--           , argType = TVariant
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "optional options passed to StartFind."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GAsyncReadyCallback, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 4
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user_data for @callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "nm_device_wifi_p2p_start_find" nm_device_wifi_p2p_start_find :: 
    Ptr DeviceWifiP2P ->                    -- device : TInterface (Name {namespace = "NM", name = "DeviceWifiP2P"})
    Ptr GVariant ->                         -- options : TVariant
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

-- | Request NM to search for Wi-Fi P2P peers on /@device@/. Note that the call
-- returns immediately after requesting the find, and it may take some time
-- after that for peers to be found.
-- 
-- The find operation will run for 30s by default. You can stop it earlier
-- using @/nm_device_p2p_wifi_stop_find()/@.
-- 
-- /Since: 1.16/
deviceWifiP2PStartFind ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeviceWifiP2P a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@device@/: a t'GI.NM.Objects.DeviceWifiP2P.DeviceWifiP2P'
    -> Maybe (GVariant)
    -- ^ /@options@/: optional options passed to StartFind.
    -> Maybe (b)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable', or 'P.Nothing'
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    -- ^ /@callback@/: a t'GI.Gio.Callbacks.AsyncReadyCallback', or 'P.Nothing'
    -> m ()
deviceWifiP2PStartFind :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDeviceWifiP2P a, IsCancellable b) =>
a -> Maybe GVariant -> Maybe b -> Maybe AsyncReadyCallback -> m ()
deviceWifiP2PStartFind a
device Maybe GVariant
options Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr DeviceWifiP2P
device' <- a -> IO (Ptr DeviceWifiP2P)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
    Ptr GVariant
maybeOptions <- case Maybe GVariant
options of
        Maybe GVariant
Nothing -> Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
forall a. Ptr a
FP.nullPtr
        Just GVariant
jOptions -> do
            Ptr GVariant
jOptions' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
jOptions
            Ptr GVariant -> IO (Ptr GVariant)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GVariant
jOptions'
    Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
        Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
        Just AsyncReadyCallback
jCallback -> do
            Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
            Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
            FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr DeviceWifiP2P
-> Ptr GVariant
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
nm_device_wifi_p2p_start_find Ptr DeviceWifiP2P
device' Ptr GVariant
maybeOptions Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
    Maybe GVariant -> (GVariant -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe GVariant
options GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data DeviceWifiP2PStartFindMethodInfo
instance (signature ~ (Maybe (GVariant) -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDeviceWifiP2P a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod DeviceWifiP2PStartFindMethodInfo a signature where
    overloadedMethod = deviceWifiP2PStartFind

instance O.OverloadedMethodInfo DeviceWifiP2PStartFindMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.DeviceWifiP2P.deviceWifiP2PStartFind",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-DeviceWifiP2P.html#v:deviceWifiP2PStartFind"
        })


#endif

-- method DeviceWifiP2P::start_find_finish
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "device"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "DeviceWifiP2P" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMDeviceWifiP2P" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GAsyncResult" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "nm_device_wifi_p2p_start_find_finish" nm_device_wifi_p2p_start_find_finish :: 
    Ptr DeviceWifiP2P ->                    -- device : TInterface (Name {namespace = "NM", name = "DeviceWifiP2P"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Finish an operation started by 'GI.NM.Objects.DeviceWifiP2P.deviceWifiP2PStartFind'.
-- 
-- /Since: 1.16/
deviceWifiP2PStartFindFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeviceWifiP2P a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    -- ^ /@device@/: a t'GI.NM.Objects.DeviceWifiP2P.DeviceWifiP2P'
    -> b
    -- ^ /@result@/: the t'GI.Gio.Interfaces.AsyncResult.AsyncResult'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
deviceWifiP2PStartFindFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDeviceWifiP2P a, IsAsyncResult b) =>
a -> b -> m ()
deviceWifiP2PStartFindFinish a
device b
result_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr DeviceWifiP2P
device' <- a -> IO (Ptr DeviceWifiP2P)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
    Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
    IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr DeviceWifiP2P -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
nm_device_wifi_p2p_start_find_finish Ptr DeviceWifiP2P
device' Ptr AsyncResult
result_'
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
        b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data DeviceWifiP2PStartFindFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsDeviceWifiP2P a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod DeviceWifiP2PStartFindFinishMethodInfo a signature where
    overloadedMethod = deviceWifiP2PStartFindFinish

instance O.OverloadedMethodInfo DeviceWifiP2PStartFindFinishMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.DeviceWifiP2P.deviceWifiP2PStartFindFinish",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-DeviceWifiP2P.html#v:deviceWifiP2PStartFindFinish"
        })


#endif

-- method DeviceWifiP2P::stop_find
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "device"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "DeviceWifiP2P" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMDeviceWifiP2P" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GCancellable, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GAsyncReadyCallback, or %NULL"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user_data for @callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "nm_device_wifi_p2p_stop_find" nm_device_wifi_p2p_stop_find :: 
    Ptr DeviceWifiP2P ->                    -- device : TInterface (Name {namespace = "NM", name = "DeviceWifiP2P"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

-- | Request NM to stop any ongoing find operation for Wi-Fi P2P peers on /@device@/.
-- 
-- /Since: 1.16/
deviceWifiP2PStopFind ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeviceWifiP2P a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@device@/: a t'GI.NM.Objects.DeviceWifiP2P.DeviceWifiP2P'
    -> Maybe (b)
    -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable', or 'P.Nothing'
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    -- ^ /@callback@/: a t'GI.Gio.Callbacks.AsyncReadyCallback', or 'P.Nothing'
    -> m ()
deviceWifiP2PStopFind :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDeviceWifiP2P a, IsCancellable b) =>
a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
deviceWifiP2PStopFind a
device Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr DeviceWifiP2P
device' <- a -> IO (Ptr DeviceWifiP2P)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
    Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
        Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
        Just b
jCancellable -> do
            Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
            Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
    FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
        Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
        Just AsyncReadyCallback
jCallback -> do
            Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
            Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
            FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr DeviceWifiP2P
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
nm_device_wifi_p2p_stop_find Ptr DeviceWifiP2P
device' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data DeviceWifiP2PStopFindMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDeviceWifiP2P a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod DeviceWifiP2PStopFindMethodInfo a signature where
    overloadedMethod = deviceWifiP2PStopFind

instance O.OverloadedMethodInfo DeviceWifiP2PStopFindMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.DeviceWifiP2P.deviceWifiP2PStopFind",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-DeviceWifiP2P.html#v:deviceWifiP2PStopFind"
        })


#endif

-- method DeviceWifiP2P::stop_find_finish
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "device"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "DeviceWifiP2P" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #NMDeviceWifiP2P" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "result"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GAsyncResult" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "nm_device_wifi_p2p_stop_find_finish" nm_device_wifi_p2p_stop_find_finish :: 
    Ptr DeviceWifiP2P ->                    -- device : TInterface (Name {namespace = "NM", name = "DeviceWifiP2P"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Finish an operation started by 'GI.NM.Objects.DeviceWifiP2P.deviceWifiP2PStopFind'.
-- 
-- /Since: 1.16/
deviceWifiP2PStopFindFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsDeviceWifiP2P a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    -- ^ /@device@/: a t'GI.NM.Objects.DeviceWifiP2P.DeviceWifiP2P'
    -> b
    -- ^ /@result@/: the t'GI.Gio.Interfaces.AsyncResult.AsyncResult'
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
deviceWifiP2PStopFindFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDeviceWifiP2P a, IsAsyncResult b) =>
a -> b -> m ()
deviceWifiP2PStopFindFinish a
device b
result_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr DeviceWifiP2P
device' <- a -> IO (Ptr DeviceWifiP2P)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
device
    Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
    IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr DeviceWifiP2P -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
nm_device_wifi_p2p_stop_find_finish Ptr DeviceWifiP2P
device' Ptr AsyncResult
result_'
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
device
        b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     )

#if defined(ENABLE_OVERLOADING)
data DeviceWifiP2PStopFindFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsDeviceWifiP2P a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod DeviceWifiP2PStopFindFinishMethodInfo a signature where
    overloadedMethod = deviceWifiP2PStopFindFinish

instance O.OverloadedMethodInfo DeviceWifiP2PStopFindFinishMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.DeviceWifiP2P.deviceWifiP2PStopFindFinish",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-DeviceWifiP2P.html#v:deviceWifiP2PStopFindFinish"
        })


#endif