{- |
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.WebKit.Objects.DOMDOMApplicationCache
    ( 

-- * Exported types
    DOMDOMApplicationCache(..)              ,
    DOMDOMApplicationCacheK                 ,
    toDOMDOMApplicationCache                ,
    noDOMDOMApplicationCache                ,


 -- * Methods
-- ** dOMDOMApplicationCacheAbort
    dOMDOMApplicationCacheAbort             ,


-- ** dOMDOMApplicationCacheDispatchEvent
    dOMDOMApplicationCacheDispatchEvent     ,


-- ** dOMDOMApplicationCacheGetStatus
    dOMDOMApplicationCacheGetStatus         ,


-- ** dOMDOMApplicationCacheSwapCache
    dOMDOMApplicationCacheSwapCache         ,


-- ** dOMDOMApplicationCacheUpdate
    dOMDOMApplicationCacheUpdate            ,




 -- * Properties
-- ** Status
    DOMDOMApplicationCacheStatusPropertyInfo,
    getDOMDOMApplicationCacheStatus         ,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.WebKit.Types
import GI.WebKit.Callbacks
import qualified GI.GObject as GObject

newtype DOMDOMApplicationCache = DOMDOMApplicationCache (ForeignPtr DOMDOMApplicationCache)
foreign import ccall "webkit_dom_dom_application_cache_get_type"
    c_webkit_dom_dom_application_cache_get_type :: IO GType

type instance ParentTypes DOMDOMApplicationCache = DOMDOMApplicationCacheParentTypes
type DOMDOMApplicationCacheParentTypes = '[DOMObject, GObject.Object, DOMEventTarget]

instance GObject DOMDOMApplicationCache where
    gobjectIsInitiallyUnowned _ = False
    gobjectType _ = c_webkit_dom_dom_application_cache_get_type
    

class GObject o => DOMDOMApplicationCacheK o
instance (GObject o, IsDescendantOf DOMDOMApplicationCache o) => DOMDOMApplicationCacheK o

toDOMDOMApplicationCache :: DOMDOMApplicationCacheK o => o -> IO DOMDOMApplicationCache
toDOMDOMApplicationCache = unsafeCastTo DOMDOMApplicationCache

noDOMDOMApplicationCache :: Maybe DOMDOMApplicationCache
noDOMDOMApplicationCache = Nothing

-- VVV Prop "status"
   -- Type: TBasicType TUInt32
   -- Flags: [PropertyReadable]

getDOMDOMApplicationCacheStatus :: (MonadIO m, DOMDOMApplicationCacheK o) => o -> m Word32
getDOMDOMApplicationCacheStatus obj = liftIO $ getObjectPropertyCUInt obj "status"

data DOMDOMApplicationCacheStatusPropertyInfo
instance AttrInfo DOMDOMApplicationCacheStatusPropertyInfo where
    type AttrAllowedOps DOMDOMApplicationCacheStatusPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMDOMApplicationCacheStatusPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMDOMApplicationCacheStatusPropertyInfo = DOMDOMApplicationCacheK
    type AttrGetType DOMDOMApplicationCacheStatusPropertyInfo = Word32
    type AttrLabel DOMDOMApplicationCacheStatusPropertyInfo = "DOMDOMApplicationCache::status"
    attrGet _ = getDOMDOMApplicationCacheStatus
    attrSet _ = undefined
    attrConstruct _ = undefined

type instance AttributeList DOMDOMApplicationCache = DOMDOMApplicationCacheAttributeList
type DOMDOMApplicationCacheAttributeList = ('[ '("core-object", DOMObjectCoreObjectPropertyInfo), '("status", DOMDOMApplicationCacheStatusPropertyInfo)] :: [(Symbol, *)])

type instance SignalList DOMDOMApplicationCache = DOMDOMApplicationCacheSignalList
type DOMDOMApplicationCacheSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method DOMDOMApplicationCache::abort
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMDOMApplicationCache", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMDOMApplicationCache", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_dom_application_cache_abort" webkit_dom_dom_application_cache_abort :: 
    Ptr DOMDOMApplicationCache ->           -- _obj : TInterface "WebKit" "DOMDOMApplicationCache"
    IO ()


dOMDOMApplicationCacheAbort ::
    (MonadIO m, DOMDOMApplicationCacheK a) =>
    a ->                                    -- _obj
    m ()
dOMDOMApplicationCacheAbort _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    webkit_dom_dom_application_cache_abort _obj'
    touchManagedPtr _obj
    return ()

-- method DOMDOMApplicationCache::dispatch_event
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMDOMApplicationCache", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "evt", argType = TInterface "WebKit" "DOMEvent", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMDOMApplicationCache", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "evt", argType = TInterface "WebKit" "DOMEvent", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : True
-- Skip return : False

foreign import ccall "webkit_dom_dom_application_cache_dispatch_event" webkit_dom_dom_application_cache_dispatch_event :: 
    Ptr DOMDOMApplicationCache ->           -- _obj : TInterface "WebKit" "DOMDOMApplicationCache"
    Ptr DOMEvent ->                         -- evt : TInterface "WebKit" "DOMEvent"
    Ptr (Ptr GError) ->                     -- error
    IO CInt

{-# DEPRECATED dOMDOMApplicationCacheDispatchEvent ["(Since version 2.4)","Use webkit_dom_event_target_dispatch_event() instead."]#-}
dOMDOMApplicationCacheDispatchEvent ::
    (MonadIO m, DOMDOMApplicationCacheK a, DOMEventK b) =>
    a ->                                    -- _obj
    b ->                                    -- evt
    m ()
dOMDOMApplicationCacheDispatchEvent _obj evt = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let evt' = unsafeManagedPtrCastPtr evt
    onException (do
        _ <- propagateGError $ webkit_dom_dom_application_cache_dispatch_event _obj' evt'
        touchManagedPtr _obj
        touchManagedPtr evt
        return ()
     ) (do
        return ()
     )

-- method DOMDOMApplicationCache::get_status
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMDOMApplicationCache", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMDOMApplicationCache", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TUInt16
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_dom_application_cache_get_status" webkit_dom_dom_application_cache_get_status :: 
    Ptr DOMDOMApplicationCache ->           -- _obj : TInterface "WebKit" "DOMDOMApplicationCache"
    IO Word16


dOMDOMApplicationCacheGetStatus ::
    (MonadIO m, DOMDOMApplicationCacheK a) =>
    a ->                                    -- _obj
    m Word16
dOMDOMApplicationCacheGetStatus _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- webkit_dom_dom_application_cache_get_status _obj'
    touchManagedPtr _obj
    return result

-- method DOMDOMApplicationCache::swap_cache
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMDOMApplicationCache", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMDOMApplicationCache", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : True
-- Skip return : False

foreign import ccall "webkit_dom_dom_application_cache_swap_cache" webkit_dom_dom_application_cache_swap_cache :: 
    Ptr DOMDOMApplicationCache ->           -- _obj : TInterface "WebKit" "DOMDOMApplicationCache"
    Ptr (Ptr GError) ->                     -- error
    IO ()


dOMDOMApplicationCacheSwapCache ::
    (MonadIO m, DOMDOMApplicationCacheK a) =>
    a ->                                    -- _obj
    m ()
dOMDOMApplicationCacheSwapCache _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    onException (do
        propagateGError $ webkit_dom_dom_application_cache_swap_cache _obj'
        touchManagedPtr _obj
        return ()
     ) (do
        return ()
     )

-- method DOMDOMApplicationCache::update
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMDOMApplicationCache", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "WebKit" "DOMDOMApplicationCache", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : True
-- Skip return : False

foreign import ccall "webkit_dom_dom_application_cache_update" webkit_dom_dom_application_cache_update :: 
    Ptr DOMDOMApplicationCache ->           -- _obj : TInterface "WebKit" "DOMDOMApplicationCache"
    Ptr (Ptr GError) ->                     -- error
    IO ()


dOMDOMApplicationCacheUpdate ::
    (MonadIO m, DOMDOMApplicationCacheK a) =>
    a ->                                    -- _obj
    m ()
dOMDOMApplicationCacheUpdate _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    onException (do
        propagateGError $ webkit_dom_dom_application_cache_update _obj'
        touchManagedPtr _obj
        return ()
     ) (do
        return ()
     )