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

A subclass of 'GI.Gio.Objects.SocketAddressEnumerator.SocketAddressEnumerator' that takes another address
enumerator and wraps its results in 'GI.Gio.Objects.ProxyAddress.ProxyAddress'\<!-- -->es as
directed by the default 'GI.Gio.Interfaces.ProxyResolver.ProxyResolver'.
-}

module GI.Gio.Objects.ProxyAddressEnumerator
    ( 

-- * Exported types
    ProxyAddressEnumerator(..)              ,
    IsProxyAddressEnumerator                ,
    toProxyAddressEnumerator                ,
    noProxyAddressEnumerator                ,


 -- * Properties
-- ** connectable #attr:connectable#
    ProxyAddressEnumeratorConnectablePropertyInfo,
    constructProxyAddressEnumeratorConnectable,
    getProxyAddressEnumeratorConnectable    ,
    proxyAddressEnumeratorConnectable       ,


-- ** defaultPort #attr:defaultPort#
    ProxyAddressEnumeratorDefaultPortPropertyInfo,
    constructProxyAddressEnumeratorDefaultPort,
    getProxyAddressEnumeratorDefaultPort    ,
    proxyAddressEnumeratorDefaultPort       ,


-- ** proxyResolver #attr:proxyResolver#
    ProxyAddressEnumeratorProxyResolverPropertyInfo,
    clearProxyAddressEnumeratorProxyResolver,
    constructProxyAddressEnumeratorProxyResolver,
    getProxyAddressEnumeratorProxyResolver  ,
    proxyAddressEnumeratorProxyResolver     ,
    setProxyAddressEnumeratorProxyResolver  ,


-- ** uri #attr:uri#
    ProxyAddressEnumeratorUriPropertyInfo   ,
    constructProxyAddressEnumeratorUri      ,
    getProxyAddressEnumeratorUri            ,
    proxyAddressEnumeratorUri               ,




    ) 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
import {-# SOURCE #-} qualified GI.Gio.Interfaces.SocketConnectable as Gio.SocketConnectable
import {-# SOURCE #-} qualified GI.Gio.Objects.SocketAddressEnumerator as Gio.SocketAddressEnumerator

newtype ProxyAddressEnumerator = ProxyAddressEnumerator (ManagedPtr ProxyAddressEnumerator)
foreign import ccall "g_proxy_address_enumerator_get_type"
    c_g_proxy_address_enumerator_get_type :: IO GType

instance GObject ProxyAddressEnumerator where
    gobjectType _ = c_g_proxy_address_enumerator_get_type
    

class GObject o => IsProxyAddressEnumerator o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError ProxyAddressEnumerator a) =>
    IsProxyAddressEnumerator a
#endif
instance IsProxyAddressEnumerator ProxyAddressEnumerator
instance Gio.SocketAddressEnumerator.IsSocketAddressEnumerator ProxyAddressEnumerator
instance GObject.Object.IsObject ProxyAddressEnumerator

toProxyAddressEnumerator :: IsProxyAddressEnumerator o => o -> IO ProxyAddressEnumerator
toProxyAddressEnumerator = unsafeCastTo ProxyAddressEnumerator

noProxyAddressEnumerator :: Maybe ProxyAddressEnumerator
noProxyAddressEnumerator = Nothing

type family ResolveProxyAddressEnumeratorMethod (t :: Symbol) (o :: *) :: * where
    ResolveProxyAddressEnumeratorMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveProxyAddressEnumeratorMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveProxyAddressEnumeratorMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveProxyAddressEnumeratorMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveProxyAddressEnumeratorMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveProxyAddressEnumeratorMethod "next" o = Gio.SocketAddressEnumerator.SocketAddressEnumeratorNextMethodInfo
    ResolveProxyAddressEnumeratorMethod "nextAsync" o = Gio.SocketAddressEnumerator.SocketAddressEnumeratorNextAsyncMethodInfo
    ResolveProxyAddressEnumeratorMethod "nextFinish" o = Gio.SocketAddressEnumerator.SocketAddressEnumeratorNextFinishMethodInfo
    ResolveProxyAddressEnumeratorMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveProxyAddressEnumeratorMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveProxyAddressEnumeratorMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveProxyAddressEnumeratorMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveProxyAddressEnumeratorMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveProxyAddressEnumeratorMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveProxyAddressEnumeratorMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveProxyAddressEnumeratorMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveProxyAddressEnumeratorMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveProxyAddressEnumeratorMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveProxyAddressEnumeratorMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveProxyAddressEnumeratorMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveProxyAddressEnumeratorMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveProxyAddressEnumeratorMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveProxyAddressEnumeratorMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveProxyAddressEnumeratorMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveProxyAddressEnumeratorMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveProxyAddressEnumeratorMethod l o = O.MethodResolutionFailed l o

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

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

-- VVV Prop "connectable"
   -- Type: TInterface (Name {namespace = "Gio", name = "SocketConnectable"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getProxyAddressEnumeratorConnectable :: (MonadIO m, IsProxyAddressEnumerator o) => o -> m (Maybe Gio.SocketConnectable.SocketConnectable)
getProxyAddressEnumeratorConnectable obj = liftIO $ getObjectPropertyObject obj "connectable" Gio.SocketConnectable.SocketConnectable

constructProxyAddressEnumeratorConnectable :: (IsProxyAddressEnumerator o, Gio.SocketConnectable.IsSocketConnectable a) => a -> IO (GValueConstruct o)
constructProxyAddressEnumeratorConnectable val = constructObjectPropertyObject "connectable" (Just val)

data ProxyAddressEnumeratorConnectablePropertyInfo
instance AttrInfo ProxyAddressEnumeratorConnectablePropertyInfo where
    type AttrAllowedOps ProxyAddressEnumeratorConnectablePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint ProxyAddressEnumeratorConnectablePropertyInfo = Gio.SocketConnectable.IsSocketConnectable
    type AttrBaseTypeConstraint ProxyAddressEnumeratorConnectablePropertyInfo = IsProxyAddressEnumerator
    type AttrGetType ProxyAddressEnumeratorConnectablePropertyInfo = (Maybe Gio.SocketConnectable.SocketConnectable)
    type AttrLabel ProxyAddressEnumeratorConnectablePropertyInfo = "connectable"
    type AttrOrigin ProxyAddressEnumeratorConnectablePropertyInfo = ProxyAddressEnumerator
    attrGet _ = getProxyAddressEnumeratorConnectable
    attrSet _ = undefined
    attrConstruct _ = constructProxyAddressEnumeratorConnectable
    attrClear _ = undefined

-- VVV Prop "default-port"
   -- Type: TBasicType TUInt
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getProxyAddressEnumeratorDefaultPort :: (MonadIO m, IsProxyAddressEnumerator o) => o -> m Word32
getProxyAddressEnumeratorDefaultPort obj = liftIO $ getObjectPropertyUInt32 obj "default-port"

constructProxyAddressEnumeratorDefaultPort :: (IsProxyAddressEnumerator o) => Word32 -> IO (GValueConstruct o)
constructProxyAddressEnumeratorDefaultPort val = constructObjectPropertyUInt32 "default-port" val

data ProxyAddressEnumeratorDefaultPortPropertyInfo
instance AttrInfo ProxyAddressEnumeratorDefaultPortPropertyInfo where
    type AttrAllowedOps ProxyAddressEnumeratorDefaultPortPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint ProxyAddressEnumeratorDefaultPortPropertyInfo = (~) Word32
    type AttrBaseTypeConstraint ProxyAddressEnumeratorDefaultPortPropertyInfo = IsProxyAddressEnumerator
    type AttrGetType ProxyAddressEnumeratorDefaultPortPropertyInfo = Word32
    type AttrLabel ProxyAddressEnumeratorDefaultPortPropertyInfo = "default-port"
    type AttrOrigin ProxyAddressEnumeratorDefaultPortPropertyInfo = ProxyAddressEnumerator
    attrGet _ = getProxyAddressEnumeratorDefaultPort
    attrSet _ = undefined
    attrConstruct _ = constructProxyAddressEnumeratorDefaultPort
    attrClear _ = undefined

-- VVV Prop "proxy-resolver"
   -- Type: TInterface (Name {namespace = "Gio", name = "ProxyResolver"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct]
   -- Nullable: (Nothing,Nothing)

getProxyAddressEnumeratorProxyResolver :: (MonadIO m, IsProxyAddressEnumerator o) => o -> m (Maybe Gio.ProxyResolver.ProxyResolver)
getProxyAddressEnumeratorProxyResolver obj = liftIO $ getObjectPropertyObject obj "proxy-resolver" Gio.ProxyResolver.ProxyResolver

setProxyAddressEnumeratorProxyResolver :: (MonadIO m, IsProxyAddressEnumerator o, Gio.ProxyResolver.IsProxyResolver a) => o -> a -> m ()
setProxyAddressEnumeratorProxyResolver obj val = liftIO $ setObjectPropertyObject obj "proxy-resolver" (Just val)

constructProxyAddressEnumeratorProxyResolver :: (IsProxyAddressEnumerator o, Gio.ProxyResolver.IsProxyResolver a) => a -> IO (GValueConstruct o)
constructProxyAddressEnumeratorProxyResolver val = constructObjectPropertyObject "proxy-resolver" (Just val)

clearProxyAddressEnumeratorProxyResolver :: (MonadIO m, IsProxyAddressEnumerator o) => o -> m ()
clearProxyAddressEnumeratorProxyResolver obj = liftIO $ setObjectPropertyObject obj "proxy-resolver" (Nothing :: Maybe Gio.ProxyResolver.ProxyResolver)

data ProxyAddressEnumeratorProxyResolverPropertyInfo
instance AttrInfo ProxyAddressEnumeratorProxyResolverPropertyInfo where
    type AttrAllowedOps ProxyAddressEnumeratorProxyResolverPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint ProxyAddressEnumeratorProxyResolverPropertyInfo = Gio.ProxyResolver.IsProxyResolver
    type AttrBaseTypeConstraint ProxyAddressEnumeratorProxyResolverPropertyInfo = IsProxyAddressEnumerator
    type AttrGetType ProxyAddressEnumeratorProxyResolverPropertyInfo = (Maybe Gio.ProxyResolver.ProxyResolver)
    type AttrLabel ProxyAddressEnumeratorProxyResolverPropertyInfo = "proxy-resolver"
    type AttrOrigin ProxyAddressEnumeratorProxyResolverPropertyInfo = ProxyAddressEnumerator
    attrGet _ = getProxyAddressEnumeratorProxyResolver
    attrSet _ = setProxyAddressEnumeratorProxyResolver
    attrConstruct _ = constructProxyAddressEnumeratorProxyResolver
    attrClear _ = clearProxyAddressEnumeratorProxyResolver

-- VVV Prop "uri"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

getProxyAddressEnumeratorUri :: (MonadIO m, IsProxyAddressEnumerator o) => o -> m (Maybe T.Text)
getProxyAddressEnumeratorUri obj = liftIO $ getObjectPropertyString obj "uri"

constructProxyAddressEnumeratorUri :: (IsProxyAddressEnumerator o) => T.Text -> IO (GValueConstruct o)
constructProxyAddressEnumeratorUri val = constructObjectPropertyString "uri" (Just val)

data ProxyAddressEnumeratorUriPropertyInfo
instance AttrInfo ProxyAddressEnumeratorUriPropertyInfo where
    type AttrAllowedOps ProxyAddressEnumeratorUriPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint ProxyAddressEnumeratorUriPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint ProxyAddressEnumeratorUriPropertyInfo = IsProxyAddressEnumerator
    type AttrGetType ProxyAddressEnumeratorUriPropertyInfo = (Maybe T.Text)
    type AttrLabel ProxyAddressEnumeratorUriPropertyInfo = "uri"
    type AttrOrigin ProxyAddressEnumeratorUriPropertyInfo = ProxyAddressEnumerator
    attrGet _ = getProxyAddressEnumeratorUri
    attrSet _ = undefined
    attrConstruct _ = constructProxyAddressEnumeratorUri
    attrClear _ = undefined

instance O.HasAttributeList ProxyAddressEnumerator
type instance O.AttributeList ProxyAddressEnumerator = ProxyAddressEnumeratorAttributeList
type ProxyAddressEnumeratorAttributeList = ('[ '("connectable", ProxyAddressEnumeratorConnectablePropertyInfo), '("defaultPort", ProxyAddressEnumeratorDefaultPortPropertyInfo), '("proxyResolver", ProxyAddressEnumeratorProxyResolverPropertyInfo), '("uri", ProxyAddressEnumeratorUriPropertyInfo)] :: [(Symbol, *)])

proxyAddressEnumeratorConnectable :: AttrLabelProxy "connectable"
proxyAddressEnumeratorConnectable = AttrLabelProxy

proxyAddressEnumeratorDefaultPort :: AttrLabelProxy "defaultPort"
proxyAddressEnumeratorDefaultPort = AttrLabelProxy

proxyAddressEnumeratorProxyResolver :: AttrLabelProxy "proxyResolver"
proxyAddressEnumeratorProxyResolver = AttrLabelProxy

proxyAddressEnumeratorUri :: AttrLabelProxy "uri"
proxyAddressEnumeratorUri = AttrLabelProxy

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