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

'GI.Gio.Objects.SimpleProxyResolver.SimpleProxyResolver' is a simple 'GI.Gio.Interfaces.ProxyResolver.ProxyResolver' implementation
that handles a single default proxy, multiple URI-scheme-specific
proxies, and a list of hosts that proxies should not be used for.

'GI.Gio.Objects.SimpleProxyResolver.SimpleProxyResolver' is never the default proxy resolver, but it
can be used as the base class for another proxy resolver
implementation, or it can be created and used manually, such as
with 'GI.Gio.Objects.SocketClient.socketClientSetProxyResolver'.
-}

module GI.Gio.Objects.SimpleProxyResolver
    ( 

-- * Exported types
    SimpleProxyResolver(..)                 ,
    IsSimpleProxyResolver                   ,
    toSimpleProxyResolver                   ,
    noSimpleProxyResolver                   ,


 -- * Methods
-- ** new #method:new#
    simpleProxyResolverNew                  ,


-- ** setDefaultProxy #method:setDefaultProxy#
    SimpleProxyResolverSetDefaultProxyMethodInfo,
    simpleProxyResolverSetDefaultProxy      ,


-- ** setIgnoreHosts #method:setIgnoreHosts#
    SimpleProxyResolverSetIgnoreHostsMethodInfo,
    simpleProxyResolverSetIgnoreHosts       ,


-- ** setUriProxy #method:setUriProxy#
    SimpleProxyResolverSetUriProxyMethodInfo,
    simpleProxyResolverSetUriProxy          ,




 -- * Properties
-- ** defaultProxy #attr:defaultProxy#
    SimpleProxyResolverDefaultProxyPropertyInfo,
    constructSimpleProxyResolverDefaultProxy,
    getSimpleProxyResolverDefaultProxy      ,
    setSimpleProxyResolverDefaultProxy      ,
    simpleProxyResolverDefaultProxy         ,


-- ** ignoreHosts #attr:ignoreHosts#
    SimpleProxyResolverIgnoreHostsPropertyInfo,
    clearSimpleProxyResolverIgnoreHosts     ,
    constructSimpleProxyResolverIgnoreHosts ,
    getSimpleProxyResolverIgnoreHosts       ,
    setSimpleProxyResolverIgnoreHosts       ,
    simpleProxyResolverIgnoreHosts          ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

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

newtype SimpleProxyResolver = SimpleProxyResolver (ManagedPtr SimpleProxyResolver)
foreign import ccall "g_simple_proxy_resolver_get_type"
    c_g_simple_proxy_resolver_get_type :: IO GType

instance GObject SimpleProxyResolver where
    gobjectType _ = c_g_simple_proxy_resolver_get_type
    

class GObject o => IsSimpleProxyResolver o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError SimpleProxyResolver a) =>
    IsSimpleProxyResolver a
#endif
instance IsSimpleProxyResolver SimpleProxyResolver
instance GObject.Object.IsObject SimpleProxyResolver
instance Gio.ProxyResolver.IsProxyResolver SimpleProxyResolver

toSimpleProxyResolver :: IsSimpleProxyResolver o => o -> IO SimpleProxyResolver
toSimpleProxyResolver = unsafeCastTo SimpleProxyResolver

noSimpleProxyResolver :: Maybe SimpleProxyResolver
noSimpleProxyResolver = Nothing

type family ResolveSimpleProxyResolverMethod (t :: Symbol) (o :: *) :: * where
    ResolveSimpleProxyResolverMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveSimpleProxyResolverMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveSimpleProxyResolverMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveSimpleProxyResolverMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveSimpleProxyResolverMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveSimpleProxyResolverMethod "isSupported" o = Gio.ProxyResolver.ProxyResolverIsSupportedMethodInfo
    ResolveSimpleProxyResolverMethod "lookup" o = Gio.ProxyResolver.ProxyResolverLookupMethodInfo
    ResolveSimpleProxyResolverMethod "lookupAsync" o = Gio.ProxyResolver.ProxyResolverLookupAsyncMethodInfo
    ResolveSimpleProxyResolverMethod "lookupFinish" o = Gio.ProxyResolver.ProxyResolverLookupFinishMethodInfo
    ResolveSimpleProxyResolverMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveSimpleProxyResolverMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveSimpleProxyResolverMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveSimpleProxyResolverMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveSimpleProxyResolverMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveSimpleProxyResolverMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveSimpleProxyResolverMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveSimpleProxyResolverMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveSimpleProxyResolverMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveSimpleProxyResolverMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveSimpleProxyResolverMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveSimpleProxyResolverMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveSimpleProxyResolverMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveSimpleProxyResolverMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveSimpleProxyResolverMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveSimpleProxyResolverMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveSimpleProxyResolverMethod "setDefaultProxy" o = SimpleProxyResolverSetDefaultProxyMethodInfo
    ResolveSimpleProxyResolverMethod "setIgnoreHosts" o = SimpleProxyResolverSetIgnoreHostsMethodInfo
    ResolveSimpleProxyResolverMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveSimpleProxyResolverMethod "setUriProxy" o = SimpleProxyResolverSetUriProxyMethodInfo
    ResolveSimpleProxyResolverMethod l o = O.MethodResolutionFailed l o

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

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveSimpleProxyResolverMethod t SimpleProxyResolver, O.MethodInfo info SimpleProxyResolver p) => O.IsLabel t (SimpleProxyResolver -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

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

getSimpleProxyResolverDefaultProxy :: (MonadIO m, IsSimpleProxyResolver o) => o -> m (Maybe T.Text)
getSimpleProxyResolverDefaultProxy obj = liftIO $ getObjectPropertyString obj "default-proxy"

setSimpleProxyResolverDefaultProxy :: (MonadIO m, IsSimpleProxyResolver o) => o -> T.Text -> m ()
setSimpleProxyResolverDefaultProxy obj val = liftIO $ setObjectPropertyString obj "default-proxy" (Just val)

constructSimpleProxyResolverDefaultProxy :: (IsSimpleProxyResolver o) => T.Text -> IO (GValueConstruct o)
constructSimpleProxyResolverDefaultProxy val = constructObjectPropertyString "default-proxy" (Just val)

data SimpleProxyResolverDefaultProxyPropertyInfo
instance AttrInfo SimpleProxyResolverDefaultProxyPropertyInfo where
    type AttrAllowedOps SimpleProxyResolverDefaultProxyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint SimpleProxyResolverDefaultProxyPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint SimpleProxyResolverDefaultProxyPropertyInfo = IsSimpleProxyResolver
    type AttrGetType SimpleProxyResolverDefaultProxyPropertyInfo = (Maybe T.Text)
    type AttrLabel SimpleProxyResolverDefaultProxyPropertyInfo = "default-proxy"
    type AttrOrigin SimpleProxyResolverDefaultProxyPropertyInfo = SimpleProxyResolver
    attrGet _ = getSimpleProxyResolverDefaultProxy
    attrSet _ = setSimpleProxyResolverDefaultProxy
    attrConstruct _ = constructSimpleProxyResolverDefaultProxy
    attrClear _ = undefined

-- VVV Prop "ignore-hosts"
   -- Type: TCArray True (-1) (-1) (TBasicType TUTF8)
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

getSimpleProxyResolverIgnoreHosts :: (MonadIO m, IsSimpleProxyResolver o) => o -> m (Maybe [T.Text])
getSimpleProxyResolverIgnoreHosts obj = liftIO $ getObjectPropertyStringArray obj "ignore-hosts"

setSimpleProxyResolverIgnoreHosts :: (MonadIO m, IsSimpleProxyResolver o) => o -> [T.Text] -> m ()
setSimpleProxyResolverIgnoreHosts obj val = liftIO $ setObjectPropertyStringArray obj "ignore-hosts" (Just val)

constructSimpleProxyResolverIgnoreHosts :: (IsSimpleProxyResolver o) => [T.Text] -> IO (GValueConstruct o)
constructSimpleProxyResolverIgnoreHosts val = constructObjectPropertyStringArray "ignore-hosts" (Just val)

clearSimpleProxyResolverIgnoreHosts :: (MonadIO m, IsSimpleProxyResolver o) => o -> m ()
clearSimpleProxyResolverIgnoreHosts obj = liftIO $ setObjectPropertyStringArray obj "ignore-hosts" (Nothing :: Maybe [T.Text])

data SimpleProxyResolverIgnoreHostsPropertyInfo
instance AttrInfo SimpleProxyResolverIgnoreHostsPropertyInfo where
    type AttrAllowedOps SimpleProxyResolverIgnoreHostsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint SimpleProxyResolverIgnoreHostsPropertyInfo = (~) [T.Text]
    type AttrBaseTypeConstraint SimpleProxyResolverIgnoreHostsPropertyInfo = IsSimpleProxyResolver
    type AttrGetType SimpleProxyResolverIgnoreHostsPropertyInfo = (Maybe [T.Text])
    type AttrLabel SimpleProxyResolverIgnoreHostsPropertyInfo = "ignore-hosts"
    type AttrOrigin SimpleProxyResolverIgnoreHostsPropertyInfo = SimpleProxyResolver
    attrGet _ = getSimpleProxyResolverIgnoreHosts
    attrSet _ = setSimpleProxyResolverIgnoreHosts
    attrConstruct _ = constructSimpleProxyResolverIgnoreHosts
    attrClear _ = clearSimpleProxyResolverIgnoreHosts

instance O.HasAttributeList SimpleProxyResolver
type instance O.AttributeList SimpleProxyResolver = SimpleProxyResolverAttributeList
type SimpleProxyResolverAttributeList = ('[ '("defaultProxy", SimpleProxyResolverDefaultProxyPropertyInfo), '("ignoreHosts", SimpleProxyResolverIgnoreHostsPropertyInfo)] :: [(Symbol, *)])

simpleProxyResolverDefaultProxy :: AttrLabelProxy "defaultProxy"
simpleProxyResolverDefaultProxy = AttrLabelProxy

simpleProxyResolverIgnoreHosts :: AttrLabelProxy "ignoreHosts"
simpleProxyResolverIgnoreHosts = AttrLabelProxy

type instance O.SignalList SimpleProxyResolver = SimpleProxyResolverSignalList
type SimpleProxyResolverSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method SimpleProxyResolver::set_default_proxy
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "resolver", argType = TInterface (Name {namespace = "Gio", name = "SimpleProxyResolver"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSimpleProxyResolver", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "default_proxy", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the default proxy to use", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_simple_proxy_resolver_set_default_proxy" g_simple_proxy_resolver_set_default_proxy :: 
    Ptr SimpleProxyResolver ->              -- resolver : TInterface (Name {namespace = "Gio", name = "SimpleProxyResolver"})
    CString ->                              -- default_proxy : TBasicType TUTF8
    IO ()

{- |
Sets the default proxy on /@resolver@/, to be used for any URIs that
don\'t match 'GI.Gio.Objects.SimpleProxyResolver.SimpleProxyResolver':@/ignore-hosts/@ or a proxy set
via 'GI.Gio.Objects.SimpleProxyResolver.simpleProxyResolverSetUriProxy'.

If /@defaultProxy@/ starts with \"socks:\/\/\",
'GI.Gio.Objects.SimpleProxyResolver.SimpleProxyResolver' will treat it as referring to all three of
the socks5, socks4a, and socks4 proxy types.

@since 2.36
-}
simpleProxyResolverSetDefaultProxy ::
    (B.CallStack.HasCallStack, MonadIO m, IsSimpleProxyResolver a) =>
    a
    {- ^ /@resolver@/: a 'GI.Gio.Objects.SimpleProxyResolver.SimpleProxyResolver' -}
    -> T.Text
    {- ^ /@defaultProxy@/: the default proxy to use -}
    -> m ()
simpleProxyResolverSetDefaultProxy resolver defaultProxy = liftIO $ do
    resolver' <- unsafeManagedPtrCastPtr resolver
    defaultProxy' <- textToCString defaultProxy
    g_simple_proxy_resolver_set_default_proxy resolver' defaultProxy'
    touchManagedPtr resolver
    freeMem defaultProxy'
    return ()

data SimpleProxyResolverSetDefaultProxyMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsSimpleProxyResolver a) => O.MethodInfo SimpleProxyResolverSetDefaultProxyMethodInfo a signature where
    overloadedMethod _ = simpleProxyResolverSetDefaultProxy

-- method SimpleProxyResolver::set_ignore_hosts
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "resolver", argType = TInterface (Name {namespace = "Gio", name = "SimpleProxyResolver"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSimpleProxyResolver", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "ignore_hosts", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "%NULL-terminated list of hosts/IP addresses\n    to not use a proxy for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_simple_proxy_resolver_set_ignore_hosts" g_simple_proxy_resolver_set_ignore_hosts :: 
    Ptr SimpleProxyResolver ->              -- resolver : TInterface (Name {namespace = "Gio", name = "SimpleProxyResolver"})
    CString ->                              -- ignore_hosts : TBasicType TUTF8
    IO ()

{- |
Sets the list of ignored hosts.

See 'GI.Gio.Objects.SimpleProxyResolver.SimpleProxyResolver':@/ignore-hosts/@ for more details on how the
/@ignoreHosts@/ argument is interpreted.

@since 2.36
-}
simpleProxyResolverSetIgnoreHosts ::
    (B.CallStack.HasCallStack, MonadIO m, IsSimpleProxyResolver a) =>
    a
    {- ^ /@resolver@/: a 'GI.Gio.Objects.SimpleProxyResolver.SimpleProxyResolver' -}
    -> T.Text
    {- ^ /@ignoreHosts@/: 'Nothing'-terminated list of hosts\/IP addresses
    to not use a proxy for -}
    -> m ()
simpleProxyResolverSetIgnoreHosts resolver ignoreHosts = liftIO $ do
    resolver' <- unsafeManagedPtrCastPtr resolver
    ignoreHosts' <- textToCString ignoreHosts
    g_simple_proxy_resolver_set_ignore_hosts resolver' ignoreHosts'
    touchManagedPtr resolver
    freeMem ignoreHosts'
    return ()

data SimpleProxyResolverSetIgnoreHostsMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsSimpleProxyResolver a) => O.MethodInfo SimpleProxyResolverSetIgnoreHostsMethodInfo a signature where
    overloadedMethod _ = simpleProxyResolverSetIgnoreHosts

-- method SimpleProxyResolver::set_uri_proxy
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "resolver", argType = TInterface (Name {namespace = "Gio", name = "SimpleProxyResolver"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GSimpleProxyResolver", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "uri_scheme", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the URI scheme to add a proxy for", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "proxy", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the proxy to use for @uri_scheme", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_simple_proxy_resolver_set_uri_proxy" g_simple_proxy_resolver_set_uri_proxy :: 
    Ptr SimpleProxyResolver ->              -- resolver : TInterface (Name {namespace = "Gio", name = "SimpleProxyResolver"})
    CString ->                              -- uri_scheme : TBasicType TUTF8
    CString ->                              -- proxy : TBasicType TUTF8
    IO ()

{- |
Adds a URI-scheme-specific proxy to /@resolver@/; URIs whose scheme
matches /@uriScheme@/ (and which don\'t match
'GI.Gio.Objects.SimpleProxyResolver.SimpleProxyResolver':@/ignore-hosts/@) will be proxied via /@proxy@/.

As with 'GI.Gio.Objects.SimpleProxyResolver.SimpleProxyResolver':@/default-proxy/@, if /@proxy@/ starts with
\"socks:\/\/\", 'GI.Gio.Objects.SimpleProxyResolver.SimpleProxyResolver' will treat it
as referring to all three of the socks5, socks4a, and socks4 proxy
types.

@since 2.36
-}
simpleProxyResolverSetUriProxy ::
    (B.CallStack.HasCallStack, MonadIO m, IsSimpleProxyResolver a) =>
    a
    {- ^ /@resolver@/: a 'GI.Gio.Objects.SimpleProxyResolver.SimpleProxyResolver' -}
    -> T.Text
    {- ^ /@uriScheme@/: the URI scheme to add a proxy for -}
    -> T.Text
    {- ^ /@proxy@/: the proxy to use for /@uriScheme@/ -}
    -> m ()
simpleProxyResolverSetUriProxy resolver uriScheme proxy = liftIO $ do
    resolver' <- unsafeManagedPtrCastPtr resolver
    uriScheme' <- textToCString uriScheme
    proxy' <- textToCString proxy
    g_simple_proxy_resolver_set_uri_proxy resolver' uriScheme' proxy'
    touchManagedPtr resolver
    freeMem uriScheme'
    freeMem proxy'
    return ()

data SimpleProxyResolverSetUriProxyMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsSimpleProxyResolver a) => O.MethodInfo SimpleProxyResolverSetUriProxyMethodInfo a signature where
    overloadedMethod _ = simpleProxyResolverSetUriProxy

-- method SimpleProxyResolver::new
-- method type : MemberFunction
-- Args : [Arg {argCName = "default_proxy", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the default proxy to use, eg\n    \"socks://192.168.1.1\"", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "ignore_hosts", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "an optional list of hosts/IP addresses\n    to not use a proxy for.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gio", name = "ProxyResolver"}))
-- throws : False
-- Skip return : False

foreign import ccall "g_simple_proxy_resolver_new" g_simple_proxy_resolver_new :: 
    CString ->                              -- default_proxy : TBasicType TUTF8
    CString ->                              -- ignore_hosts : TBasicType TUTF8
    IO (Ptr Gio.ProxyResolver.ProxyResolver)

{- |
Creates a new 'GI.Gio.Objects.SimpleProxyResolver.SimpleProxyResolver'. See
'GI.Gio.Objects.SimpleProxyResolver.SimpleProxyResolver':@/default-proxy/@ and
'GI.Gio.Objects.SimpleProxyResolver.SimpleProxyResolver':@/ignore-hosts/@ for more details on how the
arguments are interpreted.

@since 2.36
-}
simpleProxyResolverNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Maybe (T.Text)
    {- ^ /@defaultProxy@/: the default proxy to use, eg
    \"socks:\/\/192.168.1.1\" -}
    -> Maybe (T.Text)
    {- ^ /@ignoreHosts@/: an optional list of hosts\/IP addresses
    to not use a proxy for. -}
    -> m Gio.ProxyResolver.ProxyResolver
    {- ^ __Returns:__ a new 'GI.Gio.Objects.SimpleProxyResolver.SimpleProxyResolver' -}
simpleProxyResolverNew defaultProxy ignoreHosts = liftIO $ do
    maybeDefaultProxy <- case defaultProxy of
        Nothing -> return nullPtr
        Just jDefaultProxy -> do
            jDefaultProxy' <- textToCString jDefaultProxy
            return jDefaultProxy'
    maybeIgnoreHosts <- case ignoreHosts of
        Nothing -> return nullPtr
        Just jIgnoreHosts -> do
            jIgnoreHosts' <- textToCString jIgnoreHosts
            return jIgnoreHosts'
    result <- g_simple_proxy_resolver_new maybeDefaultProxy maybeIgnoreHosts
    checkUnexpectedReturnNULL "simpleProxyResolverNew" result
    result' <- (wrapObject Gio.ProxyResolver.ProxyResolver) result
    freeMem maybeDefaultProxy
    freeMem maybeIgnoreHosts
    return result'