{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Soup.Objects.CookieJarText
(
CookieJarText(..) ,
IsCookieJarText ,
toCookieJarText ,
#if defined(ENABLE_OVERLOADING)
ResolveCookieJarTextMethod ,
#endif
cookieJarTextNew ,
#if defined(ENABLE_OVERLOADING)
CookieJarTextFilenamePropertyInfo ,
#endif
constructCookieJarTextFilename ,
#if defined(ENABLE_OVERLOADING)
cookieJarTextFilename ,
#endif
getCookieJarTextFilename ,
) 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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
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.Text as T
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 GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Soup.Interfaces.SessionFeature as Soup.SessionFeature
import {-# SOURCE #-} qualified GI.Soup.Objects.CookieJar as Soup.CookieJar
newtype CookieJarText = CookieJarText (SP.ManagedPtr CookieJarText)
deriving (CookieJarText -> CookieJarText -> Bool
(CookieJarText -> CookieJarText -> Bool)
-> (CookieJarText -> CookieJarText -> Bool) -> Eq CookieJarText
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CookieJarText -> CookieJarText -> Bool
$c/= :: CookieJarText -> CookieJarText -> Bool
== :: CookieJarText -> CookieJarText -> Bool
$c== :: CookieJarText -> CookieJarText -> Bool
Eq)
instance SP.ManagedPtrNewtype CookieJarText where
toManagedPtr :: CookieJarText -> ManagedPtr CookieJarText
toManagedPtr (CookieJarText ManagedPtr CookieJarText
p) = ManagedPtr CookieJarText
p
foreign import ccall "soup_cookie_jar_text_get_type"
c_soup_cookie_jar_text_get_type :: IO B.Types.GType
instance B.Types.TypedObject CookieJarText where
glibType :: IO GType
glibType = IO GType
c_soup_cookie_jar_text_get_type
instance B.Types.GObject CookieJarText
instance B.GValue.IsGValue CookieJarText where
toGValue :: CookieJarText -> IO GValue
toGValue CookieJarText
o = do
GType
gtype <- IO GType
c_soup_cookie_jar_text_get_type
CookieJarText -> (Ptr CookieJarText -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr CookieJarText
o (GType
-> (GValue -> Ptr CookieJarText -> IO ())
-> Ptr CookieJarText
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr CookieJarText -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO CookieJarText
fromGValue GValue
gv = do
Ptr CookieJarText
ptr <- GValue -> IO (Ptr CookieJarText)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr CookieJarText)
(ManagedPtr CookieJarText -> CookieJarText)
-> Ptr CookieJarText -> IO CookieJarText
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr CookieJarText -> CookieJarText
CookieJarText Ptr CookieJarText
ptr
class (SP.GObject o, O.IsDescendantOf CookieJarText o) => IsCookieJarText o
instance (SP.GObject o, O.IsDescendantOf CookieJarText o) => IsCookieJarText o
instance O.HasParentTypes CookieJarText
type instance O.ParentTypes CookieJarText = '[Soup.CookieJar.CookieJar, GObject.Object.Object, Soup.SessionFeature.SessionFeature]
toCookieJarText :: (MonadIO m, IsCookieJarText o) => o -> m CookieJarText
toCookieJarText :: o -> m CookieJarText
toCookieJarText = IO CookieJarText -> m CookieJarText
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CookieJarText -> m CookieJarText)
-> (o -> IO CookieJarText) -> o -> m CookieJarText
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr CookieJarText -> CookieJarText)
-> o -> IO CookieJarText
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr CookieJarText -> CookieJarText
CookieJarText
#if defined(ENABLE_OVERLOADING)
type family ResolveCookieJarTextMethod (t :: Symbol) (o :: *) :: * where
ResolveCookieJarTextMethod "addCookie" o = Soup.CookieJar.CookieJarAddCookieMethodInfo
ResolveCookieJarTextMethod "addCookieFull" o = Soup.CookieJar.CookieJarAddCookieFullMethodInfo
ResolveCookieJarTextMethod "addCookieWithFirstParty" o = Soup.CookieJar.CookieJarAddCookieWithFirstPartyMethodInfo
ResolveCookieJarTextMethod "addFeature" o = Soup.SessionFeature.SessionFeatureAddFeatureMethodInfo
ResolveCookieJarTextMethod "allCookies" o = Soup.CookieJar.CookieJarAllCookiesMethodInfo
ResolveCookieJarTextMethod "attach" o = Soup.SessionFeature.SessionFeatureAttachMethodInfo
ResolveCookieJarTextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveCookieJarTextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveCookieJarTextMethod "deleteCookie" o = Soup.CookieJar.CookieJarDeleteCookieMethodInfo
ResolveCookieJarTextMethod "detach" o = Soup.SessionFeature.SessionFeatureDetachMethodInfo
ResolveCookieJarTextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveCookieJarTextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveCookieJarTextMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveCookieJarTextMethod "hasFeature" o = Soup.SessionFeature.SessionFeatureHasFeatureMethodInfo
ResolveCookieJarTextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveCookieJarTextMethod "isPersistent" o = Soup.CookieJar.CookieJarIsPersistentMethodInfo
ResolveCookieJarTextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveCookieJarTextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveCookieJarTextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveCookieJarTextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveCookieJarTextMethod "removeFeature" o = Soup.SessionFeature.SessionFeatureRemoveFeatureMethodInfo
ResolveCookieJarTextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveCookieJarTextMethod "save" o = Soup.CookieJar.CookieJarSaveMethodInfo
ResolveCookieJarTextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveCookieJarTextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveCookieJarTextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveCookieJarTextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveCookieJarTextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveCookieJarTextMethod "getAcceptPolicy" o = Soup.CookieJar.CookieJarGetAcceptPolicyMethodInfo
ResolveCookieJarTextMethod "getCookieList" o = Soup.CookieJar.CookieJarGetCookieListMethodInfo
ResolveCookieJarTextMethod "getCookieListWithSameSiteInfo" o = Soup.CookieJar.CookieJarGetCookieListWithSameSiteInfoMethodInfo
ResolveCookieJarTextMethod "getCookies" o = Soup.CookieJar.CookieJarGetCookiesMethodInfo
ResolveCookieJarTextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveCookieJarTextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveCookieJarTextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveCookieJarTextMethod "setAcceptPolicy" o = Soup.CookieJar.CookieJarSetAcceptPolicyMethodInfo
ResolveCookieJarTextMethod "setCookie" o = Soup.CookieJar.CookieJarSetCookieMethodInfo
ResolveCookieJarTextMethod "setCookieWithFirstParty" o = Soup.CookieJar.CookieJarSetCookieWithFirstPartyMethodInfo
ResolveCookieJarTextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveCookieJarTextMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveCookieJarTextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveCookieJarTextMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveCookieJarTextMethod t CookieJarText, O.MethodInfo info CookieJarText p) => OL.IsLabel t (CookieJarText -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
getCookieJarTextFilename :: (MonadIO m, IsCookieJarText o) => o -> m (Maybe T.Text)
getCookieJarTextFilename :: o -> m (Maybe Text)
getCookieJarTextFilename o
obj = IO (Maybe Text) -> m (Maybe Text)
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
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"filename"
constructCookieJarTextFilename :: (IsCookieJarText o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructCookieJarTextFilename :: Text -> m (GValueConstruct o)
constructCookieJarTextFilename Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"filename" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data CookieJarTextFilenamePropertyInfo
instance AttrInfo CookieJarTextFilenamePropertyInfo where
type AttrAllowedOps CookieJarTextFilenamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint CookieJarTextFilenamePropertyInfo = IsCookieJarText
type AttrSetTypeConstraint CookieJarTextFilenamePropertyInfo = (~) T.Text
type AttrTransferTypeConstraint CookieJarTextFilenamePropertyInfo = (~) T.Text
type AttrTransferType CookieJarTextFilenamePropertyInfo = T.Text
type AttrGetType CookieJarTextFilenamePropertyInfo = (Maybe T.Text)
type AttrLabel CookieJarTextFilenamePropertyInfo = "filename"
type AttrOrigin CookieJarTextFilenamePropertyInfo = CookieJarText
attrGet = getCookieJarTextFilename
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructCookieJarTextFilename
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList CookieJarText
type instance O.AttributeList CookieJarText = CookieJarTextAttributeList
type CookieJarTextAttributeList = ('[ '("acceptPolicy", Soup.CookieJar.CookieJarAcceptPolicyPropertyInfo), '("filename", CookieJarTextFilenamePropertyInfo), '("readOnly", Soup.CookieJar.CookieJarReadOnlyPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
cookieJarTextFilename :: AttrLabelProxy "filename"
cookieJarTextFilename = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList CookieJarText = CookieJarTextSignalList
type CookieJarTextSignalList = ('[ '("changed", Soup.CookieJar.CookieJarChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "soup_cookie_jar_text_new" soup_cookie_jar_text_new ::
CString ->
CInt ->
IO (Ptr CookieJarText)
cookieJarTextNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Bool
-> m CookieJarText
cookieJarTextNew :: Text -> Bool -> m CookieJarText
cookieJarTextNew Text
filename Bool
readOnly = IO CookieJarText -> m CookieJarText
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CookieJarText -> m CookieJarText)
-> IO CookieJarText -> m CookieJarText
forall a b. (a -> b) -> a -> b
$ do
CString
filename' <- Text -> IO CString
textToCString Text
filename
let readOnly' :: CInt
readOnly' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
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
fromEnum) Bool
readOnly
Ptr CookieJarText
result <- CString -> CInt -> IO (Ptr CookieJarText)
soup_cookie_jar_text_new CString
filename' CInt
readOnly'
Text -> Ptr CookieJarText -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"cookieJarTextNew" Ptr CookieJarText
result
CookieJarText
result' <- ((ManagedPtr CookieJarText -> CookieJarText)
-> Ptr CookieJarText -> IO CookieJarText
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr CookieJarText -> CookieJarText
CookieJarText) Ptr CookieJarText
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
CookieJarText -> IO CookieJarText
forall (m :: * -> *) a. Monad m => a -> m a
return CookieJarText
result'
#if defined(ENABLE_OVERLOADING)
#endif