{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.SimpleProxyResolver
(
SimpleProxyResolver(..) ,
IsSimpleProxyResolver ,
toSimpleProxyResolver ,
#if defined(ENABLE_OVERLOADING)
ResolveSimpleProxyResolverMethod ,
#endif
simpleProxyResolverNew ,
#if defined(ENABLE_OVERLOADING)
SimpleProxyResolverSetDefaultProxyMethodInfo,
#endif
simpleProxyResolverSetDefaultProxy ,
#if defined(ENABLE_OVERLOADING)
SimpleProxyResolverSetIgnoreHostsMethodInfo,
#endif
simpleProxyResolverSetIgnoreHosts ,
#if defined(ENABLE_OVERLOADING)
SimpleProxyResolverSetUriProxyMethodInfo,
#endif
simpleProxyResolverSetUriProxy ,
#if defined(ENABLE_OVERLOADING)
SimpleProxyResolverDefaultProxyPropertyInfo,
#endif
clearSimpleProxyResolverDefaultProxy ,
constructSimpleProxyResolverDefaultProxy,
getSimpleProxyResolverDefaultProxy ,
setSimpleProxyResolverDefaultProxy ,
#if defined(ENABLE_OVERLOADING)
simpleProxyResolverDefaultProxy ,
#endif
#if defined(ENABLE_OVERLOADING)
SimpleProxyResolverIgnoreHostsPropertyInfo,
#endif
constructSimpleProxyResolverIgnoreHosts ,
getSimpleProxyResolverIgnoreHosts ,
setSimpleProxyResolverIgnoreHosts ,
#if defined(ENABLE_OVERLOADING)
simpleProxyResolverIgnoreHosts ,
#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 GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Interfaces.ProxyResolver as Gio.ProxyResolver
newtype SimpleProxyResolver = SimpleProxyResolver (SP.ManagedPtr SimpleProxyResolver)
deriving (SimpleProxyResolver -> SimpleProxyResolver -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SimpleProxyResolver -> SimpleProxyResolver -> Bool
$c/= :: SimpleProxyResolver -> SimpleProxyResolver -> Bool
== :: SimpleProxyResolver -> SimpleProxyResolver -> Bool
$c== :: SimpleProxyResolver -> SimpleProxyResolver -> Bool
Eq)
instance SP.ManagedPtrNewtype SimpleProxyResolver where
toManagedPtr :: SimpleProxyResolver -> ManagedPtr SimpleProxyResolver
toManagedPtr (SimpleProxyResolver ManagedPtr SimpleProxyResolver
p) = ManagedPtr SimpleProxyResolver
p
foreign import ccall "g_simple_proxy_resolver_get_type"
c_g_simple_proxy_resolver_get_type :: IO B.Types.GType
instance B.Types.TypedObject SimpleProxyResolver where
glibType :: IO GType
glibType = IO GType
c_g_simple_proxy_resolver_get_type
instance B.Types.GObject SimpleProxyResolver
class (SP.GObject o, O.IsDescendantOf SimpleProxyResolver o) => IsSimpleProxyResolver o
instance (SP.GObject o, O.IsDescendantOf SimpleProxyResolver o) => IsSimpleProxyResolver o
instance O.HasParentTypes SimpleProxyResolver
type instance O.ParentTypes SimpleProxyResolver = '[GObject.Object.Object, Gio.ProxyResolver.ProxyResolver]
toSimpleProxyResolver :: (MIO.MonadIO m, IsSimpleProxyResolver o) => o -> m SimpleProxyResolver
toSimpleProxyResolver :: forall (m :: * -> *) o.
(MonadIO m, IsSimpleProxyResolver o) =>
o -> m SimpleProxyResolver
toSimpleProxyResolver = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr SimpleProxyResolver -> SimpleProxyResolver
SimpleProxyResolver
instance B.GValue.IsGValue (Maybe SimpleProxyResolver) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_simple_proxy_resolver_get_type
gvalueSet_ :: Ptr GValue -> Maybe SimpleProxyResolver -> IO ()
gvalueSet_ Ptr GValue
gv Maybe SimpleProxyResolver
P.Nothing = forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (forall a. Ptr a
FP.nullPtr :: FP.Ptr SimpleProxyResolver)
gvalueSet_ Ptr GValue
gv (P.Just SimpleProxyResolver
obj) = forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SimpleProxyResolver
obj (forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe SimpleProxyResolver)
gvalueGet_ Ptr GValue
gv = do
Ptr SimpleProxyResolver
ptr <- forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr SimpleProxyResolver)
if Ptr SimpleProxyResolver
ptr forall a. Eq a => a -> a -> Bool
/= forall a. Ptr a
FP.nullPtr
then forall a. a -> Maybe a
P.Just forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr SimpleProxyResolver -> SimpleProxyResolver
SimpleProxyResolver Ptr SimpleProxyResolver
ptr
else forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveSimpleProxyResolverMethod (t :: Symbol) (o :: DK.Type) :: DK.Type 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 "getv" o = GObject.Object.ObjectGetvMethodInfo
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 "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 "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
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.OverloadedMethod info SimpleProxyResolver p) => OL.IsLabel t (SimpleProxyResolver -> 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 ~ ResolveSimpleProxyResolverMethod t SimpleProxyResolver, O.OverloadedMethod info SimpleProxyResolver p, R.HasField t SimpleProxyResolver p) => R.HasField t SimpleProxyResolver p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveSimpleProxyResolverMethod t SimpleProxyResolver, O.OverloadedMethodInfo info SimpleProxyResolver) => OL.IsLabel t (O.MethodProxy info SimpleProxyResolver) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getSimpleProxyResolverDefaultProxy :: (MonadIO m, IsSimpleProxyResolver o) => o -> m (Maybe T.Text)
getSimpleProxyResolverDefaultProxy :: forall (m :: * -> *) o.
(MonadIO m, IsSimpleProxyResolver o) =>
o -> m (Maybe Text)
getSimpleProxyResolverDefaultProxy o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"default-proxy"
setSimpleProxyResolverDefaultProxy :: (MonadIO m, IsSimpleProxyResolver o) => o -> T.Text -> m ()
setSimpleProxyResolverDefaultProxy :: forall (m :: * -> *) o.
(MonadIO m, IsSimpleProxyResolver o) =>
o -> Text -> m ()
setSimpleProxyResolverDefaultProxy o
obj Text
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"default-proxy" (forall a. a -> Maybe a
Just Text
val)
constructSimpleProxyResolverDefaultProxy :: (IsSimpleProxyResolver o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructSimpleProxyResolverDefaultProxy :: forall o (m :: * -> *).
(IsSimpleProxyResolver o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructSimpleProxyResolverDefaultProxy Text
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"default-proxy" (forall a. a -> Maybe a
P.Just Text
val)
clearSimpleProxyResolverDefaultProxy :: (MonadIO m, IsSimpleProxyResolver o) => o -> m ()
clearSimpleProxyResolverDefaultProxy :: forall (m :: * -> *) o.
(MonadIO m, IsSimpleProxyResolver o) =>
o -> m ()
clearSimpleProxyResolverDefaultProxy o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"default-proxy" (forall a. Maybe a
Nothing :: Maybe T.Text)
#if defined(ENABLE_OVERLOADING)
data SimpleProxyResolverDefaultProxyPropertyInfo
instance AttrInfo SimpleProxyResolverDefaultProxyPropertyInfo where
type AttrAllowedOps SimpleProxyResolverDefaultProxyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint SimpleProxyResolverDefaultProxyPropertyInfo = IsSimpleProxyResolver
type AttrSetTypeConstraint SimpleProxyResolverDefaultProxyPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint SimpleProxyResolverDefaultProxyPropertyInfo = (~) T.Text
type AttrTransferType SimpleProxyResolverDefaultProxyPropertyInfo = T.Text
type AttrGetType SimpleProxyResolverDefaultProxyPropertyInfo = (Maybe T.Text)
type AttrLabel SimpleProxyResolverDefaultProxyPropertyInfo = "default-proxy"
type AttrOrigin SimpleProxyResolverDefaultProxyPropertyInfo = SimpleProxyResolver
attrGet = getSimpleProxyResolverDefaultProxy
attrSet = setSimpleProxyResolverDefaultProxy
attrTransfer _ v = do
return v
attrConstruct = constructSimpleProxyResolverDefaultProxy
attrClear = clearSimpleProxyResolverDefaultProxy
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleProxyResolver.defaultProxy"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-SimpleProxyResolver.html#g:attr:defaultProxy"
})
#endif
getSimpleProxyResolverIgnoreHosts :: (MonadIO m, IsSimpleProxyResolver o) => o -> m (Maybe [T.Text])
getSimpleProxyResolverIgnoreHosts :: forall (m :: * -> *) o.
(MonadIO m, IsSimpleProxyResolver o) =>
o -> m (Maybe [Text])
getSimpleProxyResolverIgnoreHosts o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a. GObject a => a -> String -> IO (Maybe [Text])
B.Properties.getObjectPropertyStringArray o
obj String
"ignore-hosts"
setSimpleProxyResolverIgnoreHosts :: (MonadIO m, IsSimpleProxyResolver o) => o -> [T.Text] -> m ()
setSimpleProxyResolverIgnoreHosts :: forall (m :: * -> *) o.
(MonadIO m, IsSimpleProxyResolver o) =>
o -> [Text] -> m ()
setSimpleProxyResolverIgnoreHosts o
obj [Text]
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall a. GObject a => a -> String -> Maybe [Text] -> IO ()
B.Properties.setObjectPropertyStringArray o
obj String
"ignore-hosts" (forall a. a -> Maybe a
Just [Text]
val)
constructSimpleProxyResolverIgnoreHosts :: (IsSimpleProxyResolver o, MIO.MonadIO m) => [T.Text] -> m (GValueConstruct o)
constructSimpleProxyResolverIgnoreHosts :: forall o (m :: * -> *).
(IsSimpleProxyResolver o, MonadIO m) =>
[Text] -> m (GValueConstruct o)
constructSimpleProxyResolverIgnoreHosts [Text]
val = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ do
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall o. String -> Maybe [Text] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyStringArray String
"ignore-hosts" (forall a. a -> Maybe a
P.Just [Text]
val)
#if defined(ENABLE_OVERLOADING)
data SimpleProxyResolverIgnoreHostsPropertyInfo
instance AttrInfo SimpleProxyResolverIgnoreHostsPropertyInfo where
type AttrAllowedOps SimpleProxyResolverIgnoreHostsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint SimpleProxyResolverIgnoreHostsPropertyInfo = IsSimpleProxyResolver
type AttrSetTypeConstraint SimpleProxyResolverIgnoreHostsPropertyInfo = (~) [T.Text]
type AttrTransferTypeConstraint SimpleProxyResolverIgnoreHostsPropertyInfo = (~) [T.Text]
type AttrTransferType SimpleProxyResolverIgnoreHostsPropertyInfo = [T.Text]
type AttrGetType SimpleProxyResolverIgnoreHostsPropertyInfo = (Maybe [T.Text])
type AttrLabel SimpleProxyResolverIgnoreHostsPropertyInfo = "ignore-hosts"
type AttrOrigin SimpleProxyResolverIgnoreHostsPropertyInfo = SimpleProxyResolver
attrGet = getSimpleProxyResolverIgnoreHosts
attrSet = setSimpleProxyResolverIgnoreHosts
attrTransfer _ v = do
return v
attrConstruct = constructSimpleProxyResolverIgnoreHosts
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleProxyResolver.ignoreHosts"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-SimpleProxyResolver.html#g:attr:ignoreHosts"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SimpleProxyResolver
type instance O.AttributeList SimpleProxyResolver = SimpleProxyResolverAttributeList
type SimpleProxyResolverAttributeList = ('[ '("defaultProxy", SimpleProxyResolverDefaultProxyPropertyInfo), '("ignoreHosts", SimpleProxyResolverIgnoreHostsPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
simpleProxyResolverDefaultProxy :: AttrLabelProxy "defaultProxy"
simpleProxyResolverDefaultProxy = AttrLabelProxy
simpleProxyResolverIgnoreHosts :: AttrLabelProxy "ignoreHosts"
simpleProxyResolverIgnoreHosts = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList SimpleProxyResolver = SimpleProxyResolverSignalList
type SimpleProxyResolverSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_simple_proxy_resolver_set_default_proxy" g_simple_proxy_resolver_set_default_proxy ::
Ptr SimpleProxyResolver ->
CString ->
IO ()
simpleProxyResolverSetDefaultProxy ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleProxyResolver a) =>
a
-> Maybe (T.Text)
-> m ()
simpleProxyResolverSetDefaultProxy :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSimpleProxyResolver a) =>
a -> Maybe Text -> m ()
simpleProxyResolverSetDefaultProxy a
resolver Maybe Text
defaultProxy = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr SimpleProxyResolver
resolver' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
Ptr CChar
maybeDefaultProxy <- case Maybe Text
defaultProxy of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jDefaultProxy -> do
Ptr CChar
jDefaultProxy' <- Text -> IO (Ptr CChar)
textToCString Text
jDefaultProxy
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jDefaultProxy'
Ptr SimpleProxyResolver -> Ptr CChar -> IO ()
g_simple_proxy_resolver_set_default_proxy Ptr SimpleProxyResolver
resolver' Ptr CChar
maybeDefaultProxy
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeDefaultProxy
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SimpleProxyResolverSetDefaultProxyMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsSimpleProxyResolver a) => O.OverloadedMethod SimpleProxyResolverSetDefaultProxyMethodInfo a signature where
overloadedMethod = simpleProxyResolverSetDefaultProxy
instance O.OverloadedMethodInfo SimpleProxyResolverSetDefaultProxyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleProxyResolver.simpleProxyResolverSetDefaultProxy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-SimpleProxyResolver.html#v:simpleProxyResolverSetDefaultProxy"
})
#endif
foreign import ccall "g_simple_proxy_resolver_set_ignore_hosts" g_simple_proxy_resolver_set_ignore_hosts ::
Ptr SimpleProxyResolver ->
Ptr CString ->
IO ()
simpleProxyResolverSetIgnoreHosts ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleProxyResolver a) =>
a
-> [T.Text]
-> m ()
simpleProxyResolverSetIgnoreHosts :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSimpleProxyResolver a) =>
a -> [Text] -> m ()
simpleProxyResolverSetIgnoreHosts a
resolver [Text]
ignoreHosts = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr SimpleProxyResolver
resolver' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
Ptr (Ptr CChar)
ignoreHosts' <- [Text] -> IO (Ptr (Ptr CChar))
packZeroTerminatedUTF8CArray [Text]
ignoreHosts
Ptr SimpleProxyResolver -> Ptr (Ptr CChar) -> IO ()
g_simple_proxy_resolver_set_ignore_hosts Ptr SimpleProxyResolver
resolver' Ptr (Ptr CChar)
ignoreHosts'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
ignoreHosts'
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
ignoreHosts'
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SimpleProxyResolverSetIgnoreHostsMethodInfo
instance (signature ~ ([T.Text] -> m ()), MonadIO m, IsSimpleProxyResolver a) => O.OverloadedMethod SimpleProxyResolverSetIgnoreHostsMethodInfo a signature where
overloadedMethod = simpleProxyResolverSetIgnoreHosts
instance O.OverloadedMethodInfo SimpleProxyResolverSetIgnoreHostsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleProxyResolver.simpleProxyResolverSetIgnoreHosts",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-SimpleProxyResolver.html#v:simpleProxyResolverSetIgnoreHosts"
})
#endif
foreign import ccall "g_simple_proxy_resolver_set_uri_proxy" g_simple_proxy_resolver_set_uri_proxy ::
Ptr SimpleProxyResolver ->
CString ->
CString ->
IO ()
simpleProxyResolverSetUriProxy ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleProxyResolver a) =>
a
-> T.Text
-> T.Text
-> m ()
simpleProxyResolverSetUriProxy :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSimpleProxyResolver a) =>
a -> Text -> Text -> m ()
simpleProxyResolverSetUriProxy a
resolver Text
uriScheme Text
proxy = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr SimpleProxyResolver
resolver' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
resolver
Ptr CChar
uriScheme' <- Text -> IO (Ptr CChar)
textToCString Text
uriScheme
Ptr CChar
proxy' <- Text -> IO (Ptr CChar)
textToCString Text
proxy
Ptr SimpleProxyResolver -> Ptr CChar -> Ptr CChar -> IO ()
g_simple_proxy_resolver_set_uri_proxy Ptr SimpleProxyResolver
resolver' Ptr CChar
uriScheme' Ptr CChar
proxy'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
resolver
forall a. Ptr a -> IO ()
freeMem Ptr CChar
uriScheme'
forall a. Ptr a -> IO ()
freeMem Ptr CChar
proxy'
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SimpleProxyResolverSetUriProxyMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsSimpleProxyResolver a) => O.OverloadedMethod SimpleProxyResolverSetUriProxyMethodInfo a signature where
overloadedMethod = simpleProxyResolverSetUriProxy
instance O.OverloadedMethodInfo SimpleProxyResolverSetUriProxyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.SimpleProxyResolver.simpleProxyResolverSetUriProxy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.30/docs/GI-Gio-Objects-SimpleProxyResolver.html#v:simpleProxyResolverSetUriProxy"
})
#endif
foreign import ccall "g_simple_proxy_resolver_new" g_simple_proxy_resolver_new ::
CString ->
Ptr CString ->
IO (Ptr Gio.ProxyResolver.ProxyResolver)
simpleProxyResolverNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Maybe (T.Text)
-> Maybe ([T.Text])
-> m Gio.ProxyResolver.ProxyResolver
simpleProxyResolverNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Maybe Text -> Maybe [Text] -> m ProxyResolver
simpleProxyResolverNew Maybe Text
defaultProxy Maybe [Text]
ignoreHosts = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr CChar
maybeDefaultProxy <- case Maybe Text
defaultProxy of
Maybe Text
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just Text
jDefaultProxy -> do
Ptr CChar
jDefaultProxy' <- Text -> IO (Ptr CChar)
textToCString Text
jDefaultProxy
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jDefaultProxy'
Ptr (Ptr CChar)
maybeIgnoreHosts <- case Maybe [Text]
ignoreHosts of
Maybe [Text]
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just [Text]
jIgnoreHosts -> do
Ptr (Ptr CChar)
jIgnoreHosts' <- [Text] -> IO (Ptr (Ptr CChar))
packZeroTerminatedUTF8CArray [Text]
jIgnoreHosts
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr (Ptr CChar)
jIgnoreHosts'
Ptr ProxyResolver
result <- Ptr CChar -> Ptr (Ptr CChar) -> IO (Ptr ProxyResolver)
g_simple_proxy_resolver_new Ptr CChar
maybeDefaultProxy Ptr (Ptr CChar)
maybeIgnoreHosts
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"simpleProxyResolverNew" Ptr ProxyResolver
result
ProxyResolver
result' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr ProxyResolver -> ProxyResolver
Gio.ProxyResolver.ProxyResolver) Ptr ProxyResolver
result
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeDefaultProxy
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
maybeIgnoreHosts
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CChar)
maybeIgnoreHosts
forall (m :: * -> *) a. Monad m => a -> m a
return ProxyResolver
result'
#if defined(ENABLE_OVERLOADING)
#endif