{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Soup.Objects.ProxyResolverDefault
(
ProxyResolverDefault(..) ,
IsProxyResolverDefault ,
toProxyResolverDefault ,
#if defined(ENABLE_OVERLOADING)
ResolveProxyResolverDefaultMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ProxyResolverDefaultGproxyResolverPropertyInfo,
#endif
clearProxyResolverDefaultGproxyResolver ,
constructProxyResolverDefaultGproxyResolver,
#if defined(ENABLE_OVERLOADING)
proxyResolverDefaultGproxyResolver ,
#endif
setProxyResolverDefaultGproxyResolver ,
) 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 Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.MainContext as GLib.MainContext
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Enums as Gio.Enums
import qualified GI.Gio.Flags as Gio.Flags
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Interfaces.ProxyResolver as Gio.ProxyResolver
import qualified GI.Gio.Interfaces.SocketConnectable as Gio.SocketConnectable
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.IOStream as Gio.IOStream
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import qualified GI.Gio.Objects.Socket as Gio.Socket
import qualified GI.Gio.Objects.SocketAddress as Gio.SocketAddress
import qualified GI.Gio.Objects.TlsCertificate as Gio.TlsCertificate
import qualified GI.Gio.Objects.TlsDatabase as Gio.TlsDatabase
import qualified GI.Gio.Objects.TlsInteraction as Gio.TlsInteraction
import qualified GI.Soup.Callbacks as Soup.Callbacks
import {-# SOURCE #-} qualified GI.Soup.Enums as Soup.Enums
import {-# SOURCE #-} qualified GI.Soup.Flags as Soup.Flags
import {-# SOURCE #-} qualified GI.Soup.Interfaces.ProxyURIResolver as Soup.ProxyURIResolver
import {-# SOURCE #-} qualified GI.Soup.Interfaces.SessionFeature as Soup.SessionFeature
import {-# SOURCE #-} qualified GI.Soup.Objects.Address as Soup.Address
import {-# SOURCE #-} qualified GI.Soup.Objects.Auth as Soup.Auth
import {-# SOURCE #-} qualified GI.Soup.Objects.Message as Soup.Message
import {-# SOURCE #-} qualified GI.Soup.Objects.Request as Soup.Request
import {-# SOURCE #-} qualified GI.Soup.Objects.RequestHTTP as Soup.RequestHTTP
import {-# SOURCE #-} qualified GI.Soup.Objects.Session as Soup.Session
import {-# SOURCE #-} qualified GI.Soup.Objects.Socket as Soup.Socket
import {-# SOURCE #-} qualified GI.Soup.Objects.WebsocketConnection as Soup.WebsocketConnection
import {-# SOURCE #-} qualified GI.Soup.Objects.WebsocketExtension as Soup.WebsocketExtension
import {-# SOURCE #-} qualified GI.Soup.Structs.Buffer as Soup.Buffer
import {-# SOURCE #-} qualified GI.Soup.Structs.MessageBody as Soup.MessageBody
import {-# SOURCE #-} qualified GI.Soup.Structs.MessageHeaders as Soup.MessageHeaders
import {-# SOURCE #-} qualified GI.Soup.Structs.Range as Soup.Range
import {-# SOURCE #-} qualified GI.Soup.Structs.URI as Soup.URI
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Interfaces.ProxyResolver as Gio.ProxyResolver
import {-# SOURCE #-} qualified GI.Soup.Interfaces.ProxyURIResolver as Soup.ProxyURIResolver
import {-# SOURCE #-} qualified GI.Soup.Interfaces.SessionFeature as Soup.SessionFeature
#endif
newtype ProxyResolverDefault = ProxyResolverDefault (SP.ManagedPtr ProxyResolverDefault)
deriving (ProxyResolverDefault -> ProxyResolverDefault -> Bool
(ProxyResolverDefault -> ProxyResolverDefault -> Bool)
-> (ProxyResolverDefault -> ProxyResolverDefault -> Bool)
-> Eq ProxyResolverDefault
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ProxyResolverDefault -> ProxyResolverDefault -> Bool
== :: ProxyResolverDefault -> ProxyResolverDefault -> Bool
$c/= :: ProxyResolverDefault -> ProxyResolverDefault -> Bool
/= :: ProxyResolverDefault -> ProxyResolverDefault -> Bool
Eq)
instance SP.ManagedPtrNewtype ProxyResolverDefault where
toManagedPtr :: ProxyResolverDefault -> ManagedPtr ProxyResolverDefault
toManagedPtr (ProxyResolverDefault ManagedPtr ProxyResolverDefault
p) = ManagedPtr ProxyResolverDefault
p
foreign import ccall "soup_proxy_resolver_default_get_type"
c_soup_proxy_resolver_default_get_type :: IO B.Types.GType
instance B.Types.TypedObject ProxyResolverDefault where
glibType :: IO GType
glibType = IO GType
c_soup_proxy_resolver_default_get_type
instance B.Types.GObject ProxyResolverDefault
class (SP.GObject o, O.IsDescendantOf ProxyResolverDefault o) => IsProxyResolverDefault o
instance (SP.GObject o, O.IsDescendantOf ProxyResolverDefault o) => IsProxyResolverDefault o
instance O.HasParentTypes ProxyResolverDefault
type instance O.ParentTypes ProxyResolverDefault = '[GObject.Object.Object, Soup.ProxyURIResolver.ProxyURIResolver, Soup.SessionFeature.SessionFeature]
toProxyResolverDefault :: (MIO.MonadIO m, IsProxyResolverDefault o) => o -> m ProxyResolverDefault
toProxyResolverDefault :: forall (m :: * -> *) o.
(MonadIO m, IsProxyResolverDefault o) =>
o -> m ProxyResolverDefault
toProxyResolverDefault = IO ProxyResolverDefault -> m ProxyResolverDefault
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO ProxyResolverDefault -> m ProxyResolverDefault)
-> (o -> IO ProxyResolverDefault) -> o -> m ProxyResolverDefault
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr ProxyResolverDefault -> ProxyResolverDefault)
-> o -> IO ProxyResolverDefault
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr ProxyResolverDefault -> ProxyResolverDefault
ProxyResolverDefault
instance B.GValue.IsGValue (Maybe ProxyResolverDefault) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_soup_proxy_resolver_default_get_type
gvalueSet_ :: Ptr GValue -> Maybe ProxyResolverDefault -> IO ()
gvalueSet_ Ptr GValue
gv Maybe ProxyResolverDefault
P.Nothing = Ptr GValue -> Ptr ProxyResolverDefault -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr ProxyResolverDefault
forall a. Ptr a
FP.nullPtr :: FP.Ptr ProxyResolverDefault)
gvalueSet_ Ptr GValue
gv (P.Just ProxyResolverDefault
obj) = ProxyResolverDefault
-> (Ptr ProxyResolverDefault -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr ProxyResolverDefault
obj (Ptr GValue -> Ptr ProxyResolverDefault -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe ProxyResolverDefault)
gvalueGet_ Ptr GValue
gv = do
Ptr ProxyResolverDefault
ptr <- Ptr GValue -> IO (Ptr ProxyResolverDefault)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr ProxyResolverDefault)
if Ptr ProxyResolverDefault
ptr Ptr ProxyResolverDefault -> Ptr ProxyResolverDefault -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr ProxyResolverDefault
forall a. Ptr a
FP.nullPtr
then ProxyResolverDefault -> Maybe ProxyResolverDefault
forall a. a -> Maybe a
P.Just (ProxyResolverDefault -> Maybe ProxyResolverDefault)
-> IO ProxyResolverDefault -> IO (Maybe ProxyResolverDefault)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr ProxyResolverDefault -> ProxyResolverDefault)
-> Ptr ProxyResolverDefault -> IO ProxyResolverDefault
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr ProxyResolverDefault -> ProxyResolverDefault
ProxyResolverDefault Ptr ProxyResolverDefault
ptr
else Maybe ProxyResolverDefault -> IO (Maybe ProxyResolverDefault)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ProxyResolverDefault
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveProxyResolverDefaultMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveProxyResolverDefaultMethod "addFeature" o = Soup.SessionFeature.SessionFeatureAddFeatureMethodInfo
ResolveProxyResolverDefaultMethod "attach" o = Soup.SessionFeature.SessionFeatureAttachMethodInfo
ResolveProxyResolverDefaultMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveProxyResolverDefaultMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveProxyResolverDefaultMethod "detach" o = Soup.SessionFeature.SessionFeatureDetachMethodInfo
ResolveProxyResolverDefaultMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveProxyResolverDefaultMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveProxyResolverDefaultMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveProxyResolverDefaultMethod "hasFeature" o = Soup.SessionFeature.SessionFeatureHasFeatureMethodInfo
ResolveProxyResolverDefaultMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveProxyResolverDefaultMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveProxyResolverDefaultMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveProxyResolverDefaultMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveProxyResolverDefaultMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveProxyResolverDefaultMethod "removeFeature" o = Soup.SessionFeature.SessionFeatureRemoveFeatureMethodInfo
ResolveProxyResolverDefaultMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveProxyResolverDefaultMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveProxyResolverDefaultMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveProxyResolverDefaultMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveProxyResolverDefaultMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveProxyResolverDefaultMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveProxyResolverDefaultMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveProxyResolverDefaultMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveProxyResolverDefaultMethod "getProxyUriAsync" o = Soup.ProxyURIResolver.ProxyURIResolverGetProxyUriAsyncMethodInfo
ResolveProxyResolverDefaultMethod "getProxyUriSync" o = Soup.ProxyURIResolver.ProxyURIResolverGetProxyUriSyncMethodInfo
ResolveProxyResolverDefaultMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveProxyResolverDefaultMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveProxyResolverDefaultMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveProxyResolverDefaultMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveProxyResolverDefaultMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveProxyResolverDefaultMethod t ProxyResolverDefault, O.OverloadedMethod info ProxyResolverDefault p) => OL.IsLabel t (ProxyResolverDefault -> 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 ~ ResolveProxyResolverDefaultMethod t ProxyResolverDefault, O.OverloadedMethod info ProxyResolverDefault p, R.HasField t ProxyResolverDefault p) => R.HasField t ProxyResolverDefault p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveProxyResolverDefaultMethod t ProxyResolverDefault, O.OverloadedMethodInfo info ProxyResolverDefault) => OL.IsLabel t (O.MethodProxy info ProxyResolverDefault) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
setProxyResolverDefaultGproxyResolver :: (MonadIO m, IsProxyResolverDefault o, Gio.ProxyResolver.IsProxyResolver a) => o -> a -> m ()
setProxyResolverDefaultGproxyResolver :: forall (m :: * -> *) o a.
(MonadIO m, IsProxyResolverDefault o, IsProxyResolver a) =>
o -> a -> m ()
setProxyResolverDefaultGproxyResolver o
obj a
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"gproxy-resolver" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
constructProxyResolverDefaultGproxyResolver :: (IsProxyResolverDefault o, MIO.MonadIO m, Gio.ProxyResolver.IsProxyResolver a) => a -> m (GValueConstruct o)
constructProxyResolverDefaultGproxyResolver :: forall o (m :: * -> *) a.
(IsProxyResolverDefault o, MonadIO m, IsProxyResolver a) =>
a -> m (GValueConstruct o)
constructProxyResolverDefaultGproxyResolver a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"gproxy-resolver" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
clearProxyResolverDefaultGproxyResolver :: (MonadIO m, IsProxyResolverDefault o) => o -> m ()
clearProxyResolverDefaultGproxyResolver :: forall (m :: * -> *) o.
(MonadIO m, IsProxyResolverDefault o) =>
o -> m ()
clearProxyResolverDefaultGproxyResolver o
obj = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe ProxyResolver -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj String
"gproxy-resolver" (Maybe ProxyResolver
forall a. Maybe a
Nothing :: Maybe Gio.ProxyResolver.ProxyResolver)
#if defined(ENABLE_OVERLOADING)
data ProxyResolverDefaultGproxyResolverPropertyInfo
instance AttrInfo ProxyResolverDefaultGproxyResolverPropertyInfo where
type AttrAllowedOps ProxyResolverDefaultGproxyResolverPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrClear]
type AttrBaseTypeConstraint ProxyResolverDefaultGproxyResolverPropertyInfo = IsProxyResolverDefault
type AttrSetTypeConstraint ProxyResolverDefaultGproxyResolverPropertyInfo = Gio.ProxyResolver.IsProxyResolver
type AttrTransferTypeConstraint ProxyResolverDefaultGproxyResolverPropertyInfo = Gio.ProxyResolver.IsProxyResolver
type AttrTransferType ProxyResolverDefaultGproxyResolverPropertyInfo = Gio.ProxyResolver.ProxyResolver
type AttrGetType ProxyResolverDefaultGproxyResolverPropertyInfo = ()
type AttrLabel ProxyResolverDefaultGproxyResolverPropertyInfo = "gproxy-resolver"
type AttrOrigin ProxyResolverDefaultGproxyResolverPropertyInfo = ProxyResolverDefault
attrGet = undefined
attrSet = setProxyResolverDefaultGproxyResolver
attrTransfer _ v = do
unsafeCastTo Gio.ProxyResolver.ProxyResolver v
attrConstruct = constructProxyResolverDefaultGproxyResolver
attrClear = clearProxyResolverDefaultGproxyResolver
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.ProxyResolverDefault.gproxyResolver"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.29/docs/GI-Soup-Objects-ProxyResolverDefault.html#g:attr:gproxyResolver"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList ProxyResolverDefault
type instance O.AttributeList ProxyResolverDefault = ProxyResolverDefaultAttributeList
type ProxyResolverDefaultAttributeList = ('[ '("gproxyResolver", ProxyResolverDefaultGproxyResolverPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
proxyResolverDefaultGproxyResolver :: AttrLabelProxy "gproxyResolver"
proxyResolverDefaultGproxyResolver = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList ProxyResolverDefault = ProxyResolverDefaultSignalList
type ProxyResolverDefaultSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif