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

-- * Exported types
    DOMCSSRuleList(..)                      ,
    DOMCSSRuleListK                         ,
    toDOMCSSRuleList                        ,
    noDOMCSSRuleList                        ,


 -- * Methods
-- ** dOMCSSRuleListGetLength
    dOMCSSRuleListGetLength                 ,


-- ** dOMCSSRuleListItem
    dOMCSSRuleListItem                      ,




 -- * Properties
-- ** Length
    DOMCSSRuleListLengthPropertyInfo        ,
    getDOMCSSRuleListLength                 ,




    ) 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 DOMCSSRuleList = DOMCSSRuleList (ForeignPtr DOMCSSRuleList)
foreign import ccall "webkit_dom_css_rule_list_get_type"
    c_webkit_dom_css_rule_list_get_type :: IO GType

type instance ParentTypes DOMCSSRuleList = DOMCSSRuleListParentTypes
type DOMCSSRuleListParentTypes = '[DOMObject, GObject.Object]

instance GObject DOMCSSRuleList where
    gobjectIsInitiallyUnowned _ = False
    gobjectType _ = c_webkit_dom_css_rule_list_get_type
    

class GObject o => DOMCSSRuleListK o
instance (GObject o, IsDescendantOf DOMCSSRuleList o) => DOMCSSRuleListK o

toDOMCSSRuleList :: DOMCSSRuleListK o => o -> IO DOMCSSRuleList
toDOMCSSRuleList = unsafeCastTo DOMCSSRuleList

noDOMCSSRuleList :: Maybe DOMCSSRuleList
noDOMCSSRuleList = Nothing

-- VVV Prop "length"
   -- Type: TBasicType TUInt64
   -- Flags: [PropertyReadable]

getDOMCSSRuleListLength :: (MonadIO m, DOMCSSRuleListK o) => o -> m Word64
getDOMCSSRuleListLength obj = liftIO $ getObjectPropertyUInt64 obj "length"

data DOMCSSRuleListLengthPropertyInfo
instance AttrInfo DOMCSSRuleListLengthPropertyInfo where
    type AttrAllowedOps DOMCSSRuleListLengthPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMCSSRuleListLengthPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMCSSRuleListLengthPropertyInfo = DOMCSSRuleListK
    type AttrGetType DOMCSSRuleListLengthPropertyInfo = Word64
    type AttrLabel DOMCSSRuleListLengthPropertyInfo = "DOMCSSRuleList::length"
    attrGet _ = getDOMCSSRuleListLength
    attrSet _ = undefined
    attrConstruct _ = undefined

type instance AttributeList DOMCSSRuleList = DOMCSSRuleListAttributeList
type DOMCSSRuleListAttributeList = ('[ '("core-object", DOMObjectCoreObjectPropertyInfo), '("length", DOMCSSRuleListLengthPropertyInfo)] :: [(Symbol, *)])

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

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

foreign import ccall "webkit_dom_css_rule_list_get_length" webkit_dom_css_rule_list_get_length :: 
    Ptr DOMCSSRuleList ->                   -- _obj : TInterface "WebKit" "DOMCSSRuleList"
    IO Word64


dOMCSSRuleListGetLength ::
    (MonadIO m, DOMCSSRuleListK a) =>
    a ->                                    -- _obj
    m Word64
dOMCSSRuleListGetLength _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- webkit_dom_css_rule_list_get_length _obj'
    touchManagedPtr _obj
    return result

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

foreign import ccall "webkit_dom_css_rule_list_item" webkit_dom_css_rule_list_item :: 
    Ptr DOMCSSRuleList ->                   -- _obj : TInterface "WebKit" "DOMCSSRuleList"
    Word64 ->                               -- index : TBasicType TUInt64
    IO (Ptr DOMCSSRule)


dOMCSSRuleListItem ::
    (MonadIO m, DOMCSSRuleListK a) =>
    a ->                                    -- _obj
    Word64 ->                               -- index
    m DOMCSSRule
dOMCSSRuleListItem _obj index = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- webkit_dom_css_rule_list_item _obj' index
    checkUnexpectedReturnNULL "webkit_dom_css_rule_list_item" result
    result' <- (wrapObject DOMCSSRule) result
    touchManagedPtr _obj
    return result'