{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Soup.Objects.SessionSync
(
SessionSync(..) ,
IsSessionSync ,
toSessionSync ,
#if defined(ENABLE_OVERLOADING)
ResolveSessionSyncMethod ,
#endif
sessionSyncNew ,
) 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.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 {-# SOURCE #-} qualified GI.Soup.Objects.Session as Soup.Session
#endif
newtype SessionSync = SessionSync (SP.ManagedPtr SessionSync)
deriving (SessionSync -> SessionSync -> Bool
(SessionSync -> SessionSync -> Bool)
-> (SessionSync -> SessionSync -> Bool) -> Eq SessionSync
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SessionSync -> SessionSync -> Bool
== :: SessionSync -> SessionSync -> Bool
$c/= :: SessionSync -> SessionSync -> Bool
/= :: SessionSync -> SessionSync -> Bool
Eq)
instance SP.ManagedPtrNewtype SessionSync where
toManagedPtr :: SessionSync -> ManagedPtr SessionSync
toManagedPtr (SessionSync ManagedPtr SessionSync
p) = ManagedPtr SessionSync
p
foreign import ccall "soup_session_sync_get_type"
c_soup_session_sync_get_type :: IO B.Types.GType
instance B.Types.TypedObject SessionSync where
glibType :: IO GType
glibType = IO GType
c_soup_session_sync_get_type
instance B.Types.GObject SessionSync
class (SP.GObject o, O.IsDescendantOf SessionSync o) => IsSessionSync o
instance (SP.GObject o, O.IsDescendantOf SessionSync o) => IsSessionSync o
instance O.HasParentTypes SessionSync
type instance O.ParentTypes SessionSync = '[Soup.Session.Session, GObject.Object.Object]
toSessionSync :: (MIO.MonadIO m, IsSessionSync o) => o -> m SessionSync
toSessionSync :: forall (m :: * -> *) o.
(MonadIO m, IsSessionSync o) =>
o -> m SessionSync
toSessionSync = IO SessionSync -> m SessionSync
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO SessionSync -> m SessionSync)
-> (o -> IO SessionSync) -> o -> m SessionSync
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr SessionSync -> SessionSync) -> o -> IO SessionSync
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr SessionSync -> SessionSync
SessionSync
instance B.GValue.IsGValue (Maybe SessionSync) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_soup_session_sync_get_type
gvalueSet_ :: Ptr GValue -> Maybe SessionSync -> IO ()
gvalueSet_ Ptr GValue
gv Maybe SessionSync
P.Nothing = Ptr GValue -> Ptr SessionSync -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr SessionSync
forall a. Ptr a
FP.nullPtr :: FP.Ptr SessionSync)
gvalueSet_ Ptr GValue
gv (P.Just SessionSync
obj) = SessionSync -> (Ptr SessionSync -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SessionSync
obj (Ptr GValue -> Ptr SessionSync -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe SessionSync)
gvalueGet_ Ptr GValue
gv = do
Ptr SessionSync
ptr <- Ptr GValue -> IO (Ptr SessionSync)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr SessionSync)
if Ptr SessionSync
ptr Ptr SessionSync -> Ptr SessionSync -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr SessionSync
forall a. Ptr a
FP.nullPtr
then SessionSync -> Maybe SessionSync
forall a. a -> Maybe a
P.Just (SessionSync -> Maybe SessionSync)
-> IO SessionSync -> IO (Maybe SessionSync)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr SessionSync -> SessionSync)
-> Ptr SessionSync -> IO SessionSync
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr SessionSync -> SessionSync
SessionSync Ptr SessionSync
ptr
else Maybe SessionSync -> IO (Maybe SessionSync)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe SessionSync
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveSessionSyncMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveSessionSyncMethod "abort" o = Soup.Session.SessionAbortMethodInfo
ResolveSessionSyncMethod "addFeature" o = Soup.Session.SessionAddFeatureMethodInfo
ResolveSessionSyncMethod "addFeatureByType" o = Soup.Session.SessionAddFeatureByTypeMethodInfo
ResolveSessionSyncMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSessionSyncMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSessionSyncMethod "cancelMessage" o = Soup.Session.SessionCancelMessageMethodInfo
ResolveSessionSyncMethod "connectAsync" o = Soup.Session.SessionConnectAsyncMethodInfo
ResolveSessionSyncMethod "connectFinish" o = Soup.Session.SessionConnectFinishMethodInfo
ResolveSessionSyncMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSessionSyncMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSessionSyncMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSessionSyncMethod "hasFeature" o = Soup.Session.SessionHasFeatureMethodInfo
ResolveSessionSyncMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSessionSyncMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSessionSyncMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSessionSyncMethod "pauseMessage" o = Soup.Session.SessionPauseMessageMethodInfo
ResolveSessionSyncMethod "prefetchDns" o = Soup.Session.SessionPrefetchDnsMethodInfo
ResolveSessionSyncMethod "prepareForUri" o = Soup.Session.SessionPrepareForUriMethodInfo
ResolveSessionSyncMethod "queueMessage" o = Soup.Session.SessionQueueMessageMethodInfo
ResolveSessionSyncMethod "redirectMessage" o = Soup.Session.SessionRedirectMessageMethodInfo
ResolveSessionSyncMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSessionSyncMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSessionSyncMethod "removeFeature" o = Soup.Session.SessionRemoveFeatureMethodInfo
ResolveSessionSyncMethod "removeFeatureByType" o = Soup.Session.SessionRemoveFeatureByTypeMethodInfo
ResolveSessionSyncMethod "request" o = Soup.Session.SessionRequestMethodInfo
ResolveSessionSyncMethod "requestHttp" o = Soup.Session.SessionRequestHttpMethodInfo
ResolveSessionSyncMethod "requestHttpUri" o = Soup.Session.SessionRequestHttpUriMethodInfo
ResolveSessionSyncMethod "requestUri" o = Soup.Session.SessionRequestUriMethodInfo
ResolveSessionSyncMethod "requeueMessage" o = Soup.Session.SessionRequeueMessageMethodInfo
ResolveSessionSyncMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSessionSyncMethod "send" o = Soup.Session.SessionSendMethodInfo
ResolveSessionSyncMethod "sendAsync" o = Soup.Session.SessionSendAsyncMethodInfo
ResolveSessionSyncMethod "sendFinish" o = Soup.Session.SessionSendFinishMethodInfo
ResolveSessionSyncMethod "sendMessage" o = Soup.Session.SessionSendMessageMethodInfo
ResolveSessionSyncMethod "stealConnection" o = Soup.Session.SessionStealConnectionMethodInfo
ResolveSessionSyncMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSessionSyncMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSessionSyncMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSessionSyncMethod "unpauseMessage" o = Soup.Session.SessionUnpauseMessageMethodInfo
ResolveSessionSyncMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSessionSyncMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSessionSyncMethod "websocketConnectAsync" o = Soup.Session.SessionWebsocketConnectAsyncMethodInfo
ResolveSessionSyncMethod "websocketConnectFinish" o = Soup.Session.SessionWebsocketConnectFinishMethodInfo
ResolveSessionSyncMethod "wouldRedirect" o = Soup.Session.SessionWouldRedirectMethodInfo
ResolveSessionSyncMethod "getAsyncContext" o = Soup.Session.SessionGetAsyncContextMethodInfo
ResolveSessionSyncMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSessionSyncMethod "getFeature" o = Soup.Session.SessionGetFeatureMethodInfo
ResolveSessionSyncMethod "getFeatureForMessage" o = Soup.Session.SessionGetFeatureForMessageMethodInfo
ResolveSessionSyncMethod "getFeatures" o = Soup.Session.SessionGetFeaturesMethodInfo
ResolveSessionSyncMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSessionSyncMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSessionSyncMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSessionSyncMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveSessionSyncMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSessionSyncMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSessionSyncMethod t SessionSync, O.OverloadedMethod info SessionSync p) => OL.IsLabel t (SessionSync -> 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 ~ ResolveSessionSyncMethod t SessionSync, O.OverloadedMethod info SessionSync p, R.HasField t SessionSync p) => R.HasField t SessionSync p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveSessionSyncMethod t SessionSync, O.OverloadedMethodInfo info SessionSync) => OL.IsLabel t (O.MethodProxy info SessionSync) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SessionSync
type instance O.AttributeList SessionSync = SessionSyncAttributeList
type SessionSyncAttributeList = ('[ '("acceptLanguage", Soup.Session.SessionAcceptLanguagePropertyInfo), '("acceptLanguageAuto", Soup.Session.SessionAcceptLanguageAutoPropertyInfo), '("asyncContext", Soup.Session.SessionAsyncContextPropertyInfo), '("httpAliases", Soup.Session.SessionHttpAliasesPropertyInfo), '("httpsAliases", Soup.Session.SessionHttpsAliasesPropertyInfo), '("idleTimeout", Soup.Session.SessionIdleTimeoutPropertyInfo), '("localAddress", Soup.Session.SessionLocalAddressPropertyInfo), '("maxConns", Soup.Session.SessionMaxConnsPropertyInfo), '("maxConnsPerHost", Soup.Session.SessionMaxConnsPerHostPropertyInfo), '("proxyResolver", Soup.Session.SessionProxyResolverPropertyInfo), '("proxyUri", Soup.Session.SessionProxyUriPropertyInfo), '("sslCaFile", Soup.Session.SessionSslCaFilePropertyInfo), '("sslStrict", Soup.Session.SessionSslStrictPropertyInfo), '("sslUseSystemCaFile", Soup.Session.SessionSslUseSystemCaFilePropertyInfo), '("timeout", Soup.Session.SessionTimeoutPropertyInfo), '("tlsDatabase", Soup.Session.SessionTlsDatabasePropertyInfo), '("tlsInteraction", Soup.Session.SessionTlsInteractionPropertyInfo), '("useNtlm", Soup.Session.SessionUseNtlmPropertyInfo), '("useThreadContext", Soup.Session.SessionUseThreadContextPropertyInfo), '("userAgent", Soup.Session.SessionUserAgentPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList SessionSync = SessionSyncSignalList
type SessionSyncSignalList = ('[ '("authenticate", Soup.Session.SessionAuthenticateSignalInfo), '("connectionCreated", Soup.Session.SessionConnectionCreatedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("requestQueued", Soup.Session.SessionRequestQueuedSignalInfo), '("requestStarted", Soup.Session.SessionRequestStartedSignalInfo), '("requestUnqueued", Soup.Session.SessionRequestUnqueuedSignalInfo), '("tunneling", Soup.Session.SessionTunnelingSignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "soup_session_sync_new" soup_session_sync_new ::
IO (Ptr SessionSync)
{-# DEPRECATED sessionSyncNew ["t'GI.Soup.Objects.SessionSync.SessionSync' is deprecated; use a plain","t'GI.Soup.Objects.Session.Session', created with 'GI.Soup.Objects.Session.sessionNew'. See the \\<link","linkend=\\\"libsoup-session-porting\\\">porting guide\\<\\/link>."] #-}
sessionSyncNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m SessionSync
sessionSyncNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m SessionSync
sessionSyncNew = IO SessionSync -> m SessionSync
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SessionSync -> m SessionSync)
-> IO SessionSync -> m SessionSync
forall a b. (a -> b) -> a -> b
$ do
Ptr SessionSync
result <- IO (Ptr SessionSync)
soup_session_sync_new
Text -> Ptr SessionSync -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"sessionSyncNew" Ptr SessionSync
result
SessionSync
result' <- ((ManagedPtr SessionSync -> SessionSync)
-> Ptr SessionSync -> IO SessionSync
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SessionSync -> SessionSync
SessionSync) Ptr SessionSync
result
SessionSync -> IO SessionSync
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return SessionSync
result'
#if defined(ENABLE_OVERLOADING)
#endif