{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- /No description available in the introspection data./

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.Soup.Objects.CookieJarText
    ( 

-- * Exported types
    CookieJarText(..)                       ,
    IsCookieJarText                         ,
    toCookieJarText                         ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [addCookie]("GI.Soup.Objects.CookieJar#g:method:addCookie"), [addCookieFull]("GI.Soup.Objects.CookieJar#g:method:addCookieFull"), [addCookieWithFirstParty]("GI.Soup.Objects.CookieJar#g:method:addCookieWithFirstParty"), [addFeature]("GI.Soup.Interfaces.SessionFeature#g:method:addFeature"), [allCookies]("GI.Soup.Objects.CookieJar#g:method:allCookies"), [attach]("GI.Soup.Interfaces.SessionFeature#g:method:attach"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [deleteCookie]("GI.Soup.Objects.CookieJar#g:method:deleteCookie"), [detach]("GI.Soup.Interfaces.SessionFeature#g:method:detach"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [hasFeature]("GI.Soup.Interfaces.SessionFeature#g:method:hasFeature"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [isPersistent]("GI.Soup.Objects.CookieJar#g:method:isPersistent"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [removeFeature]("GI.Soup.Interfaces.SessionFeature#g:method:removeFeature"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [save]("GI.Soup.Objects.CookieJar#g:method:save"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getAcceptPolicy]("GI.Soup.Objects.CookieJar#g:method:getAcceptPolicy"), [getCookieList]("GI.Soup.Objects.CookieJar#g:method:getCookieList"), [getCookieListWithSameSiteInfo]("GI.Soup.Objects.CookieJar#g:method:getCookieListWithSameSiteInfo"), [getCookies]("GI.Soup.Objects.CookieJar#g:method:getCookies"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata").
-- 
-- ==== Setters
-- [setAcceptPolicy]("GI.Soup.Objects.CookieJar#g:method:setAcceptPolicy"), [setCookie]("GI.Soup.Objects.CookieJar#g:method:setCookie"), [setCookieWithFirstParty]("GI.Soup.Objects.CookieJar#g:method:setCookieWithFirstParty"), [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveCookieJarTextMethod              ,
#endif

-- ** new #method:new#

    cookieJarTextNew                        ,




 -- * Properties


-- ** filename #attr:filename#
-- | /No description available in the introspection data./

#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.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.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.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

-- | Memory-managed wrapper type.
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
$c== :: CookieJarText -> CookieJarText -> Bool
== :: CookieJarText -> CookieJarText -> Bool
$c/= :: CookieJarText -> CookieJarText -> Bool
/= :: 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

-- | Type class for types which can be safely cast to `CookieJarText`, for instance with `toCookieJarText`.
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]

-- | Cast to `CookieJarText`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toCookieJarText :: (MIO.MonadIO m, IsCookieJarText o) => o -> m CookieJarText
toCookieJarText :: forall (m :: * -> *) o.
(MonadIO m, IsCookieJarText o) =>
o -> m CookieJarText
toCookieJarText = IO CookieJarText -> m CookieJarText
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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'
B.ManagedPtr.unsafeCastTo ManagedPtr CookieJarText -> CookieJarText
CookieJarText

-- | Convert 'CookieJarText' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe CookieJarText) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_soup_cookie_jar_text_get_type
    gvalueSet_ :: Ptr GValue -> Maybe CookieJarText -> IO ()
gvalueSet_ Ptr GValue
gv Maybe CookieJarText
P.Nothing = Ptr GValue -> Ptr CookieJarText -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr CookieJarText
forall a. Ptr a
FP.nullPtr :: FP.Ptr CookieJarText)
    gvalueSet_ Ptr GValue
gv (P.Just CookieJarText
obj) = CookieJarText -> (Ptr CookieJarText -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr CookieJarText
obj (Ptr GValue -> Ptr CookieJarText -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe CookieJarText)
gvalueGet_ Ptr GValue
gv = do
        Ptr CookieJarText
ptr <- Ptr GValue -> IO (Ptr CookieJarText)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr CookieJarText)
        if Ptr CookieJarText
ptr Ptr CookieJarText -> Ptr CookieJarText -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr CookieJarText
forall a. Ptr a
FP.nullPtr
        then CookieJarText -> Maybe CookieJarText
forall a. a -> Maybe a
P.Just (CookieJarText -> Maybe CookieJarText)
-> IO CookieJarText -> IO (Maybe CookieJarText)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (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
        else Maybe CookieJarText -> IO (Maybe CookieJarText)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe CookieJarText
forall a. Maybe a
P.Nothing
        
    

#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.OverloadedMethod 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

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveCookieJarTextMethod t CookieJarText, O.OverloadedMethod info CookieJarText p, R.HasField t CookieJarText p) => R.HasField t CookieJarText p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveCookieJarTextMethod t CookieJarText, O.OverloadedMethodInfo info CookieJarText) => OL.IsLabel t (O.MethodProxy info CookieJarText) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif

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

-- | Get the value of the “@filename@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' cookieJarText #filename
-- @
getCookieJarTextFilename :: (MonadIO m, IsCookieJarText o) => o -> m (Maybe T.Text)
getCookieJarTextFilename :: forall (m :: * -> *) o.
(MonadIO m, IsCookieJarText o) =>
o -> m (Maybe Text)
getCookieJarTextFilename o
obj = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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"

-- | Construct a `GValueConstruct` with valid value for the “@filename@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructCookieJarTextFilename :: (IsCookieJarText o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructCookieJarTextFilename :: forall o (m :: * -> *).
(IsCookieJarText o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructCookieJarTextFilename Text
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 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
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Soup.Objects.CookieJarText.filename"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-soup-2.4.26/docs/GI-Soup-Objects-CookieJarText.html#g:attr:filename"
        })
#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

-- method CookieJarText::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "filename"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the filename to read to/write from"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "read_only"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "%TRUE if @filename is read-only"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Soup" , name = "CookieJarText" })
-- throws : False
-- Skip return : False

foreign import ccall "soup_cookie_jar_text_new" soup_cookie_jar_text_new :: 
    CString ->                              -- filename : TBasicType TUTF8
    CInt ->                                 -- read_only : TBasicType TBoolean
    IO (Ptr CookieJarText)

-- | Creates a t'GI.Soup.Objects.CookieJarText.CookieJarText'.
-- 
-- /@filename@/ will be read in at startup to create an initial set of
-- cookies. If /@readOnly@/ is 'P.False', then the non-session cookies will
-- be written to /@filename@/ when the \'changed\' signal is emitted from
-- the jar. (If /@readOnly@/ is 'P.True', then the cookie jar will only be
-- used for this session, and changes made to it will be lost when the
-- jar is destroyed.)
-- 
-- /Since: 2.26/
cookieJarTextNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@filename@/: the filename to read to\/write from
    -> Bool
    -- ^ /@readOnly@/: 'P.True' if /@filename@/ is read-only
    -> m CookieJarText
    -- ^ __Returns:__ the new t'GI.Soup.Objects.CookieJar.CookieJar'
cookieJarTextNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> Bool -> m CookieJarText
cookieJarTextNew Text
filename Bool
readOnly = IO CookieJarText -> m CookieJarText
forall a. IO a -> m a
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 a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CookieJarText
result'

#if defined(ENABLE_OVERLOADING)
#endif