{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

module GI.WebKit2.Objects.WebContext
    ( 

-- * Exported types
    WebContext(..)                          ,
    IsWebContext                            ,
    toWebContext                            ,
    noWebContext                            ,


 -- * Methods
-- ** allowTlsCertificateForHost #method:allowTlsCertificateForHost#
    WebContextAllowTlsCertificateForHostMethodInfo,
    webContextAllowTlsCertificateForHost    ,


-- ** clearCache #method:clearCache#
    WebContextClearCacheMethodInfo          ,
    webContextClearCache                    ,


-- ** downloadUri #method:downloadUri#
    WebContextDownloadUriMethodInfo         ,
    webContextDownloadUri                   ,


-- ** getCacheModel #method:getCacheModel#
    WebContextGetCacheModelMethodInfo       ,
    webContextGetCacheModel                 ,


-- ** getCookieManager #method:getCookieManager#
    WebContextGetCookieManagerMethodInfo    ,
    webContextGetCookieManager              ,


-- ** getDefault #method:getDefault#
    webContextGetDefault                    ,


-- ** getFaviconDatabase #method:getFaviconDatabase#
    WebContextGetFaviconDatabaseMethodInfo  ,
    webContextGetFaviconDatabase            ,


-- ** getFaviconDatabaseDirectory #method:getFaviconDatabaseDirectory#
    WebContextGetFaviconDatabaseDirectoryMethodInfo,
    webContextGetFaviconDatabaseDirectory   ,


-- ** getPlugins #method:getPlugins#
    WebContextGetPluginsMethodInfo          ,
    webContextGetPlugins                    ,


-- ** getPluginsFinish #method:getPluginsFinish#
    WebContextGetPluginsFinishMethodInfo    ,
    webContextGetPluginsFinish              ,


-- ** getProcessModel #method:getProcessModel#
    WebContextGetProcessModelMethodInfo     ,
    webContextGetProcessModel               ,


-- ** getSecurityManager #method:getSecurityManager#
    WebContextGetSecurityManagerMethodInfo  ,
    webContextGetSecurityManager            ,


-- ** getSpellCheckingEnabled #method:getSpellCheckingEnabled#
    WebContextGetSpellCheckingEnabledMethodInfo,
    webContextGetSpellCheckingEnabled       ,


-- ** getSpellCheckingLanguages #method:getSpellCheckingLanguages#
    WebContextGetSpellCheckingLanguagesMethodInfo,
    webContextGetSpellCheckingLanguages     ,


-- ** getTlsErrorsPolicy #method:getTlsErrorsPolicy#
    WebContextGetTlsErrorsPolicyMethodInfo  ,
    webContextGetTlsErrorsPolicy            ,


-- ** getWebProcessCountLimit #method:getWebProcessCountLimit#
    WebContextGetWebProcessCountLimitMethodInfo,
    webContextGetWebProcessCountLimit       ,


-- ** getWebsiteDataManager #method:getWebsiteDataManager#
    WebContextGetWebsiteDataManagerMethodInfo,
    webContextGetWebsiteDataManager         ,


-- ** new #method:new#
    webContextNew                           ,


-- ** newWithWebsiteDataManager #method:newWithWebsiteDataManager#
    webContextNewWithWebsiteDataManager     ,


-- ** prefetchDns #method:prefetchDns#
    WebContextPrefetchDnsMethodInfo         ,
    webContextPrefetchDns                   ,


-- ** registerUriScheme #method:registerUriScheme#
    WebContextRegisterUriSchemeMethodInfo   ,
    webContextRegisterUriScheme             ,


-- ** setAdditionalPluginsDirectory #method:setAdditionalPluginsDirectory#
    WebContextSetAdditionalPluginsDirectoryMethodInfo,
    webContextSetAdditionalPluginsDirectory ,


-- ** setCacheModel #method:setCacheModel#
    WebContextSetCacheModelMethodInfo       ,
    webContextSetCacheModel                 ,


-- ** setDiskCacheDirectory #method:setDiskCacheDirectory#
    WebContextSetDiskCacheDirectoryMethodInfo,
    webContextSetDiskCacheDirectory         ,


-- ** setFaviconDatabaseDirectory #method:setFaviconDatabaseDirectory#
    WebContextSetFaviconDatabaseDirectoryMethodInfo,
    webContextSetFaviconDatabaseDirectory   ,


-- ** setPreferredLanguages #method:setPreferredLanguages#
    WebContextSetPreferredLanguagesMethodInfo,
    webContextSetPreferredLanguages         ,


-- ** setProcessModel #method:setProcessModel#
    WebContextSetProcessModelMethodInfo     ,
    webContextSetProcessModel               ,


-- ** setSpellCheckingEnabled #method:setSpellCheckingEnabled#
    WebContextSetSpellCheckingEnabledMethodInfo,
    webContextSetSpellCheckingEnabled       ,


-- ** setSpellCheckingLanguages #method:setSpellCheckingLanguages#
    WebContextSetSpellCheckingLanguagesMethodInfo,
    webContextSetSpellCheckingLanguages     ,


-- ** setTlsErrorsPolicy #method:setTlsErrorsPolicy#
    WebContextSetTlsErrorsPolicyMethodInfo  ,
    webContextSetTlsErrorsPolicy            ,


-- ** setWebExtensionsDirectory #method:setWebExtensionsDirectory#
    WebContextSetWebExtensionsDirectoryMethodInfo,
    webContextSetWebExtensionsDirectory     ,


-- ** setWebExtensionsInitializationUserData #method:setWebExtensionsInitializationUserData#
    WebContextSetWebExtensionsInitializationUserDataMethodInfo,
    webContextSetWebExtensionsInitializationUserData,


-- ** setWebProcessCountLimit #method:setWebProcessCountLimit#
    WebContextSetWebProcessCountLimitMethodInfo,
    webContextSetWebProcessCountLimit       ,




 -- * Properties
-- ** localStorageDirectory #attr:localStorageDirectory#
    WebContextLocalStorageDirectoryPropertyInfo,
    constructWebContextLocalStorageDirectory,
    getWebContextLocalStorageDirectory      ,
    webContextLocalStorageDirectory         ,


-- ** websiteDataManager #attr:websiteDataManager#
    WebContextWebsiteDataManagerPropertyInfo,
    constructWebContextWebsiteDataManager   ,
    getWebContextWebsiteDataManager         ,
    webContextWebsiteDataManager            ,




 -- * Signals
-- ** downloadStarted #signal:downloadStarted#
    C_WebContextDownloadStartedCallback     ,
    WebContextDownloadStartedCallback       ,
    WebContextDownloadStartedSignalInfo     ,
    afterWebContextDownloadStarted          ,
    genClosure_WebContextDownloadStarted    ,
    mk_WebContextDownloadStartedCallback    ,
    noWebContextDownloadStartedCallback     ,
    onWebContextDownloadStarted             ,
    wrap_WebContextDownloadStartedCallback  ,


-- ** initializeWebExtensions #signal:initializeWebExtensions#
    C_WebContextInitializeWebExtensionsCallback,
    WebContextInitializeWebExtensionsCallback,
    WebContextInitializeWebExtensionsSignalInfo,
    afterWebContextInitializeWebExtensions  ,
    genClosure_WebContextInitializeWebExtensions,
    mk_WebContextInitializeWebExtensionsCallback,
    noWebContextInitializeWebExtensionsCallback,
    onWebContextInitializeWebExtensions     ,
    wrap_WebContextInitializeWebExtensionsCallback,




    ) 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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.TlsCertificate as Gio.TlsCertificate
import qualified GI.WebKit2.Callbacks as WebKit2.Callbacks
import {-# SOURCE #-} qualified GI.WebKit2.Enums as WebKit2.Enums
import {-# SOURCE #-} qualified GI.WebKit2.Objects.CookieManager as WebKit2.CookieManager
import {-# SOURCE #-} qualified GI.WebKit2.Objects.Download as WebKit2.Download
import {-# SOURCE #-} qualified GI.WebKit2.Objects.FaviconDatabase as WebKit2.FaviconDatabase
import {-# SOURCE #-} qualified GI.WebKit2.Objects.Plugin as WebKit2.Plugin
import {-# SOURCE #-} qualified GI.WebKit2.Objects.SecurityManager as WebKit2.SecurityManager
import {-# SOURCE #-} qualified GI.WebKit2.Objects.WebsiteDataManager as WebKit2.WebsiteDataManager

newtype WebContext = WebContext (ManagedPtr WebContext)
foreign import ccall "webkit_web_context_get_type"
    c_webkit_web_context_get_type :: IO GType

instance GObject WebContext where
    gobjectType _ = c_webkit_web_context_get_type
    

class GObject o => IsWebContext o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError WebContext a) =>
    IsWebContext a
#endif
instance IsWebContext WebContext
instance GObject.Object.IsObject WebContext

toWebContext :: IsWebContext o => o -> IO WebContext
toWebContext = unsafeCastTo WebContext

noWebContext :: Maybe WebContext
noWebContext = Nothing

type family ResolveWebContextMethod (t :: Symbol) (o :: *) :: * where
    ResolveWebContextMethod "allowTlsCertificateForHost" o = WebContextAllowTlsCertificateForHostMethodInfo
    ResolveWebContextMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveWebContextMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveWebContextMethod "clearCache" o = WebContextClearCacheMethodInfo
    ResolveWebContextMethod "downloadUri" o = WebContextDownloadUriMethodInfo
    ResolveWebContextMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveWebContextMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveWebContextMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveWebContextMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveWebContextMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveWebContextMethod "prefetchDns" o = WebContextPrefetchDnsMethodInfo
    ResolveWebContextMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveWebContextMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveWebContextMethod "registerUriScheme" o = WebContextRegisterUriSchemeMethodInfo
    ResolveWebContextMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveWebContextMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveWebContextMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveWebContextMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveWebContextMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveWebContextMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveWebContextMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveWebContextMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveWebContextMethod "getCacheModel" o = WebContextGetCacheModelMethodInfo
    ResolveWebContextMethod "getCookieManager" o = WebContextGetCookieManagerMethodInfo
    ResolveWebContextMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveWebContextMethod "getFaviconDatabase" o = WebContextGetFaviconDatabaseMethodInfo
    ResolveWebContextMethod "getFaviconDatabaseDirectory" o = WebContextGetFaviconDatabaseDirectoryMethodInfo
    ResolveWebContextMethod "getPlugins" o = WebContextGetPluginsMethodInfo
    ResolveWebContextMethod "getPluginsFinish" o = WebContextGetPluginsFinishMethodInfo
    ResolveWebContextMethod "getProcessModel" o = WebContextGetProcessModelMethodInfo
    ResolveWebContextMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveWebContextMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveWebContextMethod "getSecurityManager" o = WebContextGetSecurityManagerMethodInfo
    ResolveWebContextMethod "getSpellCheckingEnabled" o = WebContextGetSpellCheckingEnabledMethodInfo
    ResolveWebContextMethod "getSpellCheckingLanguages" o = WebContextGetSpellCheckingLanguagesMethodInfo
    ResolveWebContextMethod "getTlsErrorsPolicy" o = WebContextGetTlsErrorsPolicyMethodInfo
    ResolveWebContextMethod "getWebProcessCountLimit" o = WebContextGetWebProcessCountLimitMethodInfo
    ResolveWebContextMethod "getWebsiteDataManager" o = WebContextGetWebsiteDataManagerMethodInfo
    ResolveWebContextMethod "setAdditionalPluginsDirectory" o = WebContextSetAdditionalPluginsDirectoryMethodInfo
    ResolveWebContextMethod "setCacheModel" o = WebContextSetCacheModelMethodInfo
    ResolveWebContextMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveWebContextMethod "setDiskCacheDirectory" o = WebContextSetDiskCacheDirectoryMethodInfo
    ResolveWebContextMethod "setFaviconDatabaseDirectory" o = WebContextSetFaviconDatabaseDirectoryMethodInfo
    ResolveWebContextMethod "setPreferredLanguages" o = WebContextSetPreferredLanguagesMethodInfo
    ResolveWebContextMethod "setProcessModel" o = WebContextSetProcessModelMethodInfo
    ResolveWebContextMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveWebContextMethod "setSpellCheckingEnabled" o = WebContextSetSpellCheckingEnabledMethodInfo
    ResolveWebContextMethod "setSpellCheckingLanguages" o = WebContextSetSpellCheckingLanguagesMethodInfo
    ResolveWebContextMethod "setTlsErrorsPolicy" o = WebContextSetTlsErrorsPolicyMethodInfo
    ResolveWebContextMethod "setWebExtensionsDirectory" o = WebContextSetWebExtensionsDirectoryMethodInfo
    ResolveWebContextMethod "setWebExtensionsInitializationUserData" o = WebContextSetWebExtensionsInitializationUserDataMethodInfo
    ResolveWebContextMethod "setWebProcessCountLimit" o = WebContextSetWebProcessCountLimitMethodInfo
    ResolveWebContextMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveWebContextMethod t WebContext, O.MethodInfo info WebContext p) => O.IsLabelProxy t (WebContext -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveWebContextMethod t WebContext, O.MethodInfo info WebContext p) => O.IsLabel t (WebContext -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

-- signal WebContext::download-started
type WebContextDownloadStartedCallback =
    WebKit2.Download.Download ->
    IO ()

noWebContextDownloadStartedCallback :: Maybe WebContextDownloadStartedCallback
noWebContextDownloadStartedCallback = Nothing

type C_WebContextDownloadStartedCallback =
    Ptr () ->                               -- object
    Ptr WebKit2.Download.Download ->
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_WebContextDownloadStartedCallback :: C_WebContextDownloadStartedCallback -> IO (FunPtr C_WebContextDownloadStartedCallback)

genClosure_WebContextDownloadStarted :: WebContextDownloadStartedCallback -> IO Closure
genClosure_WebContextDownloadStarted cb = do
    let cb' = wrap_WebContextDownloadStartedCallback cb
    mk_WebContextDownloadStartedCallback cb' >>= newCClosure


wrap_WebContextDownloadStartedCallback ::
    WebContextDownloadStartedCallback ->
    Ptr () ->
    Ptr WebKit2.Download.Download ->
    Ptr () ->
    IO ()
wrap_WebContextDownloadStartedCallback _cb _ download _ = do
    download' <- (newObject WebKit2.Download.Download) download
    _cb  download'


onWebContextDownloadStarted :: (GObject a, MonadIO m) => a -> WebContextDownloadStartedCallback -> m SignalHandlerId
onWebContextDownloadStarted obj cb = liftIO $ connectWebContextDownloadStarted obj cb SignalConnectBefore
afterWebContextDownloadStarted :: (GObject a, MonadIO m) => a -> WebContextDownloadStartedCallback -> m SignalHandlerId
afterWebContextDownloadStarted obj cb = connectWebContextDownloadStarted obj cb SignalConnectAfter

connectWebContextDownloadStarted :: (GObject a, MonadIO m) =>
                                    a -> WebContextDownloadStartedCallback -> SignalConnectMode -> m SignalHandlerId
connectWebContextDownloadStarted obj cb after = liftIO $ do
    let cb' = wrap_WebContextDownloadStartedCallback cb
    cb'' <- mk_WebContextDownloadStartedCallback cb'
    connectSignalFunPtr obj "download-started" cb'' after

-- signal WebContext::initialize-web-extensions
type WebContextInitializeWebExtensionsCallback =
    IO ()

noWebContextInitializeWebExtensionsCallback :: Maybe WebContextInitializeWebExtensionsCallback
noWebContextInitializeWebExtensionsCallback = Nothing

type C_WebContextInitializeWebExtensionsCallback =
    Ptr () ->                               -- object
    Ptr () ->                               -- user_data
    IO ()

foreign import ccall "wrapper"
    mk_WebContextInitializeWebExtensionsCallback :: C_WebContextInitializeWebExtensionsCallback -> IO (FunPtr C_WebContextInitializeWebExtensionsCallback)

genClosure_WebContextInitializeWebExtensions :: WebContextInitializeWebExtensionsCallback -> IO Closure
genClosure_WebContextInitializeWebExtensions cb = do
    let cb' = wrap_WebContextInitializeWebExtensionsCallback cb
    mk_WebContextInitializeWebExtensionsCallback cb' >>= newCClosure


wrap_WebContextInitializeWebExtensionsCallback ::
    WebContextInitializeWebExtensionsCallback ->
    Ptr () ->
    Ptr () ->
    IO ()
wrap_WebContextInitializeWebExtensionsCallback _cb _ _ = do
    _cb 


onWebContextInitializeWebExtensions :: (GObject a, MonadIO m) => a -> WebContextInitializeWebExtensionsCallback -> m SignalHandlerId
onWebContextInitializeWebExtensions obj cb = liftIO $ connectWebContextInitializeWebExtensions obj cb SignalConnectBefore
afterWebContextInitializeWebExtensions :: (GObject a, MonadIO m) => a -> WebContextInitializeWebExtensionsCallback -> m SignalHandlerId
afterWebContextInitializeWebExtensions obj cb = connectWebContextInitializeWebExtensions obj cb SignalConnectAfter

connectWebContextInitializeWebExtensions :: (GObject a, MonadIO m) =>
                                            a -> WebContextInitializeWebExtensionsCallback -> SignalConnectMode -> m SignalHandlerId
connectWebContextInitializeWebExtensions obj cb after = liftIO $ do
    let cb' = wrap_WebContextInitializeWebExtensionsCallback cb
    cb'' <- mk_WebContextInitializeWebExtensionsCallback cb'
    connectSignalFunPtr obj "initialize-web-extensions" cb'' after

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

getWebContextLocalStorageDirectory :: (MonadIO m, IsWebContext o) => o -> m (Maybe T.Text)
getWebContextLocalStorageDirectory obj = liftIO $ getObjectPropertyString obj "local-storage-directory"

constructWebContextLocalStorageDirectory :: (IsWebContext o) => T.Text -> IO (GValueConstruct o)
constructWebContextLocalStorageDirectory val = constructObjectPropertyString "local-storage-directory" (Just val)

data WebContextLocalStorageDirectoryPropertyInfo
instance AttrInfo WebContextLocalStorageDirectoryPropertyInfo where
    type AttrAllowedOps WebContextLocalStorageDirectoryPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint WebContextLocalStorageDirectoryPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint WebContextLocalStorageDirectoryPropertyInfo = IsWebContext
    type AttrGetType WebContextLocalStorageDirectoryPropertyInfo = (Maybe T.Text)
    type AttrLabel WebContextLocalStorageDirectoryPropertyInfo = "local-storage-directory"
    type AttrOrigin WebContextLocalStorageDirectoryPropertyInfo = WebContext
    attrGet _ = getWebContextLocalStorageDirectory
    attrSet _ = undefined
    attrConstruct _ = constructWebContextLocalStorageDirectory
    attrClear _ = undefined

-- VVV Prop "website-data-manager"
   -- Type: TInterface (Name {namespace = "WebKit2", name = "WebsiteDataManager"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just False,Nothing)

getWebContextWebsiteDataManager :: (MonadIO m, IsWebContext o) => o -> m WebKit2.WebsiteDataManager.WebsiteDataManager
getWebContextWebsiteDataManager obj = liftIO $ checkUnexpectedNothing "getWebContextWebsiteDataManager" $ getObjectPropertyObject obj "website-data-manager" WebKit2.WebsiteDataManager.WebsiteDataManager

constructWebContextWebsiteDataManager :: (IsWebContext o, WebKit2.WebsiteDataManager.IsWebsiteDataManager a) => a -> IO (GValueConstruct o)
constructWebContextWebsiteDataManager val = constructObjectPropertyObject "website-data-manager" (Just val)

data WebContextWebsiteDataManagerPropertyInfo
instance AttrInfo WebContextWebsiteDataManagerPropertyInfo where
    type AttrAllowedOps WebContextWebsiteDataManagerPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint WebContextWebsiteDataManagerPropertyInfo = WebKit2.WebsiteDataManager.IsWebsiteDataManager
    type AttrBaseTypeConstraint WebContextWebsiteDataManagerPropertyInfo = IsWebContext
    type AttrGetType WebContextWebsiteDataManagerPropertyInfo = WebKit2.WebsiteDataManager.WebsiteDataManager
    type AttrLabel WebContextWebsiteDataManagerPropertyInfo = "website-data-manager"
    type AttrOrigin WebContextWebsiteDataManagerPropertyInfo = WebContext
    attrGet _ = getWebContextWebsiteDataManager
    attrSet _ = undefined
    attrConstruct _ = constructWebContextWebsiteDataManager
    attrClear _ = undefined

instance O.HasAttributeList WebContext
type instance O.AttributeList WebContext = WebContextAttributeList
type WebContextAttributeList = ('[ '("localStorageDirectory", WebContextLocalStorageDirectoryPropertyInfo), '("websiteDataManager", WebContextWebsiteDataManagerPropertyInfo)] :: [(Symbol, *)])

webContextLocalStorageDirectory :: AttrLabelProxy "localStorageDirectory"
webContextLocalStorageDirectory = AttrLabelProxy

webContextWebsiteDataManager :: AttrLabelProxy "websiteDataManager"
webContextWebsiteDataManager = AttrLabelProxy

data WebContextDownloadStartedSignalInfo
instance SignalInfo WebContextDownloadStartedSignalInfo where
    type HaskellCallbackType WebContextDownloadStartedSignalInfo = WebContextDownloadStartedCallback
    connectSignal _ = connectWebContextDownloadStarted

data WebContextInitializeWebExtensionsSignalInfo
instance SignalInfo WebContextInitializeWebExtensionsSignalInfo where
    type HaskellCallbackType WebContextInitializeWebExtensionsSignalInfo = WebContextInitializeWebExtensionsCallback
    connectSignal _ = connectWebContextInitializeWebExtensions

type instance O.SignalList WebContext = WebContextSignalList
type WebContextSignalList = ('[ '("downloadStarted", WebContextDownloadStartedSignalInfo), '("initializeWebExtensions", WebContextInitializeWebExtensionsSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method WebContext::new
-- method type : Constructor
-- Args : []
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2", name = "WebContext"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_new" webkit_web_context_new :: 
    IO (Ptr WebContext)

{- |
Create a new 'GI.WebKit2.Objects.WebContext.WebContext'

@since 2.8
-}
webContextNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m WebContext
    {- ^ __Returns:__ a newly created 'GI.WebKit2.Objects.WebContext.WebContext' -}
webContextNew  = liftIO $ do
    result <- webkit_web_context_new
    checkUnexpectedReturnNULL "webContextNew" result
    result' <- (wrapObject WebContext) result
    return result'

-- method WebContext::new_with_website_data_manager
-- method type : Constructor
-- Args : [Arg {argCName = "manager", argType = TInterface (Name {namespace = "WebKit2", name = "WebsiteDataManager"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebsiteDataManager", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2", name = "WebContext"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_new_with_website_data_manager" webkit_web_context_new_with_website_data_manager :: 
    Ptr WebKit2.WebsiteDataManager.WebsiteDataManager -> -- manager : TInterface (Name {namespace = "WebKit2", name = "WebsiteDataManager"})
    IO (Ptr WebContext)

{- |
Create a new 'GI.WebKit2.Objects.WebContext.WebContext' with a 'GI.WebKit2.Objects.WebsiteDataManager.WebsiteDataManager'.

@since 2.10
-}
webContextNewWithWebsiteDataManager ::
    (B.CallStack.HasCallStack, MonadIO m, WebKit2.WebsiteDataManager.IsWebsiteDataManager a) =>
    a
    {- ^ /@manager@/: a 'GI.WebKit2.Objects.WebsiteDataManager.WebsiteDataManager' -}
    -> m WebContext
    {- ^ __Returns:__ a newly created 'GI.WebKit2.Objects.WebContext.WebContext' -}
webContextNewWithWebsiteDataManager manager = liftIO $ do
    manager' <- unsafeManagedPtrCastPtr manager
    result <- webkit_web_context_new_with_website_data_manager manager'
    checkUnexpectedReturnNULL "webContextNewWithWebsiteDataManager" result
    result' <- (wrapObject WebContext) result
    touchManagedPtr manager
    return result'

-- method WebContext::allow_tls_certificate_for_host
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "certificate", argType = TInterface (Name {namespace = "Gio", name = "TlsCertificate"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GTlsCertificate", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "host", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the host for which a certificate is to be allowed", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_allow_tls_certificate_for_host" webkit_web_context_allow_tls_certificate_for_host :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    Ptr Gio.TlsCertificate.TlsCertificate -> -- certificate : TInterface (Name {namespace = "Gio", name = "TlsCertificate"})
    CString ->                              -- host : TBasicType TUTF8
    IO ()

{- |
Ignore further TLS errors on the /@host@/ for the certificate present in /@info@/.

@since 2.6
-}
webContextAllowTlsCertificateForHost ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a, Gio.TlsCertificate.IsTlsCertificate b) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> b
    {- ^ /@certificate@/: a 'GI.Gio.Objects.TlsCertificate.TlsCertificate' -}
    -> T.Text
    {- ^ /@host@/: the host for which a certificate is to be allowed -}
    -> m ()
webContextAllowTlsCertificateForHost context certificate host = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    certificate' <- unsafeManagedPtrCastPtr certificate
    host' <- textToCString host
    webkit_web_context_allow_tls_certificate_for_host context' certificate' host'
    touchManagedPtr context
    touchManagedPtr certificate
    freeMem host'
    return ()

data WebContextAllowTlsCertificateForHostMethodInfo
instance (signature ~ (b -> T.Text -> m ()), MonadIO m, IsWebContext a, Gio.TlsCertificate.IsTlsCertificate b) => O.MethodInfo WebContextAllowTlsCertificateForHostMethodInfo a signature where
    overloadedMethod _ = webContextAllowTlsCertificateForHost

-- method WebContext::clear_cache
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_clear_cache" webkit_web_context_clear_cache :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    IO ()

{- |
Clears all resources currently cached.
See also 'GI.WebKit2.Objects.WebContext.webContextSetCacheModel'.
-}
webContextClearCache ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> m ()
webContextClearCache context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    webkit_web_context_clear_cache context'
    touchManagedPtr context
    return ()

data WebContextClearCacheMethodInfo
instance (signature ~ (m ()), MonadIO m, IsWebContext a) => O.MethodInfo WebContextClearCacheMethodInfo a signature where
    overloadedMethod _ = webContextClearCache

-- method WebContext::download_uri
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "uri", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the URI to download", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2", name = "Download"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_download_uri" webkit_web_context_download_uri :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    CString ->                              -- uri : TBasicType TUTF8
    IO (Ptr WebKit2.Download.Download)

{- |
Requests downloading of the specified URI string. The download operation
will not be associated to any 'GI.WebKit2.Objects.WebView.WebView', if you are interested in
starting a download from a particular 'GI.WebKit2.Objects.WebView.WebView' use
'GI.WebKit2.Objects.WebView.webViewDownloadUri' instead.
-}
webContextDownloadUri ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> T.Text
    {- ^ /@uri@/: the URI to download -}
    -> m WebKit2.Download.Download
    {- ^ __Returns:__ a new 'GI.WebKit2.Objects.Download.Download' representing the
   the download operation. -}
webContextDownloadUri context uri = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    uri' <- textToCString uri
    result <- webkit_web_context_download_uri context' uri'
    checkUnexpectedReturnNULL "webContextDownloadUri" result
    result' <- (wrapObject WebKit2.Download.Download) result
    touchManagedPtr context
    freeMem uri'
    return result'

data WebContextDownloadUriMethodInfo
instance (signature ~ (T.Text -> m WebKit2.Download.Download), MonadIO m, IsWebContext a) => O.MethodInfo WebContextDownloadUriMethodInfo a signature where
    overloadedMethod _ = webContextDownloadUri

-- method WebContext::get_cache_model
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2", name = "CacheModel"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_get_cache_model" webkit_web_context_get_cache_model :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    IO CUInt

{- |
Returns the current cache model. For more information about this
value check the documentation of the function
'GI.WebKit2.Objects.WebContext.webContextSetCacheModel'.
-}
webContextGetCacheModel ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: the 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> m WebKit2.Enums.CacheModel
    {- ^ __Returns:__ the current 'GI.WebKit2.Enums.CacheModel' -}
webContextGetCacheModel context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- webkit_web_context_get_cache_model context'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr context
    return result'

data WebContextGetCacheModelMethodInfo
instance (signature ~ (m WebKit2.Enums.CacheModel), MonadIO m, IsWebContext a) => O.MethodInfo WebContextGetCacheModelMethodInfo a signature where
    overloadedMethod _ = webContextGetCacheModel

-- method WebContext::get_cookie_manager
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2", name = "CookieManager"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_get_cookie_manager" webkit_web_context_get_cookie_manager :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    IO (Ptr WebKit2.CookieManager.CookieManager)

{- |
Get the 'GI.WebKit2.Objects.CookieManager.CookieManager' of /@context@/.
-}
webContextGetCookieManager ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> m WebKit2.CookieManager.CookieManager
    {- ^ __Returns:__ the 'GI.WebKit2.Objects.CookieManager.CookieManager' of /@context@/. -}
webContextGetCookieManager context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- webkit_web_context_get_cookie_manager context'
    checkUnexpectedReturnNULL "webContextGetCookieManager" result
    result' <- (newObject WebKit2.CookieManager.CookieManager) result
    touchManagedPtr context
    return result'

data WebContextGetCookieManagerMethodInfo
instance (signature ~ (m WebKit2.CookieManager.CookieManager), MonadIO m, IsWebContext a) => O.MethodInfo WebContextGetCookieManagerMethodInfo a signature where
    overloadedMethod _ = webContextGetCookieManager

-- method WebContext::get_favicon_database
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2", name = "FaviconDatabase"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_get_favicon_database" webkit_web_context_get_favicon_database :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    IO (Ptr WebKit2.FaviconDatabase.FaviconDatabase)

{- |
Get the 'GI.WebKit2.Objects.FaviconDatabase.FaviconDatabase' associated with /@context@/.

To initialize the database you need to call
'GI.WebKit2.Objects.WebContext.webContextSetFaviconDatabaseDirectory'.
-}
webContextGetFaviconDatabase ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> m WebKit2.FaviconDatabase.FaviconDatabase
    {- ^ __Returns:__ the 'GI.WebKit2.Objects.FaviconDatabase.FaviconDatabase' of /@context@/. -}
webContextGetFaviconDatabase context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- webkit_web_context_get_favicon_database context'
    checkUnexpectedReturnNULL "webContextGetFaviconDatabase" result
    result' <- (newObject WebKit2.FaviconDatabase.FaviconDatabase) result
    touchManagedPtr context
    return result'

data WebContextGetFaviconDatabaseMethodInfo
instance (signature ~ (m WebKit2.FaviconDatabase.FaviconDatabase), MonadIO m, IsWebContext a) => O.MethodInfo WebContextGetFaviconDatabaseMethodInfo a signature where
    overloadedMethod _ = webContextGetFaviconDatabase

-- method WebContext::get_favicon_database_directory
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_get_favicon_database_directory" webkit_web_context_get_favicon_database_directory :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    IO CString

{- |
Get the directory path being used to store the favicons database
for /@context@/, or 'Nothing' if
'GI.WebKit2.Objects.WebContext.webContextSetFaviconDatabaseDirectory' hasn\'t been
called yet.

This function will always return the same path after having called
'GI.WebKit2.Objects.WebContext.webContextSetFaviconDatabaseDirectory' for the first
time.
-}
webContextGetFaviconDatabaseDirectory ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> m T.Text
    {- ^ __Returns:__ the path of the directory of the favicons
database associated with /@context@/, or 'Nothing'. -}
webContextGetFaviconDatabaseDirectory context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- webkit_web_context_get_favicon_database_directory context'
    checkUnexpectedReturnNULL "webContextGetFaviconDatabaseDirectory" result
    result' <- cstringToText result
    touchManagedPtr context
    return result'

data WebContextGetFaviconDatabaseDirectoryMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsWebContext a) => O.MethodInfo WebContextGetFaviconDatabaseDirectoryMethodInfo a signature where
    overloadedMethod _ = webContextGetFaviconDatabaseDirectory

-- method WebContext::get_plugins
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cancellable", argType = TInterface (Name {namespace = "Gio", name = "Cancellable"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GCancellable or %NULL to ignore", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GAsyncReadyCallback to call when the request is satisfied", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = 3, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the data to pass to callback function", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_get_plugins" webkit_web_context_get_plugins :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

{- |
Asynchronously get the list of installed plugins.

When the operation is finished, /@callback@/ will be called. You can then call
'GI.WebKit2.Objects.WebContext.webContextGetPluginsFinish' to get the result of the operation.
-}
webContextGetPlugins ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a, Gio.Cancellable.IsCancellable b) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> Maybe (b)
    {- ^ /@cancellable@/: a 'GI.Gio.Objects.Cancellable.Cancellable' or 'Nothing' to ignore -}
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    {- ^ /@callback@/: a 'GI.Gio.Callbacks.AsyncReadyCallback' to call when the request is satisfied -}
    -> m ()
webContextGetPlugins context cancellable callback = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    maybeCancellable <- case cancellable of
        Nothing -> return nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
    maybeCallback <- case callback of
        Nothing -> return (castPtrToFunPtr nullPtr)
        Just jCallback -> do
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    webkit_web_context_get_plugins context' maybeCancellable maybeCallback userData
    touchManagedPtr context
    whenJust cancellable touchManagedPtr
    return ()

data WebContextGetPluginsMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsWebContext a, Gio.Cancellable.IsCancellable b) => O.MethodInfo WebContextGetPluginsMethodInfo a signature where
    overloadedMethod _ = webContextGetPlugins

-- method WebContext::get_plugins_finish
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "result", argType = TInterface (Name {namespace = "Gio", name = "AsyncResult"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GAsyncResult", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TGList (TInterface (Name {namespace = "WebKit2", name = "Plugin"})))
-- throws : True
-- Skip return : False

foreign import ccall "webkit_web_context_get_plugins_finish" webkit_web_context_get_plugins_finish :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- result : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO (Ptr (GList (Ptr WebKit2.Plugin.Plugin)))

{- |
Finish an asynchronous operation started with webkit_web_context_get_plugins.
-}
webContextGetPluginsFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> b
    {- ^ /@result@/: a 'GI.Gio.Interfaces.AsyncResult.AsyncResult' -}
    -> m [WebKit2.Plugin.Plugin]
    {- ^ __Returns:__ a 'GI.GLib.Structs.List.List' of 'GI.WebKit2.Objects.Plugin.Plugin'. You must free the 'GI.GLib.Structs.List.List' with
   @/g_list_free()/@ and unref the 'GI.WebKit2.Objects.Plugin.Plugin'\<!-- -->s with 'GI.GObject.Objects.Object.objectUnref' when you\'re done with them. /(Can throw 'Data.GI.Base.GError.GError')/ -}
webContextGetPluginsFinish context result_ = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result_' <- unsafeManagedPtrCastPtr result_
    onException (do
        result <- propagateGError $ webkit_web_context_get_plugins_finish context' result_'
        result' <- unpackGList result
        result'' <- mapM (wrapObject WebKit2.Plugin.Plugin) result'
        g_list_free result
        touchManagedPtr context
        touchManagedPtr result_
        return result''
     ) (do
        return ()
     )

data WebContextGetPluginsFinishMethodInfo
instance (signature ~ (b -> m [WebKit2.Plugin.Plugin]), MonadIO m, IsWebContext a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo WebContextGetPluginsFinishMethodInfo a signature where
    overloadedMethod _ = webContextGetPluginsFinish

-- method WebContext::get_process_model
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2", name = "ProcessModel"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_get_process_model" webkit_web_context_get_process_model :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    IO CUInt

{- |
Returns the current process model. For more information about this value
see 'GI.WebKit2.Objects.WebContext.webContextSetProcessModel'.

@since 2.4
-}
webContextGetProcessModel ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: the 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> m WebKit2.Enums.ProcessModel
    {- ^ __Returns:__ the current 'GI.WebKit2.Enums.ProcessModel' -}
webContextGetProcessModel context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- webkit_web_context_get_process_model context'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr context
    return result'

data WebContextGetProcessModelMethodInfo
instance (signature ~ (m WebKit2.Enums.ProcessModel), MonadIO m, IsWebContext a) => O.MethodInfo WebContextGetProcessModelMethodInfo a signature where
    overloadedMethod _ = webContextGetProcessModel

-- method WebContext::get_security_manager
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2", name = "SecurityManager"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_get_security_manager" webkit_web_context_get_security_manager :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    IO (Ptr WebKit2.SecurityManager.SecurityManager)

{- |
Get the 'GI.WebKit2.Objects.SecurityManager.SecurityManager' of /@context@/.
-}
webContextGetSecurityManager ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> m WebKit2.SecurityManager.SecurityManager
    {- ^ __Returns:__ the 'GI.WebKit2.Objects.SecurityManager.SecurityManager' of /@context@/. -}
webContextGetSecurityManager context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- webkit_web_context_get_security_manager context'
    checkUnexpectedReturnNULL "webContextGetSecurityManager" result
    result' <- (newObject WebKit2.SecurityManager.SecurityManager) result
    touchManagedPtr context
    return result'

data WebContextGetSecurityManagerMethodInfo
instance (signature ~ (m WebKit2.SecurityManager.SecurityManager), MonadIO m, IsWebContext a) => O.MethodInfo WebContextGetSecurityManagerMethodInfo a signature where
    overloadedMethod _ = webContextGetSecurityManager

-- method WebContext::get_spell_checking_enabled
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_get_spell_checking_enabled" webkit_web_context_get_spell_checking_enabled :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    IO CInt

{- |
Get whether spell checking feature is currently enabled.
-}
webContextGetSpellCheckingEnabled ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> m Bool
    {- ^ __Returns:__ 'True' If spell checking is enabled, or 'False' otherwise. -}
webContextGetSpellCheckingEnabled context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- webkit_web_context_get_spell_checking_enabled context'
    let result' = (/= 0) result
    touchManagedPtr context
    return result'

data WebContextGetSpellCheckingEnabledMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsWebContext a) => O.MethodInfo WebContextGetSpellCheckingEnabledMethodInfo a signature where
    overloadedMethod _ = webContextGetSpellCheckingEnabled

-- method WebContext::get_spell_checking_languages
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_get_spell_checking_languages" webkit_web_context_get_spell_checking_languages :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    IO (Ptr CString)

{- |
Get the the list of spell checking languages associated with
/@context@/, or 'Nothing' if no languages have been previously set.

See 'GI.WebKit2.Objects.WebContext.webContextSetSpellCheckingLanguages' for more
details on the format of the languages in the list.
-}
webContextGetSpellCheckingLanguages ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> m [T.Text]
    {- ^ __Returns:__ A 'Nothing'-terminated
   array of languages if available, or 'Nothing' otherwise. -}
webContextGetSpellCheckingLanguages context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- webkit_web_context_get_spell_checking_languages context'
    checkUnexpectedReturnNULL "webContextGetSpellCheckingLanguages" result
    result' <- unpackZeroTerminatedUTF8CArray result
    touchManagedPtr context
    return result'

data WebContextGetSpellCheckingLanguagesMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsWebContext a) => O.MethodInfo WebContextGetSpellCheckingLanguagesMethodInfo a signature where
    overloadedMethod _ = webContextGetSpellCheckingLanguages

-- method WebContext::get_tls_errors_policy
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2", name = "TLSErrorsPolicy"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_get_tls_errors_policy" webkit_web_context_get_tls_errors_policy :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    IO CUInt

{- |
Get the TLS errors policy of /@context@/
-}
webContextGetTlsErrorsPolicy ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> m WebKit2.Enums.TLSErrorsPolicy
    {- ^ __Returns:__ a 'GI.WebKit2.Enums.TLSErrorsPolicy' -}
webContextGetTlsErrorsPolicy context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- webkit_web_context_get_tls_errors_policy context'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr context
    return result'

data WebContextGetTlsErrorsPolicyMethodInfo
instance (signature ~ (m WebKit2.Enums.TLSErrorsPolicy), MonadIO m, IsWebContext a) => O.MethodInfo WebContextGetTlsErrorsPolicyMethodInfo a signature where
    overloadedMethod _ = webContextGetTlsErrorsPolicy

-- method WebContext::get_web_process_count_limit
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_get_web_process_count_limit" webkit_web_context_get_web_process_count_limit :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    IO Word32

{- |
Gets the maximum number of web processes that can be created at the same time for the /@context@/.

@since 2.10
-}
webContextGetWebProcessCountLimit ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: the 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> m Word32
    {- ^ __Returns:__ the maximum limit of web processes, or 0 if there isn\'t a limit. -}
webContextGetWebProcessCountLimit context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- webkit_web_context_get_web_process_count_limit context'
    touchManagedPtr context
    return result

data WebContextGetWebProcessCountLimitMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsWebContext a) => O.MethodInfo WebContextGetWebProcessCountLimitMethodInfo a signature where
    overloadedMethod _ = webContextGetWebProcessCountLimit

-- method WebContext::get_website_data_manager
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2", name = "WebsiteDataManager"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_get_website_data_manager" webkit_web_context_get_website_data_manager :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    IO (Ptr WebKit2.WebsiteDataManager.WebsiteDataManager)

{- |
Get the 'GI.WebKit2.Objects.WebsiteDataManager.WebsiteDataManager' of /@context@/.

@since 2.10
-}
webContextGetWebsiteDataManager ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: the 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> m WebKit2.WebsiteDataManager.WebsiteDataManager
    {- ^ __Returns:__ a 'GI.WebKit2.Objects.WebsiteDataManager.WebsiteDataManager' -}
webContextGetWebsiteDataManager context = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    result <- webkit_web_context_get_website_data_manager context'
    checkUnexpectedReturnNULL "webContextGetWebsiteDataManager" result
    result' <- (newObject WebKit2.WebsiteDataManager.WebsiteDataManager) result
    touchManagedPtr context
    return result'

data WebContextGetWebsiteDataManagerMethodInfo
instance (signature ~ (m WebKit2.WebsiteDataManager.WebsiteDataManager), MonadIO m, IsWebContext a) => O.MethodInfo WebContextGetWebsiteDataManagerMethodInfo a signature where
    overloadedMethod _ = webContextGetWebsiteDataManager

-- method WebContext::prefetch_dns
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "hostname", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a hostname to be resolved", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_prefetch_dns" webkit_web_context_prefetch_dns :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    CString ->                              -- hostname : TBasicType TUTF8
    IO ()

{- |
Resolve the domain name of the given /@hostname@/ in advance, so that if a URI
of /@hostname@/ is requested the load will be performed more quickly.
-}
webContextPrefetchDns ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> T.Text
    {- ^ /@hostname@/: a hostname to be resolved -}
    -> m ()
webContextPrefetchDns context hostname = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    hostname' <- textToCString hostname
    webkit_web_context_prefetch_dns context' hostname'
    touchManagedPtr context
    freeMem hostname'
    return ()

data WebContextPrefetchDnsMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsWebContext a) => O.MethodInfo WebContextPrefetchDnsMethodInfo a signature where
    overloadedMethod _ = webContextPrefetchDns

-- method WebContext::register_uri_scheme
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "scheme", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the network scheme to register", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "callback", argType = TInterface (Name {namespace = "WebKit2", name = "URISchemeRequestCallback"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitURISchemeRequestCallback", sinceVersion = Nothing}, argScope = ScopeTypeNotified, argClosure = 3, argDestroy = 4, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data to pass to callback function", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data_destroy_func", argType = TInterface (Name {namespace = "GLib", name = "DestroyNotify"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "destroy notify for @user_data", sinceVersion = Nothing}, argScope = ScopeTypeAsync, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_register_uri_scheme" webkit_web_context_register_uri_scheme :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    CString ->                              -- scheme : TBasicType TUTF8
    FunPtr WebKit2.Callbacks.C_URISchemeRequestCallback -> -- callback : TInterface (Name {namespace = "WebKit2", name = "URISchemeRequestCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- user_data_destroy_func : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    IO ()

{- |
Register /@scheme@/ in /@context@/, so that when an URI request with /@scheme@/ is made in the
'GI.WebKit2.Objects.WebContext.WebContext', the 'GI.WebKit2.Callbacks.URISchemeRequestCallback' registered will be called with a
'GI.WebKit2.Objects.URISchemeRequest.URISchemeRequest'.
It is possible to handle URI scheme requests asynchronously, by calling 'GI.GObject.Objects.Object.objectRef' on the
'GI.WebKit2.Objects.URISchemeRequest.URISchemeRequest' and calling 'GI.WebKit2.Objects.URISchemeRequest.uRISchemeRequestFinish' later
when the data of the request is available or
'GI.WebKit2.Objects.URISchemeRequest.uRISchemeRequestFinishError' in case of error.

\<informalexample>\<programlisting>
static void
about_uri_scheme_request_cb (WebKitURISchemeRequest *request,
                             gpointer                user_data)
{
    GInputStream *stream;
    gsize         stream_length;
    const gchar  *path;

    path = webkit_uri_scheme_request_get_path (request);
    if (!g_strcmp0 (path, \"plugins\")) {
        \/\<!-- -->* Create a GInputStream with the contents of plugins about page, and set its length to stream_length *\<!-- -->\/
    } else if (!g_strcmp0 (path, \"memory\")) {
        \/\<!-- -->* Create a GInputStream with the contents of memory about page, and set its length to stream_length *\<!-- -->\/
    } else if (!g_strcmp0 (path, \"applications\")) {
        \/\<!-- -->* Create a GInputStream with the contents of applications about page, and set its length to stream_length *\<!-- -->\/
    } else if (!g_strcmp0 (path, \"example\")) {
        gchar *contents;

        contents = g_strdup_printf (\"&lt;html&gt;&lt;body&gt;&lt;p&gt;Example about page&lt;\/p&gt;&lt;\/body&gt;&lt;\/html&gt;\");
        stream_length = strlen (contents);
        stream = g_memory_input_stream_new_from_data (contents, stream_length, g_free);
    } else {
        GError *error;

        error = g_error_new (ABOUT_HANDLER_ERROR, ABOUT_HANDLER_ERROR_INVALID, \"Invalid about:@/s/@ page.\", path);
        webkit_uri_scheme_request_finish_error (request, error);
        g_error_free (error);
        return;
    }
    webkit_uri_scheme_request_finish (request, stream, stream_length, \"text\/html\");
    g_object_unref (stream);
}
\<\/programlisting>\<\/informalexample>
-}
webContextRegisterUriScheme ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> T.Text
    {- ^ /@scheme@/: the network scheme to register -}
    -> WebKit2.Callbacks.URISchemeRequestCallback
    {- ^ /@callback@/: a 'GI.WebKit2.Callbacks.URISchemeRequestCallback' -}
    -> m ()
webContextRegisterUriScheme context scheme callback = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    scheme' <- textToCString scheme
    callback' <- WebKit2.Callbacks.mk_URISchemeRequestCallback (WebKit2.Callbacks.wrap_URISchemeRequestCallback Nothing (WebKit2.Callbacks.drop_closures_URISchemeRequestCallback callback))
    let userData = castFunPtrToPtr callback'
    let userDataDestroyFunc = safeFreeFunPtrPtr
    webkit_web_context_register_uri_scheme context' scheme' callback' userData userDataDestroyFunc
    touchManagedPtr context
    freeMem scheme'
    return ()

data WebContextRegisterUriSchemeMethodInfo
instance (signature ~ (T.Text -> WebKit2.Callbacks.URISchemeRequestCallback -> m ()), MonadIO m, IsWebContext a) => O.MethodInfo WebContextRegisterUriSchemeMethodInfo a signature where
    overloadedMethod _ = webContextRegisterUriScheme

-- method WebContext::set_additional_plugins_directory
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "directory", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the directory to add", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_set_additional_plugins_directory" webkit_web_context_set_additional_plugins_directory :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    CString ->                              -- directory : TBasicType TUTF8
    IO ()

{- |
Set an additional directory where WebKit will look for plugins.
-}
webContextSetAdditionalPluginsDirectory ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> T.Text
    {- ^ /@directory@/: the directory to add -}
    -> m ()
webContextSetAdditionalPluginsDirectory context directory = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    directory' <- textToCString directory
    webkit_web_context_set_additional_plugins_directory context' directory'
    touchManagedPtr context
    freeMem directory'
    return ()

data WebContextSetAdditionalPluginsDirectoryMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsWebContext a) => O.MethodInfo WebContextSetAdditionalPluginsDirectoryMethodInfo a signature where
    overloadedMethod _ = webContextSetAdditionalPluginsDirectory

-- method WebContext::set_cache_model
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "cache_model", argType = TInterface (Name {namespace = "WebKit2", name = "CacheModel"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitCacheModel", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_set_cache_model" webkit_web_context_set_cache_model :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    CUInt ->                                -- cache_model : TInterface (Name {namespace = "WebKit2", name = "CacheModel"})
    IO ()

{- |
Specifies a usage model for WebViews, which WebKit will use to
determine its caching behavior. All web views follow the cache
model. This cache model determines the RAM and disk space to use
for caching previously viewed content .

Research indicates that users tend to browse within clusters of
documents that hold resources in common, and to revisit previously
visited documents. WebKit and the frameworks below it include
built-in caches that take advantage of these patterns,
substantially improving document load speed in browsing
situations. The WebKit cache model controls the behaviors of all of
these caches, including various WebCore caches.

Browsers can improve document load speed substantially by
specifying 'GI.WebKit2.Enums.CacheModelWebBrowser'. Applications without a
browsing interface can reduce memory usage substantially by
specifying 'GI.WebKit2.Enums.CacheModelDocumentViewer'. The default value is
'GI.WebKit2.Enums.CacheModelWebBrowser'.
-}
webContextSetCacheModel ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: the 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> WebKit2.Enums.CacheModel
    {- ^ /@cacheModel@/: a 'GI.WebKit2.Enums.CacheModel' -}
    -> m ()
webContextSetCacheModel context cacheModel = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let cacheModel' = (fromIntegral . fromEnum) cacheModel
    webkit_web_context_set_cache_model context' cacheModel'
    touchManagedPtr context
    return ()

data WebContextSetCacheModelMethodInfo
instance (signature ~ (WebKit2.Enums.CacheModel -> m ()), MonadIO m, IsWebContext a) => O.MethodInfo WebContextSetCacheModelMethodInfo a signature where
    overloadedMethod _ = webContextSetCacheModel

-- method WebContext::set_disk_cache_directory
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "directory", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the directory to set", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_set_disk_cache_directory" webkit_web_context_set_disk_cache_directory :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    CString ->                              -- directory : TBasicType TUTF8
    IO ()

{-# DEPRECATED webContextSetDiskCacheDirectory ["(Since version 2.10.)","Use 'GI.WebKit2.Objects.WebContext.webContextNewWithWebsiteDataManager' instead."] #-}
{- |
Set the directory where disk cache files will be stored
This method must be called before loading anything in this context, otherwise
it will not have any effect.

Note that this method overrides the directory set in the 'GI.WebKit2.Objects.WebsiteDataManager.WebsiteDataManager',
but it doesn\'t change the value returned by 'GI.WebKit2.Objects.WebsiteDataManager.websiteDataManagerGetDiskCacheDirectory'
since the 'GI.WebKit2.Objects.WebsiteDataManager.WebsiteDataManager' is immutable.
-}
webContextSetDiskCacheDirectory ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> T.Text
    {- ^ /@directory@/: the directory to set -}
    -> m ()
webContextSetDiskCacheDirectory context directory = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    directory' <- textToCString directory
    webkit_web_context_set_disk_cache_directory context' directory'
    touchManagedPtr context
    freeMem directory'
    return ()

data WebContextSetDiskCacheDirectoryMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsWebContext a) => O.MethodInfo WebContextSetDiskCacheDirectoryMethodInfo a signature where
    overloadedMethod _ = webContextSetDiskCacheDirectory

-- method WebContext::set_favicon_database_directory
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "path", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "an absolute path to the icon database\ndirectory or %NULL to use the defaults", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_set_favicon_database_directory" webkit_web_context_set_favicon_database_directory :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    CString ->                              -- path : TBasicType TUTF8
    IO ()

{- |
Set the directory path to be used to store the favicons database
for /@context@/ on disk. Passing 'Nothing' as /@path@/ means using the
default directory for the platform (see 'GI.GLib.Functions.getUserDataDir').

Calling this method also means enabling the favicons database for
its use from the applications, so that\'s why it\'s expected to be
called only once. Further calls for the same instance of
'GI.WebKit2.Objects.WebContext.WebContext' won\'t cause any effect.
-}
webContextSetFaviconDatabaseDirectory ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> Maybe (T.Text)
    {- ^ /@path@/: an absolute path to the icon database
directory or 'Nothing' to use the defaults -}
    -> m ()
webContextSetFaviconDatabaseDirectory context path = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    maybePath <- case path of
        Nothing -> return nullPtr
        Just jPath -> do
            jPath' <- textToCString jPath
            return jPath'
    webkit_web_context_set_favicon_database_directory context' maybePath
    touchManagedPtr context
    freeMem maybePath
    return ()

data WebContextSetFaviconDatabaseDirectoryMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsWebContext a) => O.MethodInfo WebContextSetFaviconDatabaseDirectoryMethodInfo a signature where
    overloadedMethod _ = webContextSetFaviconDatabaseDirectory

-- method WebContext::set_preferred_languages
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "languages", argType = TCArray True (-1) (-1) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a %NULL-terminated list of language identifiers", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_set_preferred_languages" webkit_web_context_set_preferred_languages :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    Ptr CString ->                          -- languages : TCArray True (-1) (-1) (TBasicType TUTF8)
    IO ()

{- |
Set the list of preferred languages, sorted from most desirable
to least desirable. The list will be used to build the \"Accept-Language\"
header that will be included in the network requests started by
the 'GI.WebKit2.Objects.WebContext.WebContext'.
-}
webContextSetPreferredLanguages ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> Maybe ([T.Text])
    {- ^ /@languages@/: a 'Nothing'-terminated list of language identifiers -}
    -> m ()
webContextSetPreferredLanguages context languages = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    maybeLanguages <- case languages of
        Nothing -> return nullPtr
        Just jLanguages -> do
            jLanguages' <- packZeroTerminatedUTF8CArray jLanguages
            return jLanguages'
    webkit_web_context_set_preferred_languages context' maybeLanguages
    touchManagedPtr context
    mapZeroTerminatedCArray freeMem maybeLanguages
    freeMem maybeLanguages
    return ()

data WebContextSetPreferredLanguagesMethodInfo
instance (signature ~ (Maybe ([T.Text]) -> m ()), MonadIO m, IsWebContext a) => O.MethodInfo WebContextSetPreferredLanguagesMethodInfo a signature where
    overloadedMethod _ = webContextSetPreferredLanguages

-- method WebContext::set_process_model
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "process_model", argType = TInterface (Name {namespace = "WebKit2", name = "ProcessModel"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitProcessModel", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_set_process_model" webkit_web_context_set_process_model :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    CUInt ->                                -- process_model : TInterface (Name {namespace = "WebKit2", name = "ProcessModel"})
    IO ()

{- |
Specifies a process model for WebViews, which WebKit will use to
determine how auxiliary processes are handled. The default setting
('GI.WebKit2.Enums.ProcessModelSharedSecondaryProcess') is suitable for most
applications which embed a small amount of WebViews, or are used to
display documents which are considered safe — like local files.

Applications which may potentially use a large amount of WebViews
—for example a multi-tabbed web browser— may want to use
'GI.WebKit2.Enums.ProcessModelMultipleSecondaryProcesses', which will use
one process per view most of the time, while still allowing for web
views to share a process when needed (for example when different
views interact with each other). Using this model, when a process
hangs or crashes, only the WebViews using it stop working, while
the rest of the WebViews in the application will still function
normally.

This method **must be called before any web process has been created**,
as early as possible in your application. Calling it later will make
your application crash.

@since 2.4
-}
webContextSetProcessModel ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: the 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> WebKit2.Enums.ProcessModel
    {- ^ /@processModel@/: a 'GI.WebKit2.Enums.ProcessModel' -}
    -> m ()
webContextSetProcessModel context processModel = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let processModel' = (fromIntegral . fromEnum) processModel
    webkit_web_context_set_process_model context' processModel'
    touchManagedPtr context
    return ()

data WebContextSetProcessModelMethodInfo
instance (signature ~ (WebKit2.Enums.ProcessModel -> m ()), MonadIO m, IsWebContext a) => O.MethodInfo WebContextSetProcessModelMethodInfo a signature where
    overloadedMethod _ = webContextSetProcessModel

-- method WebContext::set_spell_checking_enabled
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "enabled", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "Value to be set", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_set_spell_checking_enabled" webkit_web_context_set_spell_checking_enabled :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    CInt ->                                 -- enabled : TBasicType TBoolean
    IO ()

{- |
Enable or disable the spell checking feature.
-}
webContextSetSpellCheckingEnabled ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> Bool
    {- ^ /@enabled@/: Value to be set -}
    -> m ()
webContextSetSpellCheckingEnabled context enabled = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let enabled' = (fromIntegral . fromEnum) enabled
    webkit_web_context_set_spell_checking_enabled context' enabled'
    touchManagedPtr context
    return ()

data WebContextSetSpellCheckingEnabledMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsWebContext a) => O.MethodInfo WebContextSetSpellCheckingEnabledMethodInfo a signature where
    overloadedMethod _ = webContextSetSpellCheckingEnabled

-- method WebContext::set_spell_checking_languages
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "languages", argType = TCArray True (-1) (-1) (TBasicType TUTF8), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a %NULL-terminated list of spell checking languages", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_set_spell_checking_languages" webkit_web_context_set_spell_checking_languages :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    Ptr CString ->                          -- languages : TCArray True (-1) (-1) (TBasicType TUTF8)
    IO ()

{- |
Set the list of spell checking languages to be used for spell
checking.

The locale string typically is in the form lang_COUNTRY, where lang
is an ISO-639 language code, and COUNTRY is an ISO-3166 country code.
For instance, sv_FI for Swedish as written in Finland or pt_BR
for Portuguese as written in Brazil.

You need to call this function with a valid list of languages at
least once in order to properly enable the spell checking feature
in WebKit.
-}
webContextSetSpellCheckingLanguages ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> [T.Text]
    {- ^ /@languages@/: a 'Nothing'-terminated list of spell checking languages -}
    -> m ()
webContextSetSpellCheckingLanguages context languages = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    languages' <- packZeroTerminatedUTF8CArray languages
    webkit_web_context_set_spell_checking_languages context' languages'
    touchManagedPtr context
    mapZeroTerminatedCArray freeMem languages'
    freeMem languages'
    return ()

data WebContextSetSpellCheckingLanguagesMethodInfo
instance (signature ~ ([T.Text] -> m ()), MonadIO m, IsWebContext a) => O.MethodInfo WebContextSetSpellCheckingLanguagesMethodInfo a signature where
    overloadedMethod _ = webContextSetSpellCheckingLanguages

-- method WebContext::set_tls_errors_policy
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "policy", argType = TInterface (Name {namespace = "WebKit2", name = "TLSErrorsPolicy"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitTLSErrorsPolicy", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_set_tls_errors_policy" webkit_web_context_set_tls_errors_policy :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    CUInt ->                                -- policy : TInterface (Name {namespace = "WebKit2", name = "TLSErrorsPolicy"})
    IO ()

{- |
Set the TLS errors policy of /@context@/ as /@policy@/
-}
webContextSetTlsErrorsPolicy ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> WebKit2.Enums.TLSErrorsPolicy
    {- ^ /@policy@/: a 'GI.WebKit2.Enums.TLSErrorsPolicy' -}
    -> m ()
webContextSetTlsErrorsPolicy context policy = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    let policy' = (fromIntegral . fromEnum) policy
    webkit_web_context_set_tls_errors_policy context' policy'
    touchManagedPtr context
    return ()

data WebContextSetTlsErrorsPolicyMethodInfo
instance (signature ~ (WebKit2.Enums.TLSErrorsPolicy -> m ()), MonadIO m, IsWebContext a) => O.MethodInfo WebContextSetTlsErrorsPolicyMethodInfo a signature where
    overloadedMethod _ = webContextSetTlsErrorsPolicy

-- method WebContext::set_web_extensions_directory
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "directory", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the directory to add", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_set_web_extensions_directory" webkit_web_context_set_web_extensions_directory :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    CString ->                              -- directory : TBasicType TUTF8
    IO ()

{- |
Set the directory where WebKit will look for Web Extensions.
This method must be called before loading anything in this context,
otherwise it will not have any effect. You can connect to
'GI.WebKit2.Objects.WebContext.WebContext'::@/initialize-web-extensions/@ to call this method
before anything is loaded.
-}
webContextSetWebExtensionsDirectory ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> T.Text
    {- ^ /@directory@/: the directory to add -}
    -> m ()
webContextSetWebExtensionsDirectory context directory = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    directory' <- textToCString directory
    webkit_web_context_set_web_extensions_directory context' directory'
    touchManagedPtr context
    freeMem directory'
    return ()

data WebContextSetWebExtensionsDirectoryMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsWebContext a) => O.MethodInfo WebContextSetWebExtensionsDirectoryMethodInfo a signature where
    overloadedMethod _ = webContextSetWebExtensionsDirectory

-- method WebContext::set_web_extensions_initialization_user_data
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TVariant, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GVariant", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_set_web_extensions_initialization_user_data" webkit_web_context_set_web_extensions_initialization_user_data :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    Ptr GVariant ->                         -- user_data : TVariant
    IO ()

{- |
Set user data to be passed to Web Extensions on initialization.
The data will be passed to the
@/WebKitWebExtensionInitializeWithUserDataFunction/@.
This method must be called before loading anything in this context,
otherwise it will not have any effect. You can connect to
'GI.WebKit2.Objects.WebContext.WebContext'::@/initialize-web-extensions/@ to call this method
before anything is loaded.

@since 2.4
-}
webContextSetWebExtensionsInitializationUserData ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: a 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> GVariant
    {- ^ /@userData@/: a 'GVariant' -}
    -> m ()
webContextSetWebExtensionsInitializationUserData context userData = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    userData' <- unsafeManagedPtrGetPtr userData
    webkit_web_context_set_web_extensions_initialization_user_data context' userData'
    touchManagedPtr context
    touchManagedPtr userData
    return ()

data WebContextSetWebExtensionsInitializationUserDataMethodInfo
instance (signature ~ (GVariant -> m ()), MonadIO m, IsWebContext a) => O.MethodInfo WebContextSetWebExtensionsInitializationUserDataMethodInfo a signature where
    overloadedMethod _ = webContextSetWebExtensionsInitializationUserData

-- method WebContext::set_web_process_count_limit
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "context", argType = TInterface (Name {namespace = "WebKit2", name = "WebContext"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #WebKitWebContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "limit", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the maximum number of web processes", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_set_web_process_count_limit" webkit_web_context_set_web_process_count_limit :: 
    Ptr WebContext ->                       -- context : TInterface (Name {namespace = "WebKit2", name = "WebContext"})
    Word32 ->                               -- limit : TBasicType TUInt
    IO ()

{- |
Sets the maximum number of web processes that can be created at the same time for the /@context@/.
The default value is 0 and means no limit.

This method **must be called before any web process has been created**,
as early as possible in your application. Calling it later will make
your application crash.

@since 2.10
-}
webContextSetWebProcessCountLimit ::
    (B.CallStack.HasCallStack, MonadIO m, IsWebContext a) =>
    a
    {- ^ /@context@/: the 'GI.WebKit2.Objects.WebContext.WebContext' -}
    -> Word32
    {- ^ /@limit@/: the maximum number of web processes -}
    -> m ()
webContextSetWebProcessCountLimit context limit = liftIO $ do
    context' <- unsafeManagedPtrCastPtr context
    webkit_web_context_set_web_process_count_limit context' limit
    touchManagedPtr context
    return ()

data WebContextSetWebProcessCountLimitMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsWebContext a) => O.MethodInfo WebContextSetWebProcessCountLimitMethodInfo a signature where
    overloadedMethod _ = webContextSetWebProcessCountLimit

-- method WebContext::get_default
-- method type : MemberFunction
-- Args : []
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2", name = "WebContext"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_web_context_get_default" webkit_web_context_get_default :: 
    IO (Ptr WebContext)

{- |
Gets the default web context
-}
webContextGetDefault ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m WebContext
    {- ^ __Returns:__ a 'GI.WebKit2.Objects.WebContext.WebContext' -}
webContextGetDefault  = liftIO $ do
    result <- webkit_web_context_get_default
    checkUnexpectedReturnNULL "webContextGetDefault" result
    result' <- (newObject WebContext) result
    return result'