{- |
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.DOMDOMWindowCSS
    ( 

-- * Exported types
    DOMDOMWindowCSS(..)                     ,
    DOMDOMWindowCSSK                        ,
    toDOMDOMWindowCSS                       ,
    noDOMDOMWindowCSS                       ,


 -- * Methods
-- ** dOMDOMWindowCSSSupports
    dOMDOMWindowCSSSupports                 ,




    ) 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 DOMDOMWindowCSS = DOMDOMWindowCSS (ForeignPtr DOMDOMWindowCSS)
foreign import ccall "webkit_dom_dom_window_css_get_type"
    c_webkit_dom_dom_window_css_get_type :: IO GType

type instance ParentTypes DOMDOMWindowCSS = DOMDOMWindowCSSParentTypes
type DOMDOMWindowCSSParentTypes = '[DOMObject, GObject.Object]

instance GObject DOMDOMWindowCSS where
    gobjectIsInitiallyUnowned _ = False
    gobjectType _ = c_webkit_dom_dom_window_css_get_type
    

class GObject o => DOMDOMWindowCSSK o
instance (GObject o, IsDescendantOf DOMDOMWindowCSS o) => DOMDOMWindowCSSK o

toDOMDOMWindowCSS :: DOMDOMWindowCSSK o => o -> IO DOMDOMWindowCSS
toDOMDOMWindowCSS = unsafeCastTo DOMDOMWindowCSS

noDOMDOMWindowCSS :: Maybe DOMDOMWindowCSS
noDOMDOMWindowCSS = Nothing

type instance AttributeList DOMDOMWindowCSS = DOMDOMWindowCSSAttributeList
type DOMDOMWindowCSSAttributeList = ('[ '("core-object", DOMObjectCoreObjectPropertyInfo)] :: [(Symbol, *)])

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

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

foreign import ccall "webkit_dom_dom_window_css_supports" webkit_dom_dom_window_css_supports :: 
    Ptr DOMDOMWindowCSS ->                  -- _obj : TInterface "WebKit" "DOMDOMWindowCSS"
    CString ->                              -- property : TBasicType TUTF8
    CString ->                              -- value : TBasicType TUTF8
    IO CInt


dOMDOMWindowCSSSupports ::
    (MonadIO m, DOMDOMWindowCSSK a) =>
    a ->                                    -- _obj
    T.Text ->                               -- property
    T.Text ->                               -- value
    m Bool
dOMDOMWindowCSSSupports _obj property value = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    property' <- textToCString property
    value' <- textToCString value
    result <- webkit_dom_dom_window_css_supports _obj' property' value'
    let result' = (/= 0) result
    touchManagedPtr _obj
    freeMem property'
    freeMem value'
    return result'