#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.SimpleProxyResolver
(
SimpleProxyResolver(..) ,
IsSimpleProxyResolver ,
toSimpleProxyResolver ,
noSimpleProxyResolver ,
simpleProxyResolverNew ,
#if ENABLE_OVERLOADING
SimpleProxyResolverSetDefaultProxyMethodInfo,
#endif
simpleProxyResolverSetDefaultProxy ,
#if ENABLE_OVERLOADING
SimpleProxyResolverSetIgnoreHostsMethodInfo,
#endif
simpleProxyResolverSetIgnoreHosts ,
#if ENABLE_OVERLOADING
SimpleProxyResolverSetUriProxyMethodInfo,
#endif
simpleProxyResolverSetUriProxy ,
#if ENABLE_OVERLOADING
SimpleProxyResolverDefaultProxyPropertyInfo,
#endif
constructSimpleProxyResolverDefaultProxy,
getSimpleProxyResolverDefaultProxy ,
setSimpleProxyResolverDefaultProxy ,
#if ENABLE_OVERLOADING
simpleProxyResolverDefaultProxy ,
#endif
#if ENABLE_OVERLOADING
SimpleProxyResolverIgnoreHostsPropertyInfo,
#endif
clearSimpleProxyResolverIgnoreHosts ,
constructSimpleProxyResolverIgnoreHosts ,
getSimpleProxyResolverIgnoreHosts ,
setSimpleProxyResolverIgnoreHosts ,
#if 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.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
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 GHC.OverloadedLabels as OL
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, O.IsDescendantOf SimpleProxyResolver o) => IsSimpleProxyResolver o
instance (GObject o, O.IsDescendantOf SimpleProxyResolver o) => IsSimpleProxyResolver o
instance O.HasParentTypes SimpleProxyResolver
type instance O.ParentTypes SimpleProxyResolver = '[GObject.Object.Object, Gio.ProxyResolver.ProxyResolver]
toSimpleProxyResolver :: (MonadIO m, IsSimpleProxyResolver o) => o -> m SimpleProxyResolver
toSimpleProxyResolver = liftIO . unsafeCastTo SimpleProxyResolver
noSimpleProxyResolver :: Maybe SimpleProxyResolver
noSimpleProxyResolver = Nothing
#if ENABLE_OVERLOADING
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 "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.MethodInfo info SimpleProxyResolver p) => OL.IsLabel t (SimpleProxyResolver -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
getSimpleProxyResolverDefaultProxy :: (MonadIO m, IsSimpleProxyResolver o) => o -> m (Maybe T.Text)
getSimpleProxyResolverDefaultProxy obj = liftIO $ B.Properties.getObjectPropertyString obj "default-proxy"
setSimpleProxyResolverDefaultProxy :: (MonadIO m, IsSimpleProxyResolver o) => o -> T.Text -> m ()
setSimpleProxyResolverDefaultProxy obj val = liftIO $ B.Properties.setObjectPropertyString obj "default-proxy" (Just val)
constructSimpleProxyResolverDefaultProxy :: (IsSimpleProxyResolver o) => T.Text -> IO (GValueConstruct o)
constructSimpleProxyResolverDefaultProxy val = B.Properties.constructObjectPropertyString "default-proxy" (Just val)
#if ENABLE_OVERLOADING
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
#endif
getSimpleProxyResolverIgnoreHosts :: (MonadIO m, IsSimpleProxyResolver o) => o -> m (Maybe [T.Text])
getSimpleProxyResolverIgnoreHosts obj = liftIO $ B.Properties.getObjectPropertyStringArray obj "ignore-hosts"
setSimpleProxyResolverIgnoreHosts :: (MonadIO m, IsSimpleProxyResolver o) => o -> [T.Text] -> m ()
setSimpleProxyResolverIgnoreHosts obj val = liftIO $ B.Properties.setObjectPropertyStringArray obj "ignore-hosts" (Just val)
constructSimpleProxyResolverIgnoreHosts :: (IsSimpleProxyResolver o) => [T.Text] -> IO (GValueConstruct o)
constructSimpleProxyResolverIgnoreHosts val = B.Properties.constructObjectPropertyStringArray "ignore-hosts" (Just val)
clearSimpleProxyResolverIgnoreHosts :: (MonadIO m, IsSimpleProxyResolver o) => o -> m ()
clearSimpleProxyResolverIgnoreHosts obj = liftIO $ B.Properties.setObjectPropertyStringArray obj "ignore-hosts" (Nothing :: Maybe [T.Text])
#if ENABLE_OVERLOADING
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
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList SimpleProxyResolver
type instance O.AttributeList SimpleProxyResolver = SimpleProxyResolverAttributeList
type SimpleProxyResolverAttributeList = ('[ '("defaultProxy", SimpleProxyResolverDefaultProxyPropertyInfo), '("ignoreHosts", SimpleProxyResolverIgnoreHostsPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
simpleProxyResolverDefaultProxy :: AttrLabelProxy "defaultProxy"
simpleProxyResolverDefaultProxy = AttrLabelProxy
simpleProxyResolverIgnoreHosts :: AttrLabelProxy "ignoreHosts"
simpleProxyResolverIgnoreHosts = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList SimpleProxyResolver = SimpleProxyResolverSignalList
type SimpleProxyResolverSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#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
-> T.Text
-> 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 ()
#if ENABLE_OVERLOADING
data SimpleProxyResolverSetDefaultProxyMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsSimpleProxyResolver a) => O.MethodInfo SimpleProxyResolverSetDefaultProxyMethodInfo a signature where
overloadedMethod _ = simpleProxyResolverSetDefaultProxy
#endif
foreign import ccall "g_simple_proxy_resolver_set_ignore_hosts" g_simple_proxy_resolver_set_ignore_hosts ::
Ptr SimpleProxyResolver ->
CString ->
IO ()
simpleProxyResolverSetIgnoreHosts ::
(B.CallStack.HasCallStack, MonadIO m, IsSimpleProxyResolver a) =>
a
-> T.Text
-> 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 ()
#if ENABLE_OVERLOADING
data SimpleProxyResolverSetIgnoreHostsMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsSimpleProxyResolver a) => O.MethodInfo SimpleProxyResolverSetIgnoreHostsMethodInfo a signature where
overloadedMethod _ = 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 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 ()
#if ENABLE_OVERLOADING
data SimpleProxyResolverSetUriProxyMethodInfo
instance (signature ~ (T.Text -> T.Text -> m ()), MonadIO m, IsSimpleProxyResolver a) => O.MethodInfo SimpleProxyResolverSetUriProxyMethodInfo a signature where
overloadedMethod _ = simpleProxyResolverSetUriProxy
#endif
foreign import ccall "g_simple_proxy_resolver_new" g_simple_proxy_resolver_new ::
CString ->
CString ->
IO (Ptr Gio.ProxyResolver.ProxyResolver)
simpleProxyResolverNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Maybe (T.Text)
-> Maybe (T.Text)
-> m Gio.ProxyResolver.ProxyResolver
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'
#if ENABLE_OVERLOADING
#endif