module GI.Gio.Objects.SimpleProxyResolver
(
SimpleProxyResolver(..) ,
SimpleProxyResolverK ,
toSimpleProxyResolver ,
noSimpleProxyResolver ,
simpleProxyResolverNew ,
simpleProxyResolverSetDefaultProxy ,
simpleProxyResolverSetIgnoreHosts ,
simpleProxyResolverSetUriProxy ,
SimpleProxyResolverDefaultProxyPropertyInfo,
constructSimpleProxyResolverDefaultProxy,
getSimpleProxyResolverDefaultProxy ,
setSimpleProxyResolverDefaultProxy ,
SimpleProxyResolverIgnoreHostsPropertyInfo,
constructSimpleProxyResolverIgnoreHosts ,
getSimpleProxyResolverIgnoreHosts ,
setSimpleProxyResolverIgnoreHosts ,
) where
import Prelude ()
import Data.GI.Base.ShortPrelude
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import GI.Gio.Types
import GI.Gio.Callbacks
import qualified GI.GObject as GObject
newtype SimpleProxyResolver = SimpleProxyResolver (ForeignPtr SimpleProxyResolver)
foreign import ccall "g_simple_proxy_resolver_get_type"
c_g_simple_proxy_resolver_get_type :: IO GType
type instance ParentTypes SimpleProxyResolver = SimpleProxyResolverParentTypes
type SimpleProxyResolverParentTypes = '[GObject.Object, ProxyResolver]
instance GObject SimpleProxyResolver where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_g_simple_proxy_resolver_get_type
class GObject o => SimpleProxyResolverK o
instance (GObject o, IsDescendantOf SimpleProxyResolver o) => SimpleProxyResolverK o
toSimpleProxyResolver :: SimpleProxyResolverK o => o -> IO SimpleProxyResolver
toSimpleProxyResolver = unsafeCastTo SimpleProxyResolver
noSimpleProxyResolver :: Maybe SimpleProxyResolver
noSimpleProxyResolver = Nothing
getSimpleProxyResolverDefaultProxy :: (MonadIO m, SimpleProxyResolverK o) => o -> m T.Text
getSimpleProxyResolverDefaultProxy obj = liftIO $ getObjectPropertyString obj "default-proxy"
setSimpleProxyResolverDefaultProxy :: (MonadIO m, SimpleProxyResolverK o) => o -> T.Text -> m ()
setSimpleProxyResolverDefaultProxy obj val = liftIO $ setObjectPropertyString obj "default-proxy" val
constructSimpleProxyResolverDefaultProxy :: T.Text -> IO ([Char], GValue)
constructSimpleProxyResolverDefaultProxy val = constructObjectPropertyString "default-proxy" val
data SimpleProxyResolverDefaultProxyPropertyInfo
instance AttrInfo SimpleProxyResolverDefaultProxyPropertyInfo where
type AttrAllowedOps SimpleProxyResolverDefaultProxyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint SimpleProxyResolverDefaultProxyPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint SimpleProxyResolverDefaultProxyPropertyInfo = SimpleProxyResolverK
type AttrGetType SimpleProxyResolverDefaultProxyPropertyInfo = T.Text
type AttrLabel SimpleProxyResolverDefaultProxyPropertyInfo = "SimpleProxyResolver::default-proxy"
attrGet _ = getSimpleProxyResolverDefaultProxy
attrSet _ = setSimpleProxyResolverDefaultProxy
attrConstruct _ = constructSimpleProxyResolverDefaultProxy
getSimpleProxyResolverIgnoreHosts :: (MonadIO m, SimpleProxyResolverK o) => o -> m [T.Text]
getSimpleProxyResolverIgnoreHosts obj = liftIO $ getObjectPropertyStringArray obj "ignore-hosts"
setSimpleProxyResolverIgnoreHosts :: (MonadIO m, SimpleProxyResolverK o) => o -> [T.Text] -> m ()
setSimpleProxyResolverIgnoreHosts obj val = liftIO $ setObjectPropertyStringArray obj "ignore-hosts" val
constructSimpleProxyResolverIgnoreHosts :: [T.Text] -> IO ([Char], GValue)
constructSimpleProxyResolverIgnoreHosts val = constructObjectPropertyStringArray "ignore-hosts" val
data SimpleProxyResolverIgnoreHostsPropertyInfo
instance AttrInfo SimpleProxyResolverIgnoreHostsPropertyInfo where
type AttrAllowedOps SimpleProxyResolverIgnoreHostsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint SimpleProxyResolverIgnoreHostsPropertyInfo = (~) [T.Text]
type AttrBaseTypeConstraint SimpleProxyResolverIgnoreHostsPropertyInfo = SimpleProxyResolverK
type AttrGetType SimpleProxyResolverIgnoreHostsPropertyInfo = [T.Text]
type AttrLabel SimpleProxyResolverIgnoreHostsPropertyInfo = "SimpleProxyResolver::ignore-hosts"
attrGet _ = getSimpleProxyResolverIgnoreHosts
attrSet _ = setSimpleProxyResolverIgnoreHosts
attrConstruct _ = constructSimpleProxyResolverIgnoreHosts
type instance AttributeList SimpleProxyResolver = SimpleProxyResolverAttributeList
type SimpleProxyResolverAttributeList = ('[ '("default-proxy", SimpleProxyResolverDefaultProxyPropertyInfo), '("ignore-hosts", SimpleProxyResolverIgnoreHostsPropertyInfo)] :: [(Symbol, *)])
type instance SignalList SimpleProxyResolver = SimpleProxyResolverSignalList
type SimpleProxyResolverSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "g_simple_proxy_resolver_set_default_proxy" g_simple_proxy_resolver_set_default_proxy ::
Ptr SimpleProxyResolver ->
CString ->
IO ()
simpleProxyResolverSetDefaultProxy ::
(MonadIO m, SimpleProxyResolverK a) =>
a ->
T.Text ->
m ()
simpleProxyResolverSetDefaultProxy _obj default_proxy = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
default_proxy' <- textToCString default_proxy
g_simple_proxy_resolver_set_default_proxy _obj' default_proxy'
touchManagedPtr _obj
freeMem default_proxy'
return ()
foreign import ccall "g_simple_proxy_resolver_set_ignore_hosts" g_simple_proxy_resolver_set_ignore_hosts ::
Ptr SimpleProxyResolver ->
CString ->
IO ()
simpleProxyResolverSetIgnoreHosts ::
(MonadIO m, SimpleProxyResolverK a) =>
a ->
T.Text ->
m ()
simpleProxyResolverSetIgnoreHosts _obj ignore_hosts = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
ignore_hosts' <- textToCString ignore_hosts
g_simple_proxy_resolver_set_ignore_hosts _obj' ignore_hosts'
touchManagedPtr _obj
freeMem ignore_hosts'
return ()
foreign import ccall "g_simple_proxy_resolver_set_uri_proxy" g_simple_proxy_resolver_set_uri_proxy ::
Ptr SimpleProxyResolver ->
CString ->
CString ->
IO ()
simpleProxyResolverSetUriProxy ::
(MonadIO m, SimpleProxyResolverK a) =>
a ->
T.Text ->
T.Text ->
m ()
simpleProxyResolverSetUriProxy _obj uri_scheme proxy = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
uri_scheme' <- textToCString uri_scheme
proxy' <- textToCString proxy
g_simple_proxy_resolver_set_uri_proxy _obj' uri_scheme' proxy'
touchManagedPtr _obj
freeMem uri_scheme'
freeMem proxy'
return ()
foreign import ccall "g_simple_proxy_resolver_new" g_simple_proxy_resolver_new ::
CString ->
CString ->
IO (Ptr ProxyResolver)
simpleProxyResolverNew ::
(MonadIO m) =>
Maybe (T.Text) ->
Maybe (T.Text) ->
m ProxyResolver
simpleProxyResolverNew default_proxy ignore_hosts = liftIO $ do
maybeDefault_proxy <- case default_proxy of
Nothing -> return nullPtr
Just jDefault_proxy -> do
jDefault_proxy' <- textToCString jDefault_proxy
return jDefault_proxy'
maybeIgnore_hosts <- case ignore_hosts of
Nothing -> return nullPtr
Just jIgnore_hosts -> do
jIgnore_hosts' <- textToCString jIgnore_hosts
return jIgnore_hosts'
result <- g_simple_proxy_resolver_new maybeDefault_proxy maybeIgnore_hosts
checkUnexpectedReturnNULL "g_simple_proxy_resolver_new" result
result' <- (wrapObject ProxyResolver) result
freeMem maybeDefault_proxy
freeMem maybeIgnore_hosts
return result'