{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Soup.Objects.CookieJar
(
CookieJar(..) ,
IsCookieJar ,
toCookieJar ,
#if defined(ENABLE_OVERLOADING)
ResolveCookieJarMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
CookieJarAddCookieMethodInfo ,
#endif
cookieJarAddCookie ,
#if defined(ENABLE_OVERLOADING)
CookieJarAddCookieFullMethodInfo ,
#endif
cookieJarAddCookieFull ,
#if defined(ENABLE_OVERLOADING)
CookieJarAddCookieWithFirstPartyMethodInfo,
#endif
cookieJarAddCookieWithFirstParty ,
#if defined(ENABLE_OVERLOADING)
CookieJarAllCookiesMethodInfo ,
#endif
cookieJarAllCookies ,
#if defined(ENABLE_OVERLOADING)
CookieJarDeleteCookieMethodInfo ,
#endif
cookieJarDeleteCookie ,
#if defined(ENABLE_OVERLOADING)
CookieJarGetAcceptPolicyMethodInfo ,
#endif
cookieJarGetAcceptPolicy ,
#if defined(ENABLE_OVERLOADING)
CookieJarGetCookieListMethodInfo ,
#endif
cookieJarGetCookieList ,
#if defined(ENABLE_OVERLOADING)
CookieJarGetCookieListWithSameSiteInfoMethodInfo,
#endif
cookieJarGetCookieListWithSameSiteInfo ,
#if defined(ENABLE_OVERLOADING)
CookieJarGetCookiesMethodInfo ,
#endif
cookieJarGetCookies ,
#if defined(ENABLE_OVERLOADING)
CookieJarIsPersistentMethodInfo ,
#endif
cookieJarIsPersistent ,
cookieJarNew ,
#if defined(ENABLE_OVERLOADING)
CookieJarSetAcceptPolicyMethodInfo ,
#endif
cookieJarSetAcceptPolicy ,
#if defined(ENABLE_OVERLOADING)
CookieJarSetCookieMethodInfo ,
#endif
cookieJarSetCookie ,
#if defined(ENABLE_OVERLOADING)
CookieJarSetCookieWithFirstPartyMethodInfo,
#endif
cookieJarSetCookieWithFirstParty ,
#if defined(ENABLE_OVERLOADING)
CookieJarAcceptPolicyPropertyInfo ,
#endif
constructCookieJarAcceptPolicy ,
#if defined(ENABLE_OVERLOADING)
cookieJarAcceptPolicy ,
#endif
getCookieJarAcceptPolicy ,
setCookieJarAcceptPolicy ,
#if defined(ENABLE_OVERLOADING)
CookieJarReadOnlyPropertyInfo ,
#endif
constructCookieJarReadOnly ,
#if defined(ENABLE_OVERLOADING)
cookieJarReadOnly ,
#endif
getCookieJarReadOnly ,
CookieJarChangedCallback ,
#if defined(ENABLE_OVERLOADING)
CookieJarChangedSignalInfo ,
#endif
afterCookieJarChanged ,
onCookieJarChanged ,
) 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 GI.GLib.Structs.Uri as GLib.Uri
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Soup.Enums as Soup.Enums
import {-# SOURCE #-} qualified GI.Soup.Interfaces.SessionFeature as Soup.SessionFeature
import {-# SOURCE #-} qualified GI.Soup.Structs.Cookie as Soup.Cookie
newtype CookieJar = CookieJar (SP.ManagedPtr CookieJar)
deriving (CookieJar -> CookieJar -> Bool
(CookieJar -> CookieJar -> Bool)
-> (CookieJar -> CookieJar -> Bool) -> Eq CookieJar
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CookieJar -> CookieJar -> Bool
== :: CookieJar -> CookieJar -> Bool
$c/= :: CookieJar -> CookieJar -> Bool
/= :: CookieJar -> CookieJar -> Bool
Eq)
instance SP.ManagedPtrNewtype CookieJar where
toManagedPtr :: CookieJar -> ManagedPtr CookieJar
toManagedPtr (CookieJar ManagedPtr CookieJar
p) = ManagedPtr CookieJar
p
foreign import ccall "soup_cookie_jar_get_type"
c_soup_cookie_jar_get_type :: IO B.Types.GType
instance B.Types.TypedObject CookieJar where
glibType :: IO GType
glibType = IO GType
c_soup_cookie_jar_get_type
instance B.Types.GObject CookieJar
class (SP.GObject o, O.IsDescendantOf CookieJar o) => IsCookieJar o
instance (SP.GObject o, O.IsDescendantOf CookieJar o) => IsCookieJar o
instance O.HasParentTypes CookieJar
type instance O.ParentTypes CookieJar = '[GObject.Object.Object, Soup.SessionFeature.SessionFeature]
toCookieJar :: (MIO.MonadIO m, IsCookieJar o) => o -> m CookieJar
toCookieJar :: forall (m :: * -> *) o.
(MonadIO m, IsCookieJar o) =>
o -> m CookieJar
toCookieJar = IO CookieJar -> m CookieJar
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO CookieJar -> m CookieJar)
-> (o -> IO CookieJar) -> o -> m CookieJar
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr CookieJar -> CookieJar) -> o -> IO CookieJar
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr CookieJar -> CookieJar
CookieJar
instance B.GValue.IsGValue (Maybe CookieJar) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_soup_cookie_jar_get_type
gvalueSet_ :: Ptr GValue -> Maybe CookieJar -> IO ()
gvalueSet_ Ptr GValue
gv Maybe CookieJar
P.Nothing = Ptr GValue -> Ptr CookieJar -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr CookieJar
forall a. Ptr a
FP.nullPtr :: FP.Ptr CookieJar)
gvalueSet_ Ptr GValue
gv (P.Just CookieJar
obj) = CookieJar -> (Ptr CookieJar -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr CookieJar
obj (Ptr GValue -> Ptr CookieJar -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe CookieJar)
gvalueGet_ Ptr GValue
gv = do
Ptr CookieJar
ptr <- Ptr GValue -> IO (Ptr CookieJar)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr CookieJar)
if Ptr CookieJar
ptr Ptr CookieJar -> Ptr CookieJar -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr CookieJar
forall a. Ptr a
FP.nullPtr
then CookieJar -> Maybe CookieJar
forall a. a -> Maybe a
P.Just (CookieJar -> Maybe CookieJar)
-> IO CookieJar -> IO (Maybe CookieJar)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr CookieJar -> CookieJar)
-> Ptr CookieJar -> IO CookieJar
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr CookieJar -> CookieJar
CookieJar Ptr CookieJar
ptr
else Maybe CookieJar -> IO (Maybe CookieJar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe CookieJar
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveCookieJarMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveCookieJarMethod "addCookie" o = CookieJarAddCookieMethodInfo
ResolveCookieJarMethod "addCookieFull" o = CookieJarAddCookieFullMethodInfo
ResolveCookieJarMethod "addCookieWithFirstParty" o = CookieJarAddCookieWithFirstPartyMethodInfo
ResolveCookieJarMethod "allCookies" o = CookieJarAllCookiesMethodInfo
ResolveCookieJarMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveCookieJarMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveCookieJarMethod "deleteCookie" o = CookieJarDeleteCookieMethodInfo
ResolveCookieJarMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveCookieJarMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveCookieJarMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveCookieJarMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveCookieJarMethod "isPersistent" o = CookieJarIsPersistentMethodInfo
ResolveCookieJarMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveCookieJarMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveCookieJarMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveCookieJarMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveCookieJarMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveCookieJarMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveCookieJarMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveCookieJarMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveCookieJarMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveCookieJarMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveCookieJarMethod "getAcceptPolicy" o = CookieJarGetAcceptPolicyMethodInfo
ResolveCookieJarMethod "getCookieList" o = CookieJarGetCookieListMethodInfo
ResolveCookieJarMethod "getCookieListWithSameSiteInfo" o = CookieJarGetCookieListWithSameSiteInfoMethodInfo
ResolveCookieJarMethod "getCookies" o = CookieJarGetCookiesMethodInfo
ResolveCookieJarMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveCookieJarMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveCookieJarMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveCookieJarMethod "setAcceptPolicy" o = CookieJarSetAcceptPolicyMethodInfo
ResolveCookieJarMethod "setCookie" o = CookieJarSetCookieMethodInfo
ResolveCookieJarMethod "setCookieWithFirstParty" o = CookieJarSetCookieWithFirstPartyMethodInfo
ResolveCookieJarMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveCookieJarMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveCookieJarMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveCookieJarMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveCookieJarMethod t CookieJar, O.OverloadedMethod info CookieJar p) => OL.IsLabel t (CookieJar -> 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 ~ ResolveCookieJarMethod t CookieJar, O.OverloadedMethod info CookieJar p, R.HasField t CookieJar p) => R.HasField t CookieJar p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveCookieJarMethod t CookieJar, O.OverloadedMethodInfo info CookieJar) => OL.IsLabel t (O.MethodProxy info CookieJar) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type CookieJarChangedCallback =
Soup.Cookie.Cookie
-> Soup.Cookie.Cookie
-> IO ()
type C_CookieJarChangedCallback =
Ptr CookieJar ->
Ptr Soup.Cookie.Cookie ->
Ptr Soup.Cookie.Cookie ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_CookieJarChangedCallback :: C_CookieJarChangedCallback -> IO (FunPtr C_CookieJarChangedCallback)
wrap_CookieJarChangedCallback ::
GObject a => (a -> CookieJarChangedCallback) ->
C_CookieJarChangedCallback
wrap_CookieJarChangedCallback :: forall a.
GObject a =>
(a -> CookieJarChangedCallback) -> C_CookieJarChangedCallback
wrap_CookieJarChangedCallback a -> CookieJarChangedCallback
gi'cb Ptr CookieJar
gi'selfPtr Ptr Cookie
oldCookie Ptr Cookie
newCookie Ptr ()
_ = do
Ptr Cookie -> (Cookie -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Cookie
oldCookie ((Cookie -> IO ()) -> IO ()) -> (Cookie -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Cookie
oldCookie' -> do
Ptr Cookie -> (Cookie -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Cookie
newCookie ((Cookie -> IO ()) -> IO ()) -> (Cookie -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Cookie
newCookie' -> do
Ptr CookieJar -> (CookieJar -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr CookieJar
gi'selfPtr ((CookieJar -> IO ()) -> IO ()) -> (CookieJar -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \CookieJar
gi'self -> a -> CookieJarChangedCallback
gi'cb (CookieJar -> a
forall a b. Coercible a b => a -> b
Coerce.coerce CookieJar
gi'self) Cookie
oldCookie' Cookie
newCookie'
onCookieJarChanged :: (IsCookieJar a, MonadIO m) => a -> ((?self :: a) => CookieJarChangedCallback) -> m SignalHandlerId
onCookieJarChanged :: forall a (m :: * -> *).
(IsCookieJar a, MonadIO m) =>
a -> ((?self::a) => CookieJarChangedCallback) -> m SignalHandlerId
onCookieJarChanged a
obj (?self::a) => CookieJarChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> CookieJarChangedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => CookieJarChangedCallback
CookieJarChangedCallback
cb
let wrapped' :: C_CookieJarChangedCallback
wrapped' = (a -> CookieJarChangedCallback) -> C_CookieJarChangedCallback
forall a.
GObject a =>
(a -> CookieJarChangedCallback) -> C_CookieJarChangedCallback
wrap_CookieJarChangedCallback a -> CookieJarChangedCallback
wrapped
FunPtr C_CookieJarChangedCallback
wrapped'' <- C_CookieJarChangedCallback
-> IO (FunPtr C_CookieJarChangedCallback)
mk_CookieJarChangedCallback C_CookieJarChangedCallback
wrapped'
a
-> Text
-> FunPtr C_CookieJarChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"changed" FunPtr C_CookieJarChangedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterCookieJarChanged :: (IsCookieJar a, MonadIO m) => a -> ((?self :: a) => CookieJarChangedCallback) -> m SignalHandlerId
afterCookieJarChanged :: forall a (m :: * -> *).
(IsCookieJar a, MonadIO m) =>
a -> ((?self::a) => CookieJarChangedCallback) -> m SignalHandlerId
afterCookieJarChanged a
obj (?self::a) => CookieJarChangedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> CookieJarChangedCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => CookieJarChangedCallback
CookieJarChangedCallback
cb
let wrapped' :: C_CookieJarChangedCallback
wrapped' = (a -> CookieJarChangedCallback) -> C_CookieJarChangedCallback
forall a.
GObject a =>
(a -> CookieJarChangedCallback) -> C_CookieJarChangedCallback
wrap_CookieJarChangedCallback a -> CookieJarChangedCallback
wrapped
FunPtr C_CookieJarChangedCallback
wrapped'' <- C_CookieJarChangedCallback
-> IO (FunPtr C_CookieJarChangedCallback)
mk_CookieJarChangedCallback C_CookieJarChangedCallback
wrapped'
a
-> Text
-> FunPtr C_CookieJarChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"changed" FunPtr C_CookieJarChangedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data CookieJarChangedSignalInfo
instance SignalInfo CookieJarChangedSignalInfo where
type HaskellCallbackType CookieJarChangedSignalInfo = CookieJarChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_CookieJarChangedCallback cb
cb'' <- mk_CookieJarChangedCallback cb'
connectSignalFunPtr obj "changed" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.CookieJar::changed"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-CookieJar.html#g:signal:changed"})
#endif
getCookieJarAcceptPolicy :: (MonadIO m, IsCookieJar o) => o -> m Soup.Enums.CookieJarAcceptPolicy
getCookieJarAcceptPolicy :: forall (m :: * -> *) o.
(MonadIO m, IsCookieJar o) =>
o -> m CookieJarAcceptPolicy
getCookieJarAcceptPolicy o
obj = IO CookieJarAcceptPolicy -> m CookieJarAcceptPolicy
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO CookieJarAcceptPolicy -> m CookieJarAcceptPolicy)
-> IO CookieJarAcceptPolicy -> m CookieJarAcceptPolicy
forall a b. (a -> b) -> a -> b
$ o -> String -> IO CookieJarAcceptPolicy
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj String
"accept-policy"
setCookieJarAcceptPolicy :: (MonadIO m, IsCookieJar o) => o -> Soup.Enums.CookieJarAcceptPolicy -> m ()
setCookieJarAcceptPolicy :: forall (m :: * -> *) o.
(MonadIO m, IsCookieJar o) =>
o -> CookieJarAcceptPolicy -> m ()
setCookieJarAcceptPolicy o
obj CookieJarAcceptPolicy
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 -> CookieJarAcceptPolicy -> IO ()
forall a b.
(GObject a, Enum b, BoxedEnum b) =>
a -> String -> b -> IO ()
B.Properties.setObjectPropertyEnum o
obj String
"accept-policy" CookieJarAcceptPolicy
val
constructCookieJarAcceptPolicy :: (IsCookieJar o, MIO.MonadIO m) => Soup.Enums.CookieJarAcceptPolicy -> m (GValueConstruct o)
constructCookieJarAcceptPolicy :: forall o (m :: * -> *).
(IsCookieJar o, MonadIO m) =>
CookieJarAcceptPolicy -> m (GValueConstruct o)
constructCookieJarAcceptPolicy CookieJarAcceptPolicy
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 -> CookieJarAcceptPolicy -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum String
"accept-policy" CookieJarAcceptPolicy
val
#if defined(ENABLE_OVERLOADING)
data CookieJarAcceptPolicyPropertyInfo
instance AttrInfo CookieJarAcceptPolicyPropertyInfo where
type AttrAllowedOps CookieJarAcceptPolicyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint CookieJarAcceptPolicyPropertyInfo = IsCookieJar
type AttrSetTypeConstraint CookieJarAcceptPolicyPropertyInfo = (~) Soup.Enums.CookieJarAcceptPolicy
type AttrTransferTypeConstraint CookieJarAcceptPolicyPropertyInfo = (~) Soup.Enums.CookieJarAcceptPolicy
type AttrTransferType CookieJarAcceptPolicyPropertyInfo = Soup.Enums.CookieJarAcceptPolicy
type AttrGetType CookieJarAcceptPolicyPropertyInfo = Soup.Enums.CookieJarAcceptPolicy
type AttrLabel CookieJarAcceptPolicyPropertyInfo = "accept-policy"
type AttrOrigin CookieJarAcceptPolicyPropertyInfo = CookieJar
attrGet = getCookieJarAcceptPolicy
attrSet = setCookieJarAcceptPolicy
attrTransfer _ v = do
return v
attrConstruct = constructCookieJarAcceptPolicy
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.CookieJar.acceptPolicy"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-CookieJar.html#g:attr:acceptPolicy"
})
#endif
getCookieJarReadOnly :: (MonadIO m, IsCookieJar o) => o -> m Bool
getCookieJarReadOnly :: forall (m :: * -> *) o. (MonadIO m, IsCookieJar o) => o -> m Bool
getCookieJarReadOnly o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"read-only"
constructCookieJarReadOnly :: (IsCookieJar o, MIO.MonadIO m) => Bool -> m (GValueConstruct o)
constructCookieJarReadOnly :: forall o (m :: * -> *).
(IsCookieJar o, MonadIO m) =>
Bool -> m (GValueConstruct o)
constructCookieJarReadOnly Bool
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 -> Bool -> IO (GValueConstruct o)
forall o. String -> Bool -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyBool String
"read-only" Bool
val
#if defined(ENABLE_OVERLOADING)
data CookieJarReadOnlyPropertyInfo
instance AttrInfo CookieJarReadOnlyPropertyInfo where
type AttrAllowedOps CookieJarReadOnlyPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrBaseTypeConstraint CookieJarReadOnlyPropertyInfo = IsCookieJar
type AttrSetTypeConstraint CookieJarReadOnlyPropertyInfo = (~) Bool
type AttrTransferTypeConstraint CookieJarReadOnlyPropertyInfo = (~) Bool
type AttrTransferType CookieJarReadOnlyPropertyInfo = Bool
type AttrGetType CookieJarReadOnlyPropertyInfo = Bool
type AttrLabel CookieJarReadOnlyPropertyInfo = "read-only"
type AttrOrigin CookieJarReadOnlyPropertyInfo = CookieJar
attrGet = getCookieJarReadOnly
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructCookieJarReadOnly
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.CookieJar.readOnly"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-CookieJar.html#g:attr:readOnly"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList CookieJar
type instance O.AttributeList CookieJar = CookieJarAttributeList
type CookieJarAttributeList = ('[ '("acceptPolicy", CookieJarAcceptPolicyPropertyInfo), '("readOnly", CookieJarReadOnlyPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
cookieJarAcceptPolicy :: AttrLabelProxy "acceptPolicy"
cookieJarAcceptPolicy = AttrLabelProxy
cookieJarReadOnly :: AttrLabelProxy "readOnly"
cookieJarReadOnly = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList CookieJar = CookieJarSignalList
type CookieJarSignalList = ('[ '("changed", CookieJarChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "soup_cookie_jar_new" soup_cookie_jar_new ::
IO (Ptr CookieJar)
cookieJarNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m CookieJar
cookieJarNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m CookieJar
cookieJarNew = IO CookieJar -> m CookieJar
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CookieJar -> m CookieJar) -> IO CookieJar -> m CookieJar
forall a b. (a -> b) -> a -> b
$ do
Ptr CookieJar
result <- IO (Ptr CookieJar)
soup_cookie_jar_new
Text -> Ptr CookieJar -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"cookieJarNew" Ptr CookieJar
result
CookieJar
result' <- ((ManagedPtr CookieJar -> CookieJar)
-> Ptr CookieJar -> IO CookieJar
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr CookieJar -> CookieJar
CookieJar) Ptr CookieJar
result
CookieJar -> IO CookieJar
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CookieJar
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "soup_cookie_jar_add_cookie" soup_cookie_jar_add_cookie ::
Ptr CookieJar ->
Ptr Soup.Cookie.Cookie ->
IO ()
cookieJarAddCookie ::
(B.CallStack.HasCallStack, MonadIO m, IsCookieJar a) =>
a
-> Soup.Cookie.Cookie
-> m ()
cookieJarAddCookie :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCookieJar a) =>
a -> Cookie -> m ()
cookieJarAddCookie a
jar Cookie
cookie = 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
$ do
Ptr CookieJar
jar' <- a -> IO (Ptr CookieJar)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jar
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Cookie
cookie
Ptr CookieJar -> Ptr Cookie -> IO ()
soup_cookie_jar_add_cookie Ptr CookieJar
jar' Ptr Cookie
cookie'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
jar
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieJarAddCookieMethodInfo
instance (signature ~ (Soup.Cookie.Cookie -> m ()), MonadIO m, IsCookieJar a) => O.OverloadedMethod CookieJarAddCookieMethodInfo a signature where
overloadedMethod = cookieJarAddCookie
instance O.OverloadedMethodInfo CookieJarAddCookieMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.CookieJar.cookieJarAddCookie",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-CookieJar.html#v:cookieJarAddCookie"
})
#endif
foreign import ccall "soup_cookie_jar_add_cookie_full" soup_cookie_jar_add_cookie_full ::
Ptr CookieJar ->
Ptr Soup.Cookie.Cookie ->
Ptr GLib.Uri.Uri ->
Ptr GLib.Uri.Uri ->
IO ()
cookieJarAddCookieFull ::
(B.CallStack.HasCallStack, MonadIO m, IsCookieJar a) =>
a
-> Soup.Cookie.Cookie
-> Maybe (GLib.Uri.Uri)
-> Maybe (GLib.Uri.Uri)
-> m ()
cookieJarAddCookieFull :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCookieJar a) =>
a -> Cookie -> Maybe Uri -> Maybe Uri -> m ()
cookieJarAddCookieFull a
jar Cookie
cookie Maybe Uri
uri Maybe Uri
firstParty = 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
$ do
Ptr CookieJar
jar' <- a -> IO (Ptr CookieJar)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jar
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Cookie
cookie
Ptr Uri
maybeUri <- case Maybe Uri
uri of
Maybe Uri
Nothing -> Ptr Uri -> IO (Ptr Uri)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Uri
forall a. Ptr a
nullPtr
Just Uri
jUri -> do
Ptr Uri
jUri' <- Uri -> IO (Ptr Uri)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Uri
jUri
Ptr Uri -> IO (Ptr Uri)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Uri
jUri'
Ptr Uri
maybeFirstParty <- case Maybe Uri
firstParty of
Maybe Uri
Nothing -> Ptr Uri -> IO (Ptr Uri)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Uri
forall a. Ptr a
nullPtr
Just Uri
jFirstParty -> do
Ptr Uri
jFirstParty' <- Uri -> IO (Ptr Uri)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Uri
jFirstParty
Ptr Uri -> IO (Ptr Uri)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Uri
jFirstParty'
Ptr CookieJar -> Ptr Cookie -> Ptr Uri -> Ptr Uri -> IO ()
soup_cookie_jar_add_cookie_full Ptr CookieJar
jar' Ptr Cookie
cookie' Ptr Uri
maybeUri Ptr Uri
maybeFirstParty
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
jar
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
Maybe Uri -> (Uri -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Uri
uri Uri -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe Uri -> (Uri -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Uri
firstParty Uri -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieJarAddCookieFullMethodInfo
instance (signature ~ (Soup.Cookie.Cookie -> Maybe (GLib.Uri.Uri) -> Maybe (GLib.Uri.Uri) -> m ()), MonadIO m, IsCookieJar a) => O.OverloadedMethod CookieJarAddCookieFullMethodInfo a signature where
overloadedMethod = cookieJarAddCookieFull
instance O.OverloadedMethodInfo CookieJarAddCookieFullMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.CookieJar.cookieJarAddCookieFull",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-CookieJar.html#v:cookieJarAddCookieFull"
})
#endif
foreign import ccall "soup_cookie_jar_add_cookie_with_first_party" soup_cookie_jar_add_cookie_with_first_party ::
Ptr CookieJar ->
Ptr GLib.Uri.Uri ->
Ptr Soup.Cookie.Cookie ->
IO ()
cookieJarAddCookieWithFirstParty ::
(B.CallStack.HasCallStack, MonadIO m, IsCookieJar a) =>
a
-> GLib.Uri.Uri
-> Soup.Cookie.Cookie
-> m ()
cookieJarAddCookieWithFirstParty :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCookieJar a) =>
a -> Uri -> Cookie -> m ()
cookieJarAddCookieWithFirstParty a
jar Uri
firstParty Cookie
cookie = 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
$ do
Ptr CookieJar
jar' <- a -> IO (Ptr CookieJar)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jar
Ptr Uri
firstParty' <- Uri -> IO (Ptr Uri)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Uri
firstParty
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Cookie
cookie
Ptr CookieJar -> Ptr Uri -> Ptr Cookie -> IO ()
soup_cookie_jar_add_cookie_with_first_party Ptr CookieJar
jar' Ptr Uri
firstParty' Ptr Cookie
cookie'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
jar
Uri -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Uri
firstParty
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieJarAddCookieWithFirstPartyMethodInfo
instance (signature ~ (GLib.Uri.Uri -> Soup.Cookie.Cookie -> m ()), MonadIO m, IsCookieJar a) => O.OverloadedMethod CookieJarAddCookieWithFirstPartyMethodInfo a signature where
overloadedMethod = cookieJarAddCookieWithFirstParty
instance O.OverloadedMethodInfo CookieJarAddCookieWithFirstPartyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.CookieJar.cookieJarAddCookieWithFirstParty",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-CookieJar.html#v:cookieJarAddCookieWithFirstParty"
})
#endif
foreign import ccall "soup_cookie_jar_all_cookies" soup_cookie_jar_all_cookies ::
Ptr CookieJar ->
IO (Ptr (GSList (Ptr Soup.Cookie.Cookie)))
cookieJarAllCookies ::
(B.CallStack.HasCallStack, MonadIO m, IsCookieJar a) =>
a
-> m [Soup.Cookie.Cookie]
cookieJarAllCookies :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCookieJar a) =>
a -> m [Cookie]
cookieJarAllCookies a
jar = IO [Cookie] -> m [Cookie]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Cookie] -> m [Cookie]) -> IO [Cookie] -> m [Cookie]
forall a b. (a -> b) -> a -> b
$ do
Ptr CookieJar
jar' <- a -> IO (Ptr CookieJar)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jar
Ptr (GSList (Ptr Cookie))
result <- Ptr CookieJar -> IO (Ptr (GSList (Ptr Cookie)))
soup_cookie_jar_all_cookies Ptr CookieJar
jar'
[Ptr Cookie]
result' <- Ptr (GSList (Ptr Cookie)) -> IO [Ptr Cookie]
forall a. Ptr (GSList (Ptr a)) -> IO [Ptr a]
unpackGSList Ptr (GSList (Ptr Cookie))
result
[Cookie]
result'' <- (Ptr Cookie -> IO Cookie) -> [Ptr Cookie] -> IO [Cookie]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM ((ManagedPtr Cookie -> Cookie) -> Ptr Cookie -> IO Cookie
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Cookie -> Cookie
Soup.Cookie.Cookie) [Ptr Cookie]
result'
Ptr (GSList (Ptr Cookie)) -> IO ()
forall a. Ptr (GSList a) -> IO ()
g_slist_free Ptr (GSList (Ptr Cookie))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
jar
[Cookie] -> IO [Cookie]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [Cookie]
result''
#if defined(ENABLE_OVERLOADING)
data CookieJarAllCookiesMethodInfo
instance (signature ~ (m [Soup.Cookie.Cookie]), MonadIO m, IsCookieJar a) => O.OverloadedMethod CookieJarAllCookiesMethodInfo a signature where
overloadedMethod = cookieJarAllCookies
instance O.OverloadedMethodInfo CookieJarAllCookiesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.CookieJar.cookieJarAllCookies",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-CookieJar.html#v:cookieJarAllCookies"
})
#endif
foreign import ccall "soup_cookie_jar_delete_cookie" soup_cookie_jar_delete_cookie ::
Ptr CookieJar ->
Ptr Soup.Cookie.Cookie ->
IO ()
cookieJarDeleteCookie ::
(B.CallStack.HasCallStack, MonadIO m, IsCookieJar a) =>
a
-> Soup.Cookie.Cookie
-> m ()
cookieJarDeleteCookie :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCookieJar a) =>
a -> Cookie -> m ()
cookieJarDeleteCookie a
jar Cookie
cookie = 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
$ do
Ptr CookieJar
jar' <- a -> IO (Ptr CookieJar)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jar
Ptr Cookie
cookie' <- Cookie -> IO (Ptr Cookie)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Cookie
cookie
Ptr CookieJar -> Ptr Cookie -> IO ()
soup_cookie_jar_delete_cookie Ptr CookieJar
jar' Ptr Cookie
cookie'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
jar
Cookie -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Cookie
cookie
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieJarDeleteCookieMethodInfo
instance (signature ~ (Soup.Cookie.Cookie -> m ()), MonadIO m, IsCookieJar a) => O.OverloadedMethod CookieJarDeleteCookieMethodInfo a signature where
overloadedMethod = cookieJarDeleteCookie
instance O.OverloadedMethodInfo CookieJarDeleteCookieMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.CookieJar.cookieJarDeleteCookie",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-CookieJar.html#v:cookieJarDeleteCookie"
})
#endif
foreign import ccall "soup_cookie_jar_get_accept_policy" soup_cookie_jar_get_accept_policy ::
Ptr CookieJar ->
IO CUInt
cookieJarGetAcceptPolicy ::
(B.CallStack.HasCallStack, MonadIO m, IsCookieJar a) =>
a
-> m Soup.Enums.CookieJarAcceptPolicy
cookieJarGetAcceptPolicy :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCookieJar a) =>
a -> m CookieJarAcceptPolicy
cookieJarGetAcceptPolicy a
jar = IO CookieJarAcceptPolicy -> m CookieJarAcceptPolicy
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CookieJarAcceptPolicy -> m CookieJarAcceptPolicy)
-> IO CookieJarAcceptPolicy -> m CookieJarAcceptPolicy
forall a b. (a -> b) -> a -> b
$ do
Ptr CookieJar
jar' <- a -> IO (Ptr CookieJar)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jar
CUInt
result <- Ptr CookieJar -> IO CUInt
soup_cookie_jar_get_accept_policy Ptr CookieJar
jar'
let result' :: CookieJarAcceptPolicy
result' = (Int -> CookieJarAcceptPolicy
forall a. Enum a => Int -> a
toEnum (Int -> CookieJarAcceptPolicy)
-> (CUInt -> Int) -> CUInt -> CookieJarAcceptPolicy
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
jar
CookieJarAcceptPolicy -> IO CookieJarAcceptPolicy
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CookieJarAcceptPolicy
result'
#if defined(ENABLE_OVERLOADING)
data CookieJarGetAcceptPolicyMethodInfo
instance (signature ~ (m Soup.Enums.CookieJarAcceptPolicy), MonadIO m, IsCookieJar a) => O.OverloadedMethod CookieJarGetAcceptPolicyMethodInfo a signature where
overloadedMethod = cookieJarGetAcceptPolicy
instance O.OverloadedMethodInfo CookieJarGetAcceptPolicyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.CookieJar.cookieJarGetAcceptPolicy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-CookieJar.html#v:cookieJarGetAcceptPolicy"
})
#endif
foreign import ccall "soup_cookie_jar_get_cookie_list" soup_cookie_jar_get_cookie_list ::
Ptr CookieJar ->
Ptr GLib.Uri.Uri ->
CInt ->
IO (Ptr (GSList (Ptr Soup.Cookie.Cookie)))
cookieJarGetCookieList ::
(B.CallStack.HasCallStack, MonadIO m, IsCookieJar a) =>
a
-> GLib.Uri.Uri
-> Bool
-> m [Soup.Cookie.Cookie]
cookieJarGetCookieList :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCookieJar a) =>
a -> Uri -> Bool -> m [Cookie]
cookieJarGetCookieList a
jar Uri
uri Bool
forHttp = IO [Cookie] -> m [Cookie]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Cookie] -> m [Cookie]) -> IO [Cookie] -> m [Cookie]
forall a b. (a -> b) -> a -> b
$ do
Ptr CookieJar
jar' <- a -> IO (Ptr CookieJar)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jar
Ptr Uri
uri' <- Uri -> IO (Ptr Uri)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Uri
uri
let forHttp' :: CInt
forHttp' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
forHttp
Ptr (GSList (Ptr Cookie))
result <- Ptr CookieJar -> Ptr Uri -> CInt -> IO (Ptr (GSList (Ptr Cookie)))
soup_cookie_jar_get_cookie_list Ptr CookieJar
jar' Ptr Uri
uri' CInt
forHttp'
[Ptr Cookie]
result' <- Ptr (GSList (Ptr Cookie)) -> IO [Ptr Cookie]
forall a. Ptr (GSList (Ptr a)) -> IO [Ptr a]
unpackGSList Ptr (GSList (Ptr Cookie))
result
[Cookie]
result'' <- (Ptr Cookie -> IO Cookie) -> [Ptr Cookie] -> IO [Cookie]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM ((ManagedPtr Cookie -> Cookie) -> Ptr Cookie -> IO Cookie
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Cookie -> Cookie
Soup.Cookie.Cookie) [Ptr Cookie]
result'
Ptr (GSList (Ptr Cookie)) -> IO ()
forall a. Ptr (GSList a) -> IO ()
g_slist_free Ptr (GSList (Ptr Cookie))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
jar
Uri -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Uri
uri
[Cookie] -> IO [Cookie]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [Cookie]
result''
#if defined(ENABLE_OVERLOADING)
data CookieJarGetCookieListMethodInfo
instance (signature ~ (GLib.Uri.Uri -> Bool -> m [Soup.Cookie.Cookie]), MonadIO m, IsCookieJar a) => O.OverloadedMethod CookieJarGetCookieListMethodInfo a signature where
overloadedMethod = cookieJarGetCookieList
instance O.OverloadedMethodInfo CookieJarGetCookieListMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.CookieJar.cookieJarGetCookieList",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-CookieJar.html#v:cookieJarGetCookieList"
})
#endif
foreign import ccall "soup_cookie_jar_get_cookie_list_with_same_site_info" soup_cookie_jar_get_cookie_list_with_same_site_info ::
Ptr CookieJar ->
Ptr GLib.Uri.Uri ->
Ptr GLib.Uri.Uri ->
Ptr GLib.Uri.Uri ->
CInt ->
CInt ->
CInt ->
IO (Ptr (GSList (Ptr Soup.Cookie.Cookie)))
cookieJarGetCookieListWithSameSiteInfo ::
(B.CallStack.HasCallStack, MonadIO m, IsCookieJar a) =>
a
-> GLib.Uri.Uri
-> Maybe (GLib.Uri.Uri)
-> Maybe (GLib.Uri.Uri)
-> Bool
-> Bool
-> Bool
-> m [Soup.Cookie.Cookie]
cookieJarGetCookieListWithSameSiteInfo :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCookieJar a) =>
a
-> Uri
-> Maybe Uri
-> Maybe Uri
-> Bool
-> Bool
-> Bool
-> m [Cookie]
cookieJarGetCookieListWithSameSiteInfo a
jar Uri
uri Maybe Uri
topLevel Maybe Uri
siteForCookies Bool
forHttp Bool
isSafeMethod Bool
isTopLevelNavigation = IO [Cookie] -> m [Cookie]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Cookie] -> m [Cookie]) -> IO [Cookie] -> m [Cookie]
forall a b. (a -> b) -> a -> b
$ do
Ptr CookieJar
jar' <- a -> IO (Ptr CookieJar)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jar
Ptr Uri
uri' <- Uri -> IO (Ptr Uri)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Uri
uri
Ptr Uri
maybeTopLevel <- case Maybe Uri
topLevel of
Maybe Uri
Nothing -> Ptr Uri -> IO (Ptr Uri)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Uri
forall a. Ptr a
nullPtr
Just Uri
jTopLevel -> do
Ptr Uri
jTopLevel' <- Uri -> IO (Ptr Uri)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Uri
jTopLevel
Ptr Uri -> IO (Ptr Uri)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Uri
jTopLevel'
Ptr Uri
maybeSiteForCookies <- case Maybe Uri
siteForCookies of
Maybe Uri
Nothing -> Ptr Uri -> IO (Ptr Uri)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Uri
forall a. Ptr a
nullPtr
Just Uri
jSiteForCookies -> do
Ptr Uri
jSiteForCookies' <- Uri -> IO (Ptr Uri)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Uri
jSiteForCookies
Ptr Uri -> IO (Ptr Uri)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Uri
jSiteForCookies'
let forHttp' :: CInt
forHttp' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
forHttp
let isSafeMethod' :: CInt
isSafeMethod' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
isSafeMethod
let isTopLevelNavigation' :: CInt
isTopLevelNavigation' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
isTopLevelNavigation
Ptr (GSList (Ptr Cookie))
result <- Ptr CookieJar
-> Ptr Uri
-> Ptr Uri
-> Ptr Uri
-> CInt
-> CInt
-> CInt
-> IO (Ptr (GSList (Ptr Cookie)))
soup_cookie_jar_get_cookie_list_with_same_site_info Ptr CookieJar
jar' Ptr Uri
uri' Ptr Uri
maybeTopLevel Ptr Uri
maybeSiteForCookies CInt
forHttp' CInt
isSafeMethod' CInt
isTopLevelNavigation'
[Ptr Cookie]
result' <- Ptr (GSList (Ptr Cookie)) -> IO [Ptr Cookie]
forall a. Ptr (GSList (Ptr a)) -> IO [Ptr a]
unpackGSList Ptr (GSList (Ptr Cookie))
result
[Cookie]
result'' <- (Ptr Cookie -> IO Cookie) -> [Ptr Cookie] -> IO [Cookie]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM ((ManagedPtr Cookie -> Cookie) -> Ptr Cookie -> IO Cookie
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Cookie -> Cookie
Soup.Cookie.Cookie) [Ptr Cookie]
result'
Ptr (GSList (Ptr Cookie)) -> IO ()
forall a. Ptr (GSList a) -> IO ()
g_slist_free Ptr (GSList (Ptr Cookie))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
jar
Uri -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Uri
uri
Maybe Uri -> (Uri -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Uri
topLevel Uri -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe Uri -> (Uri -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Uri
siteForCookies Uri -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
[Cookie] -> IO [Cookie]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [Cookie]
result''
#if defined(ENABLE_OVERLOADING)
data CookieJarGetCookieListWithSameSiteInfoMethodInfo
instance (signature ~ (GLib.Uri.Uri -> Maybe (GLib.Uri.Uri) -> Maybe (GLib.Uri.Uri) -> Bool -> Bool -> Bool -> m [Soup.Cookie.Cookie]), MonadIO m, IsCookieJar a) => O.OverloadedMethod CookieJarGetCookieListWithSameSiteInfoMethodInfo a signature where
overloadedMethod = cookieJarGetCookieListWithSameSiteInfo
instance O.OverloadedMethodInfo CookieJarGetCookieListWithSameSiteInfoMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.CookieJar.cookieJarGetCookieListWithSameSiteInfo",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-CookieJar.html#v:cookieJarGetCookieListWithSameSiteInfo"
})
#endif
foreign import ccall "soup_cookie_jar_get_cookies" soup_cookie_jar_get_cookies ::
Ptr CookieJar ->
Ptr GLib.Uri.Uri ->
CInt ->
IO CString
cookieJarGetCookies ::
(B.CallStack.HasCallStack, MonadIO m, IsCookieJar a) =>
a
-> GLib.Uri.Uri
-> Bool
-> m (Maybe T.Text)
cookieJarGetCookies :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCookieJar a) =>
a -> Uri -> Bool -> m (Maybe Text)
cookieJarGetCookies a
jar Uri
uri Bool
forHttp = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr CookieJar
jar' <- a -> IO (Ptr CookieJar)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jar
Ptr Uri
uri' <- Uri -> IO (Ptr Uri)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Uri
uri
let forHttp' :: CInt
forHttp' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
forHttp
CString
result <- Ptr CookieJar -> Ptr Uri -> CInt -> IO CString
soup_cookie_jar_get_cookies Ptr CookieJar
jar' Ptr Uri
uri' CInt
forHttp'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
jar
Uri -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Uri
uri
Maybe Text -> IO (Maybe Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data CookieJarGetCookiesMethodInfo
instance (signature ~ (GLib.Uri.Uri -> Bool -> m (Maybe T.Text)), MonadIO m, IsCookieJar a) => O.OverloadedMethod CookieJarGetCookiesMethodInfo a signature where
overloadedMethod = cookieJarGetCookies
instance O.OverloadedMethodInfo CookieJarGetCookiesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.CookieJar.cookieJarGetCookies",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-CookieJar.html#v:cookieJarGetCookies"
})
#endif
foreign import ccall "soup_cookie_jar_is_persistent" soup_cookie_jar_is_persistent ::
Ptr CookieJar ->
IO CInt
cookieJarIsPersistent ::
(B.CallStack.HasCallStack, MonadIO m, IsCookieJar a) =>
a
-> m Bool
cookieJarIsPersistent :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCookieJar a) =>
a -> m Bool
cookieJarIsPersistent a
jar = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr CookieJar
jar' <- a -> IO (Ptr CookieJar)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jar
CInt
result <- Ptr CookieJar -> IO CInt
soup_cookie_jar_is_persistent Ptr CookieJar
jar'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
jar
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data CookieJarIsPersistentMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsCookieJar a) => O.OverloadedMethod CookieJarIsPersistentMethodInfo a signature where
overloadedMethod = cookieJarIsPersistent
instance O.OverloadedMethodInfo CookieJarIsPersistentMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.CookieJar.cookieJarIsPersistent",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-CookieJar.html#v:cookieJarIsPersistent"
})
#endif
foreign import ccall "soup_cookie_jar_set_accept_policy" soup_cookie_jar_set_accept_policy ::
Ptr CookieJar ->
CUInt ->
IO ()
cookieJarSetAcceptPolicy ::
(B.CallStack.HasCallStack, MonadIO m, IsCookieJar a) =>
a
-> Soup.Enums.CookieJarAcceptPolicy
-> m ()
cookieJarSetAcceptPolicy :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCookieJar a) =>
a -> CookieJarAcceptPolicy -> m ()
cookieJarSetAcceptPolicy a
jar CookieJarAcceptPolicy
policy = 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
$ do
Ptr CookieJar
jar' <- a -> IO (Ptr CookieJar)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jar
let policy' :: CUInt
policy' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (CookieJarAcceptPolicy -> Int) -> CookieJarAcceptPolicy -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CookieJarAcceptPolicy -> Int
forall a. Enum a => a -> Int
fromEnum) CookieJarAcceptPolicy
policy
Ptr CookieJar -> CUInt -> IO ()
soup_cookie_jar_set_accept_policy Ptr CookieJar
jar' CUInt
policy'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
jar
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieJarSetAcceptPolicyMethodInfo
instance (signature ~ (Soup.Enums.CookieJarAcceptPolicy -> m ()), MonadIO m, IsCookieJar a) => O.OverloadedMethod CookieJarSetAcceptPolicyMethodInfo a signature where
overloadedMethod = cookieJarSetAcceptPolicy
instance O.OverloadedMethodInfo CookieJarSetAcceptPolicyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.CookieJar.cookieJarSetAcceptPolicy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-CookieJar.html#v:cookieJarSetAcceptPolicy"
})
#endif
foreign import ccall "soup_cookie_jar_set_cookie" soup_cookie_jar_set_cookie ::
Ptr CookieJar ->
Ptr GLib.Uri.Uri ->
CString ->
IO ()
cookieJarSetCookie ::
(B.CallStack.HasCallStack, MonadIO m, IsCookieJar a) =>
a
-> GLib.Uri.Uri
-> T.Text
-> m ()
cookieJarSetCookie :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCookieJar a) =>
a -> Uri -> Text -> m ()
cookieJarSetCookie a
jar Uri
uri Text
cookie = 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
$ do
Ptr CookieJar
jar' <- a -> IO (Ptr CookieJar)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jar
Ptr Uri
uri' <- Uri -> IO (Ptr Uri)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Uri
uri
CString
cookie' <- Text -> IO CString
textToCString Text
cookie
Ptr CookieJar -> Ptr Uri -> CString -> IO ()
soup_cookie_jar_set_cookie Ptr CookieJar
jar' Ptr Uri
uri' CString
cookie'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
jar
Uri -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Uri
uri
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
cookie'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieJarSetCookieMethodInfo
instance (signature ~ (GLib.Uri.Uri -> T.Text -> m ()), MonadIO m, IsCookieJar a) => O.OverloadedMethod CookieJarSetCookieMethodInfo a signature where
overloadedMethod = cookieJarSetCookie
instance O.OverloadedMethodInfo CookieJarSetCookieMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.CookieJar.cookieJarSetCookie",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-CookieJar.html#v:cookieJarSetCookie"
})
#endif
foreign import ccall "soup_cookie_jar_set_cookie_with_first_party" soup_cookie_jar_set_cookie_with_first_party ::
Ptr CookieJar ->
Ptr GLib.Uri.Uri ->
Ptr GLib.Uri.Uri ->
CString ->
IO ()
cookieJarSetCookieWithFirstParty ::
(B.CallStack.HasCallStack, MonadIO m, IsCookieJar a) =>
a
-> GLib.Uri.Uri
-> GLib.Uri.Uri
-> T.Text
-> m ()
cookieJarSetCookieWithFirstParty :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCookieJar a) =>
a -> Uri -> Uri -> Text -> m ()
cookieJarSetCookieWithFirstParty a
jar Uri
uri Uri
firstParty Text
cookie = 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
$ do
Ptr CookieJar
jar' <- a -> IO (Ptr CookieJar)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jar
Ptr Uri
uri' <- Uri -> IO (Ptr Uri)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Uri
uri
Ptr Uri
firstParty' <- Uri -> IO (Ptr Uri)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Uri
firstParty
CString
cookie' <- Text -> IO CString
textToCString Text
cookie
Ptr CookieJar -> Ptr Uri -> Ptr Uri -> CString -> IO ()
soup_cookie_jar_set_cookie_with_first_party Ptr CookieJar
jar' Ptr Uri
uri' Ptr Uri
firstParty' CString
cookie'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
jar
Uri -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Uri
uri
Uri -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Uri
firstParty
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
cookie'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data CookieJarSetCookieWithFirstPartyMethodInfo
instance (signature ~ (GLib.Uri.Uri -> GLib.Uri.Uri -> T.Text -> m ()), MonadIO m, IsCookieJar a) => O.OverloadedMethod CookieJarSetCookieWithFirstPartyMethodInfo a signature where
overloadedMethod = cookieJarSetCookieWithFirstParty
instance O.OverloadedMethodInfo CookieJarSetCookieWithFirstPartyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Soup.Objects.CookieJar.cookieJarSetCookieWithFirstParty",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-3.0.2/docs/GI-Soup-Objects-CookieJar.html#v:cookieJarSetCookieWithFirstParty"
})
#endif