module GI.Gio.Objects.ProxyAddress
(
ProxyAddress(..) ,
ProxyAddressK ,
toProxyAddress ,
noProxyAddress ,
proxyAddressGetDestinationHostname ,
proxyAddressGetDestinationPort ,
proxyAddressGetDestinationProtocol ,
proxyAddressGetPassword ,
proxyAddressGetProtocol ,
proxyAddressGetUri ,
proxyAddressGetUsername ,
proxyAddressNew ,
ProxyAddressDestinationHostnamePropertyInfo,
constructProxyAddressDestinationHostname,
getProxyAddressDestinationHostname ,
ProxyAddressDestinationPortPropertyInfo ,
constructProxyAddressDestinationPort ,
getProxyAddressDestinationPort ,
ProxyAddressDestinationProtocolPropertyInfo,
constructProxyAddressDestinationProtocol,
getProxyAddressDestinationProtocol ,
ProxyAddressPasswordPropertyInfo ,
constructProxyAddressPassword ,
getProxyAddressPassword ,
ProxyAddressProtocolPropertyInfo ,
constructProxyAddressProtocol ,
getProxyAddressProtocol ,
ProxyAddressUriPropertyInfo ,
constructProxyAddressUri ,
getProxyAddressUri ,
ProxyAddressUsernamePropertyInfo ,
constructProxyAddressUsername ,
getProxyAddressUsername ,
) 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 ProxyAddress = ProxyAddress (ForeignPtr ProxyAddress)
foreign import ccall "g_proxy_address_get_type"
c_g_proxy_address_get_type :: IO GType
type instance ParentTypes ProxyAddress = ProxyAddressParentTypes
type ProxyAddressParentTypes = '[InetSocketAddress, SocketAddress, GObject.Object, SocketConnectable]
instance GObject ProxyAddress where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_g_proxy_address_get_type
class GObject o => ProxyAddressK o
instance (GObject o, IsDescendantOf ProxyAddress o) => ProxyAddressK o
toProxyAddress :: ProxyAddressK o => o -> IO ProxyAddress
toProxyAddress = unsafeCastTo ProxyAddress
noProxyAddress :: Maybe ProxyAddress
noProxyAddress = Nothing
getProxyAddressDestinationHostname :: (MonadIO m, ProxyAddressK o) => o -> m T.Text
getProxyAddressDestinationHostname obj = liftIO $ getObjectPropertyString obj "destination-hostname"
constructProxyAddressDestinationHostname :: T.Text -> IO ([Char], GValue)
constructProxyAddressDestinationHostname val = constructObjectPropertyString "destination-hostname" val
data ProxyAddressDestinationHostnamePropertyInfo
instance AttrInfo ProxyAddressDestinationHostnamePropertyInfo where
type AttrAllowedOps ProxyAddressDestinationHostnamePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ProxyAddressDestinationHostnamePropertyInfo = (~) T.Text
type AttrBaseTypeConstraint ProxyAddressDestinationHostnamePropertyInfo = ProxyAddressK
type AttrGetType ProxyAddressDestinationHostnamePropertyInfo = T.Text
type AttrLabel ProxyAddressDestinationHostnamePropertyInfo = "ProxyAddress::destination-hostname"
attrGet _ = getProxyAddressDestinationHostname
attrSet _ = undefined
attrConstruct _ = constructProxyAddressDestinationHostname
getProxyAddressDestinationPort :: (MonadIO m, ProxyAddressK o) => o -> m Word32
getProxyAddressDestinationPort obj = liftIO $ getObjectPropertyCUInt obj "destination-port"
constructProxyAddressDestinationPort :: Word32 -> IO ([Char], GValue)
constructProxyAddressDestinationPort val = constructObjectPropertyCUInt "destination-port" val
data ProxyAddressDestinationPortPropertyInfo
instance AttrInfo ProxyAddressDestinationPortPropertyInfo where
type AttrAllowedOps ProxyAddressDestinationPortPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ProxyAddressDestinationPortPropertyInfo = (~) Word32
type AttrBaseTypeConstraint ProxyAddressDestinationPortPropertyInfo = ProxyAddressK
type AttrGetType ProxyAddressDestinationPortPropertyInfo = Word32
type AttrLabel ProxyAddressDestinationPortPropertyInfo = "ProxyAddress::destination-port"
attrGet _ = getProxyAddressDestinationPort
attrSet _ = undefined
attrConstruct _ = constructProxyAddressDestinationPort
getProxyAddressDestinationProtocol :: (MonadIO m, ProxyAddressK o) => o -> m T.Text
getProxyAddressDestinationProtocol obj = liftIO $ getObjectPropertyString obj "destination-protocol"
constructProxyAddressDestinationProtocol :: T.Text -> IO ([Char], GValue)
constructProxyAddressDestinationProtocol val = constructObjectPropertyString "destination-protocol" val
data ProxyAddressDestinationProtocolPropertyInfo
instance AttrInfo ProxyAddressDestinationProtocolPropertyInfo where
type AttrAllowedOps ProxyAddressDestinationProtocolPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ProxyAddressDestinationProtocolPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint ProxyAddressDestinationProtocolPropertyInfo = ProxyAddressK
type AttrGetType ProxyAddressDestinationProtocolPropertyInfo = T.Text
type AttrLabel ProxyAddressDestinationProtocolPropertyInfo = "ProxyAddress::destination-protocol"
attrGet _ = getProxyAddressDestinationProtocol
attrSet _ = undefined
attrConstruct _ = constructProxyAddressDestinationProtocol
getProxyAddressPassword :: (MonadIO m, ProxyAddressK o) => o -> m T.Text
getProxyAddressPassword obj = liftIO $ getObjectPropertyString obj "password"
constructProxyAddressPassword :: T.Text -> IO ([Char], GValue)
constructProxyAddressPassword val = constructObjectPropertyString "password" val
data ProxyAddressPasswordPropertyInfo
instance AttrInfo ProxyAddressPasswordPropertyInfo where
type AttrAllowedOps ProxyAddressPasswordPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ProxyAddressPasswordPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint ProxyAddressPasswordPropertyInfo = ProxyAddressK
type AttrGetType ProxyAddressPasswordPropertyInfo = T.Text
type AttrLabel ProxyAddressPasswordPropertyInfo = "ProxyAddress::password"
attrGet _ = getProxyAddressPassword
attrSet _ = undefined
attrConstruct _ = constructProxyAddressPassword
getProxyAddressProtocol :: (MonadIO m, ProxyAddressK o) => o -> m T.Text
getProxyAddressProtocol obj = liftIO $ getObjectPropertyString obj "protocol"
constructProxyAddressProtocol :: T.Text -> IO ([Char], GValue)
constructProxyAddressProtocol val = constructObjectPropertyString "protocol" val
data ProxyAddressProtocolPropertyInfo
instance AttrInfo ProxyAddressProtocolPropertyInfo where
type AttrAllowedOps ProxyAddressProtocolPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ProxyAddressProtocolPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint ProxyAddressProtocolPropertyInfo = ProxyAddressK
type AttrGetType ProxyAddressProtocolPropertyInfo = T.Text
type AttrLabel ProxyAddressProtocolPropertyInfo = "ProxyAddress::protocol"
attrGet _ = getProxyAddressProtocol
attrSet _ = undefined
attrConstruct _ = constructProxyAddressProtocol
getProxyAddressUri :: (MonadIO m, ProxyAddressK o) => o -> m T.Text
getProxyAddressUri obj = liftIO $ getObjectPropertyString obj "uri"
constructProxyAddressUri :: T.Text -> IO ([Char], GValue)
constructProxyAddressUri val = constructObjectPropertyString "uri" val
data ProxyAddressUriPropertyInfo
instance AttrInfo ProxyAddressUriPropertyInfo where
type AttrAllowedOps ProxyAddressUriPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ProxyAddressUriPropertyInfo = (~) T.Text
type AttrBaseTypeConstraint ProxyAddressUriPropertyInfo = ProxyAddressK
type AttrGetType ProxyAddressUriPropertyInfo = T.Text
type AttrLabel ProxyAddressUriPropertyInfo = "ProxyAddress::uri"
attrGet _ = getProxyAddressUri
attrSet _ = undefined
attrConstruct _ = constructProxyAddressUri
getProxyAddressUsername :: (MonadIO m, ProxyAddressK o) => o -> m T.Text
getProxyAddressUsername obj = liftIO $ getObjectPropertyString obj "username"
constructProxyAddressUsername :: T.Text -> IO ([Char], GValue)
constructProxyAddressUsername val = constructObjectPropertyString "username" val
data ProxyAddressUsernamePropertyInfo
instance AttrInfo ProxyAddressUsernamePropertyInfo where
type AttrAllowedOps ProxyAddressUsernamePropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ProxyAddressUsernamePropertyInfo = (~) T.Text
type AttrBaseTypeConstraint ProxyAddressUsernamePropertyInfo = ProxyAddressK
type AttrGetType ProxyAddressUsernamePropertyInfo = T.Text
type AttrLabel ProxyAddressUsernamePropertyInfo = "ProxyAddress::username"
attrGet _ = getProxyAddressUsername
attrSet _ = undefined
attrConstruct _ = constructProxyAddressUsername
type instance AttributeList ProxyAddress = ProxyAddressAttributeList
type ProxyAddressAttributeList = ('[ '("address", InetSocketAddressAddressPropertyInfo), '("destination-hostname", ProxyAddressDestinationHostnamePropertyInfo), '("destination-port", ProxyAddressDestinationPortPropertyInfo), '("destination-protocol", ProxyAddressDestinationProtocolPropertyInfo), '("family", SocketAddressFamilyPropertyInfo), '("flowinfo", InetSocketAddressFlowinfoPropertyInfo), '("password", ProxyAddressPasswordPropertyInfo), '("port", InetSocketAddressPortPropertyInfo), '("protocol", ProxyAddressProtocolPropertyInfo), '("scope-id", InetSocketAddressScopeIdPropertyInfo), '("uri", ProxyAddressUriPropertyInfo), '("username", ProxyAddressUsernamePropertyInfo)] :: [(Symbol, *)])
type instance SignalList ProxyAddress = ProxyAddressSignalList
type ProxyAddressSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "g_proxy_address_new" g_proxy_address_new ::
Ptr InetAddress ->
Word16 ->
CString ->
CString ->
Word16 ->
CString ->
CString ->
IO (Ptr ProxyAddress)
proxyAddressNew ::
(MonadIO m, InetAddressK a) =>
a ->
Word16 ->
T.Text ->
T.Text ->
Word16 ->
Maybe (T.Text) ->
Maybe (T.Text) ->
m ProxyAddress
proxyAddressNew inetaddr port protocol dest_hostname dest_port username password = liftIO $ do
let inetaddr' = unsafeManagedPtrCastPtr inetaddr
protocol' <- textToCString protocol
dest_hostname' <- textToCString dest_hostname
maybeUsername <- case username of
Nothing -> return nullPtr
Just jUsername -> do
jUsername' <- textToCString jUsername
return jUsername'
maybePassword <- case password of
Nothing -> return nullPtr
Just jPassword -> do
jPassword' <- textToCString jPassword
return jPassword'
result <- g_proxy_address_new inetaddr' port protocol' dest_hostname' dest_port maybeUsername maybePassword
checkUnexpectedReturnNULL "g_proxy_address_new" result
result' <- (wrapObject ProxyAddress) result
touchManagedPtr inetaddr
freeMem protocol'
freeMem dest_hostname'
freeMem maybeUsername
freeMem maybePassword
return result'
foreign import ccall "g_proxy_address_get_destination_hostname" g_proxy_address_get_destination_hostname ::
Ptr ProxyAddress ->
IO CString
proxyAddressGetDestinationHostname ::
(MonadIO m, ProxyAddressK a) =>
a ->
m T.Text
proxyAddressGetDestinationHostname _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- g_proxy_address_get_destination_hostname _obj'
checkUnexpectedReturnNULL "g_proxy_address_get_destination_hostname" result
result' <- cstringToText result
touchManagedPtr _obj
return result'
foreign import ccall "g_proxy_address_get_destination_port" g_proxy_address_get_destination_port ::
Ptr ProxyAddress ->
IO Word16
proxyAddressGetDestinationPort ::
(MonadIO m, ProxyAddressK a) =>
a ->
m Word16
proxyAddressGetDestinationPort _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- g_proxy_address_get_destination_port _obj'
touchManagedPtr _obj
return result
foreign import ccall "g_proxy_address_get_destination_protocol" g_proxy_address_get_destination_protocol ::
Ptr ProxyAddress ->
IO CString
proxyAddressGetDestinationProtocol ::
(MonadIO m, ProxyAddressK a) =>
a ->
m T.Text
proxyAddressGetDestinationProtocol _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- g_proxy_address_get_destination_protocol _obj'
checkUnexpectedReturnNULL "g_proxy_address_get_destination_protocol" result
result' <- cstringToText result
touchManagedPtr _obj
return result'
foreign import ccall "g_proxy_address_get_password" g_proxy_address_get_password ::
Ptr ProxyAddress ->
IO CString
proxyAddressGetPassword ::
(MonadIO m, ProxyAddressK a) =>
a ->
m T.Text
proxyAddressGetPassword _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- g_proxy_address_get_password _obj'
checkUnexpectedReturnNULL "g_proxy_address_get_password" result
result' <- cstringToText result
touchManagedPtr _obj
return result'
foreign import ccall "g_proxy_address_get_protocol" g_proxy_address_get_protocol ::
Ptr ProxyAddress ->
IO CString
proxyAddressGetProtocol ::
(MonadIO m, ProxyAddressK a) =>
a ->
m T.Text
proxyAddressGetProtocol _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- g_proxy_address_get_protocol _obj'
checkUnexpectedReturnNULL "g_proxy_address_get_protocol" result
result' <- cstringToText result
touchManagedPtr _obj
return result'
foreign import ccall "g_proxy_address_get_uri" g_proxy_address_get_uri ::
Ptr ProxyAddress ->
IO CString
proxyAddressGetUri ::
(MonadIO m, ProxyAddressK a) =>
a ->
m T.Text
proxyAddressGetUri _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- g_proxy_address_get_uri _obj'
checkUnexpectedReturnNULL "g_proxy_address_get_uri" result
result' <- cstringToText result
touchManagedPtr _obj
return result'
foreign import ccall "g_proxy_address_get_username" g_proxy_address_get_username ::
Ptr ProxyAddress ->
IO CString
proxyAddressGetUsername ::
(MonadIO m, ProxyAddressK a) =>
a ->
m T.Text
proxyAddressGetUsername _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- g_proxy_address_get_username _obj'
checkUnexpectedReturnNULL "g_proxy_address_get_username" result
result' <- cstringToText result
touchManagedPtr _obj
return result'