{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Generic Link Settings

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

module GI.NM.Objects.SettingGeneric
    ( 

-- * Exported types
    SettingGeneric(..)                      ,
    IsSettingGeneric                        ,
    toSettingGeneric                        ,


 -- * 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"), [compare]("GI.NM.Objects.Setting#g:method:compare"), [diff]("GI.NM.Objects.Setting#g:method:diff"), [duplicate]("GI.NM.Objects.Setting#g:method:duplicate"), [enumerateValues]("GI.NM.Objects.Setting#g:method:enumerateValues"), [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"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [optionClearByName]("GI.NM.Objects.Setting#g:method:optionClearByName"), [optionGet]("GI.NM.Objects.Setting#g:method:optionGet"), [optionGetAllNames]("GI.NM.Objects.Setting#g:method:optionGetAllNames"), [optionGetBoolean]("GI.NM.Objects.Setting#g:method:optionGetBoolean"), [optionGetUint32]("GI.NM.Objects.Setting#g:method:optionGetUint32"), [optionSet]("GI.NM.Objects.Setting#g:method:optionSet"), [optionSetBoolean]("GI.NM.Objects.Setting#g:method:optionSetBoolean"), [optionSetUint32]("GI.NM.Objects.Setting#g:method:optionSetUint32"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [toString]("GI.NM.Objects.Setting#g:method:toString"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [verify]("GI.NM.Objects.Setting#g:method:verify"), [verifySecrets]("GI.NM.Objects.Setting#g:method:verifySecrets"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getDbusPropertyType]("GI.NM.Objects.Setting#g:method:getDbusPropertyType"), [getDeviceHandler]("GI.NM.Objects.SettingGeneric#g:method:getDeviceHandler"), [getName]("GI.NM.Objects.Setting#g:method:getName"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getSecretFlags]("GI.NM.Objects.Setting#g:method:getSecretFlags").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty"), [setSecretFlags]("GI.NM.Objects.Setting#g:method:setSecretFlags").

#if defined(ENABLE_OVERLOADING)
    ResolveSettingGenericMethod             ,
#endif

-- ** getDeviceHandler #method:getDeviceHandler#

#if defined(ENABLE_OVERLOADING)
    SettingGenericGetDeviceHandlerMethodInfo,
#endif
    settingGenericGetDeviceHandler          ,


-- ** new #method:new#

    settingGenericNew                       ,




 -- * Properties


-- ** deviceHandler #attr:deviceHandler#
-- | Name of the device handler that will be invoked to add and delete
-- the device for this connection. The name can only contain ASCII
-- alphanumeric characters and \'-\', \'_\', \'.\'. It cannot start with \'.\'.
-- 
-- See the NetworkManager-dispatcher(8) man page for more details
-- about how to write the device handler.
-- 
-- By setting this property the generic connection becomes \"virtual\",
-- meaning that it can be activated without an existing device; the device
-- will be created at the time the connection is started by invoking the
-- device-handler.
-- 
-- /Since: 1.46/

#if defined(ENABLE_OVERLOADING)
    SettingGenericDeviceHandlerPropertyInfo ,
#endif
    clearSettingGenericDeviceHandler        ,
    constructSettingGenericDeviceHandler    ,
    getSettingGenericDeviceHandler          ,
    setSettingGenericDeviceHandler          ,
#if defined(ENABLE_OVERLOADING)
    settingGenericDeviceHandler             ,
#endif




    ) 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.VariantType as GLib.VariantType
import qualified GI.GObject.Objects.Object as GObject.Object
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.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.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.Structs.BridgeVlan as NM.BridgeVlan
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.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 {-# SOURCE #-} qualified GI.NM.Objects.Setting as NM.Setting

#endif

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

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

foreign import ccall "nm_setting_generic_get_type"
    c_nm_setting_generic_get_type :: IO B.Types.GType

instance B.Types.TypedObject SettingGeneric where
    glibType :: IO GType
glibType = IO GType
c_nm_setting_generic_get_type

instance B.Types.GObject SettingGeneric

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

instance O.HasParentTypes SettingGeneric
type instance O.ParentTypes SettingGeneric = '[NM.Setting.Setting, GObject.Object.Object]

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

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

#if defined(ENABLE_OVERLOADING)
type family ResolveSettingGenericMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveSettingGenericMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveSettingGenericMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveSettingGenericMethod "compare" o = NM.Setting.SettingCompareMethodInfo
    ResolveSettingGenericMethod "diff" o = NM.Setting.SettingDiffMethodInfo
    ResolveSettingGenericMethod "duplicate" o = NM.Setting.SettingDuplicateMethodInfo
    ResolveSettingGenericMethod "enumerateValues" o = NM.Setting.SettingEnumerateValuesMethodInfo
    ResolveSettingGenericMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveSettingGenericMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveSettingGenericMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveSettingGenericMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveSettingGenericMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveSettingGenericMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveSettingGenericMethod "optionClearByName" o = NM.Setting.SettingOptionClearByNameMethodInfo
    ResolveSettingGenericMethod "optionGet" o = NM.Setting.SettingOptionGetMethodInfo
    ResolveSettingGenericMethod "optionGetAllNames" o = NM.Setting.SettingOptionGetAllNamesMethodInfo
    ResolveSettingGenericMethod "optionGetBoolean" o = NM.Setting.SettingOptionGetBooleanMethodInfo
    ResolveSettingGenericMethod "optionGetUint32" o = NM.Setting.SettingOptionGetUint32MethodInfo
    ResolveSettingGenericMethod "optionSet" o = NM.Setting.SettingOptionSetMethodInfo
    ResolveSettingGenericMethod "optionSetBoolean" o = NM.Setting.SettingOptionSetBooleanMethodInfo
    ResolveSettingGenericMethod "optionSetUint32" o = NM.Setting.SettingOptionSetUint32MethodInfo
    ResolveSettingGenericMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveSettingGenericMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveSettingGenericMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveSettingGenericMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveSettingGenericMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveSettingGenericMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveSettingGenericMethod "toString" o = NM.Setting.SettingToStringMethodInfo
    ResolveSettingGenericMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveSettingGenericMethod "verify" o = NM.Setting.SettingVerifyMethodInfo
    ResolveSettingGenericMethod "verifySecrets" o = NM.Setting.SettingVerifySecretsMethodInfo
    ResolveSettingGenericMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveSettingGenericMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveSettingGenericMethod "getDbusPropertyType" o = NM.Setting.SettingGetDbusPropertyTypeMethodInfo
    ResolveSettingGenericMethod "getDeviceHandler" o = SettingGenericGetDeviceHandlerMethodInfo
    ResolveSettingGenericMethod "getName" o = NM.Setting.SettingGetNameMethodInfo
    ResolveSettingGenericMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveSettingGenericMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveSettingGenericMethod "getSecretFlags" o = NM.Setting.SettingGetSecretFlagsMethodInfo
    ResolveSettingGenericMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveSettingGenericMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveSettingGenericMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveSettingGenericMethod "setSecretFlags" o = NM.Setting.SettingSetSecretFlagsMethodInfo
    ResolveSettingGenericMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

-- VVV Prop "device-handler"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Nothing)

-- | Get the value of the “@device-handler@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' settingGeneric #deviceHandler
-- @
getSettingGenericDeviceHandler :: (MonadIO m, IsSettingGeneric o) => o -> m T.Text
getSettingGenericDeviceHandler :: forall (m :: * -> *) o.
(MonadIO m, IsSettingGeneric o) =>
o -> m Text
getSettingGenericDeviceHandler o
obj = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Text) -> IO Text
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getSettingGenericDeviceHandler" (IO (Maybe Text) -> IO Text) -> IO (Maybe Text) -> IO Text
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"device-handler"

-- | Set the value of the “@device-handler@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' settingGeneric [ #deviceHandler 'Data.GI.Base.Attributes.:=' value ]
-- @
setSettingGenericDeviceHandler :: (MonadIO m, IsSettingGeneric o) => o -> T.Text -> m ()
setSettingGenericDeviceHandler :: forall (m :: * -> *) o.
(MonadIO m, IsSettingGeneric o) =>
o -> Text -> m ()
setSettingGenericDeviceHandler o
obj Text
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"device-handler" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)

-- | Construct a t'GValueConstruct' with valid value for the “@device-handler@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructSettingGenericDeviceHandler :: (IsSettingGeneric o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructSettingGenericDeviceHandler :: forall o (m :: * -> *).
(IsSettingGeneric o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructSettingGenericDeviceHandler Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"device-handler" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)

-- | Set the value of the “@device-handler@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #deviceHandler
-- @
clearSettingGenericDeviceHandler :: (MonadIO m, IsSettingGeneric o) => o -> m ()
clearSettingGenericDeviceHandler :: forall (m :: * -> *) o.
(MonadIO m, IsSettingGeneric o) =>
o -> m ()
clearSettingGenericDeviceHandler o
obj = 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
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"device-handler" (Maybe Text
forall a. Maybe a
Nothing :: Maybe T.Text)

#if defined(ENABLE_OVERLOADING)
data SettingGenericDeviceHandlerPropertyInfo
instance AttrInfo SettingGenericDeviceHandlerPropertyInfo where
    type AttrAllowedOps SettingGenericDeviceHandlerPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint SettingGenericDeviceHandlerPropertyInfo = IsSettingGeneric
    type AttrSetTypeConstraint SettingGenericDeviceHandlerPropertyInfo = (~) T.Text
    type AttrTransferTypeConstraint SettingGenericDeviceHandlerPropertyInfo = (~) T.Text
    type AttrTransferType SettingGenericDeviceHandlerPropertyInfo = T.Text
    type AttrGetType SettingGenericDeviceHandlerPropertyInfo = T.Text
    type AttrLabel SettingGenericDeviceHandlerPropertyInfo = "device-handler"
    type AttrOrigin SettingGenericDeviceHandlerPropertyInfo = SettingGeneric
    attrGet = getSettingGenericDeviceHandler
    attrSet = setSettingGenericDeviceHandler
    attrTransfer _ v = do
        return v
    attrConstruct = constructSettingGenericDeviceHandler
    attrClear = clearSettingGenericDeviceHandler
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.NM.Objects.SettingGeneric.deviceHandler"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SettingGeneric.html#g:attr:deviceHandler"
        })
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SettingGeneric
type instance O.AttributeList SettingGeneric = SettingGenericAttributeList
type SettingGenericAttributeList = ('[ '("deviceHandler", SettingGenericDeviceHandlerPropertyInfo), '("name", NM.Setting.SettingNamePropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
settingGenericDeviceHandler :: AttrLabelProxy "deviceHandler"
settingGenericDeviceHandler = AttrLabelProxy

#endif

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

#endif

-- method SettingGeneric::new
-- method type : Constructor
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "NM" , name = "SettingGeneric" })
-- throws : False
-- Skip return : False

foreign import ccall "nm_setting_generic_new" nm_setting_generic_new :: 
    IO (Ptr SettingGeneric)

-- | Creates a new t'GI.NM.Objects.SettingGeneric.SettingGeneric' object with default values.
settingGenericNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m SettingGeneric
    -- ^ __Returns:__ the new empty t'GI.NM.Objects.SettingGeneric.SettingGeneric' object
settingGenericNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m SettingGeneric
settingGenericNew  = IO SettingGeneric -> m SettingGeneric
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SettingGeneric -> m SettingGeneric)
-> IO SettingGeneric -> m SettingGeneric
forall a b. (a -> b) -> a -> b
$ do
    Ptr SettingGeneric
result <- IO (Ptr SettingGeneric)
nm_setting_generic_new
    Text -> Ptr SettingGeneric -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"settingGenericNew" Ptr SettingGeneric
result
    SettingGeneric
result' <- ((ManagedPtr SettingGeneric -> SettingGeneric)
-> Ptr SettingGeneric -> IO SettingGeneric
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SettingGeneric -> SettingGeneric
SettingGeneric) Ptr SettingGeneric
result
    SettingGeneric -> IO SettingGeneric
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return SettingGeneric
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method SettingGeneric::get_device_handler
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "setting"
--           , argType =
--               TInterface Name { namespace = "NM" , name = "SettingGeneric" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #NMSettingGeneric"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "nm_setting_generic_get_device_handler" nm_setting_generic_get_device_handler :: 
    Ptr SettingGeneric ->                   -- setting : TInterface (Name {namespace = "NM", name = "SettingGeneric"})
    IO CString

-- | Returns the [SettingGeneric:deviceHandler]("GI.NM.Objects.SettingGeneric#g:attr:deviceHandler") property of the connection.
-- 
-- /Since: 1.46/
settingGenericGetDeviceHandler ::
    (B.CallStack.HasCallStack, MonadIO m, IsSettingGeneric a) =>
    a
    -- ^ /@setting@/: the t'GI.NM.Objects.SettingGeneric.SettingGeneric'
    -> m T.Text
    -- ^ __Returns:__ the device handler name, or 'P.Nothing' if no device handler is set
settingGenericGetDeviceHandler :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSettingGeneric a) =>
a -> m Text
settingGenericGetDeviceHandler a
setting = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr SettingGeneric
setting' <- a -> IO (Ptr SettingGeneric)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
    CString
result <- Ptr SettingGeneric -> IO CString
nm_setting_generic_get_device_handler Ptr SettingGeneric
setting'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"settingGenericGetDeviceHandler" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
    Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'

#if defined(ENABLE_OVERLOADING)
data SettingGenericGetDeviceHandlerMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsSettingGeneric a) => O.OverloadedMethod SettingGenericGetDeviceHandlerMethodInfo a signature where
    overloadedMethod = settingGenericGetDeviceHandler

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


#endif