#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Soup.Objects.CookieJarDB
(
CookieJarDB(..) ,
IsCookieJarDB ,
toCookieJarDB ,
noCookieJarDB ,
cookieJarDBNew ,
#if ENABLE_OVERLOADING
CookieJarDBFilenamePropertyInfo ,
#endif
constructCookieJarDBFilename ,
#if ENABLE_OVERLOADING
cookieJarDBFilename ,
#endif
getCookieJarDBFilename ,
) 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.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.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 CookieJarDB = CookieJarDB (ManagedPtr CookieJarDB)
foreign import ccall "soup_cookie_jar_db_get_type"
c_soup_cookie_jar_db_get_type :: IO GType
instance GObject CookieJarDB where
gobjectType = c_soup_cookie_jar_db_get_type
class (GObject o, O.IsDescendantOf CookieJarDB o) => IsCookieJarDB o
instance (GObject o, O.IsDescendantOf CookieJarDB o) => IsCookieJarDB o
instance O.HasParentTypes CookieJarDB
type instance O.ParentTypes CookieJarDB = '[Soup.CookieJar.CookieJar, GObject.Object.Object, Soup.SessionFeature.SessionFeature]
toCookieJarDB :: (MonadIO m, IsCookieJarDB o) => o -> m CookieJarDB
toCookieJarDB = liftIO . unsafeCastTo CookieJarDB
noCookieJarDB :: Maybe CookieJarDB
noCookieJarDB = Nothing
#if ENABLE_OVERLOADING
type family ResolveCookieJarDBMethod (t :: Symbol) (o :: *) :: * where
ResolveCookieJarDBMethod "addCookie" o = Soup.CookieJar.CookieJarAddCookieMethodInfo
ResolveCookieJarDBMethod "addCookieWithFirstParty" o = Soup.CookieJar.CookieJarAddCookieWithFirstPartyMethodInfo
ResolveCookieJarDBMethod "addFeature" o = Soup.SessionFeature.SessionFeatureAddFeatureMethodInfo
ResolveCookieJarDBMethod "allCookies" o = Soup.CookieJar.CookieJarAllCookiesMethodInfo
ResolveCookieJarDBMethod "attach" o = Soup.SessionFeature.SessionFeatureAttachMethodInfo
ResolveCookieJarDBMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveCookieJarDBMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveCookieJarDBMethod "deleteCookie" o = Soup.CookieJar.CookieJarDeleteCookieMethodInfo
ResolveCookieJarDBMethod "detach" o = Soup.SessionFeature.SessionFeatureDetachMethodInfo
ResolveCookieJarDBMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveCookieJarDBMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveCookieJarDBMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveCookieJarDBMethod "hasFeature" o = Soup.SessionFeature.SessionFeatureHasFeatureMethodInfo
ResolveCookieJarDBMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveCookieJarDBMethod "isPersistent" o = Soup.CookieJar.CookieJarIsPersistentMethodInfo
ResolveCookieJarDBMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveCookieJarDBMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveCookieJarDBMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveCookieJarDBMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveCookieJarDBMethod "removeFeature" o = Soup.SessionFeature.SessionFeatureRemoveFeatureMethodInfo
ResolveCookieJarDBMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveCookieJarDBMethod "save" o = Soup.CookieJar.CookieJarSaveMethodInfo
ResolveCookieJarDBMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveCookieJarDBMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveCookieJarDBMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveCookieJarDBMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveCookieJarDBMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveCookieJarDBMethod "getAcceptPolicy" o = Soup.CookieJar.CookieJarGetAcceptPolicyMethodInfo
ResolveCookieJarDBMethod "getCookieList" o = Soup.CookieJar.CookieJarGetCookieListMethodInfo
ResolveCookieJarDBMethod "getCookies" o = Soup.CookieJar.CookieJarGetCookiesMethodInfo
ResolveCookieJarDBMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveCookieJarDBMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveCookieJarDBMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveCookieJarDBMethod "setAcceptPolicy" o = Soup.CookieJar.CookieJarSetAcceptPolicyMethodInfo
ResolveCookieJarDBMethod "setCookie" o = Soup.CookieJar.CookieJarSetCookieMethodInfo
ResolveCookieJarDBMethod "setCookieWithFirstParty" o = Soup.CookieJar.CookieJarSetCookieWithFirstPartyMethodInfo
ResolveCookieJarDBMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveCookieJarDBMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveCookieJarDBMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveCookieJarDBMethod t CookieJarDB, O.MethodInfo info CookieJarDB p) => OL.IsLabel t (CookieJarDB -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
getCookieJarDBFilename :: (MonadIO m, IsCookieJarDB o) => o -> m (Maybe T.Text)
getCookieJarDBFilename obj = liftIO $ B.Properties.getObjectPropertyString obj "filename"
constructCookieJarDBFilename :: (IsCookieJarDB o) => T.Text -> IO (GValueConstruct o)
constructCookieJarDBFilename val = B.Properties.constructObjectPropertyString "filename" (Just val)
#if ENABLE_OVERLOADING
data CookieJarDBFilenamePropertyInfo
instance AttrInfo CookieJarDBFilenamePropertyInfo where
type AttrAllowedOps CookieJarDBFilenamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint CookieJarDBFilenamePropertyInfo = (~) T.Text
type AttrBaseTypeConstraint CookieJarDBFilenamePropertyInfo = IsCookieJarDB
type AttrGetType CookieJarDBFilenamePropertyInfo = (Maybe T.Text)
type AttrLabel CookieJarDBFilenamePropertyInfo = "filename"
type AttrOrigin CookieJarDBFilenamePropertyInfo = CookieJarDB
attrGet _ = getCookieJarDBFilename
attrSet _ = undefined
attrConstruct _ = constructCookieJarDBFilename
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList CookieJarDB
type instance O.AttributeList CookieJarDB = CookieJarDBAttributeList
type CookieJarDBAttributeList = ('[ '("acceptPolicy", Soup.CookieJar.CookieJarAcceptPolicyPropertyInfo), '("filename", CookieJarDBFilenamePropertyInfo), '("readOnly", Soup.CookieJar.CookieJarReadOnlyPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
cookieJarDBFilename :: AttrLabelProxy "filename"
cookieJarDBFilename = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList CookieJarDB = CookieJarDBSignalList
type CookieJarDBSignalList = ('[ '("changed", Soup.CookieJar.CookieJarChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "soup_cookie_jar_db_new" soup_cookie_jar_db_new ::
CString ->
CInt ->
IO (Ptr CookieJarDB)
cookieJarDBNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Bool
-> m CookieJarDB
cookieJarDBNew filename readOnly = liftIO $ do
filename' <- textToCString filename
let readOnly' = (fromIntegral . fromEnum) readOnly
result <- soup_cookie_jar_db_new filename' readOnly'
checkUnexpectedReturnNULL "cookieJarDBNew" result
result' <- (wrapObject CookieJarDB) result
freeMem filename'
return result'
#if ENABLE_OVERLOADING
#endif