module GI.WebKit2WebExtension.Objects.DOMNodeList
(
DOMNodeList(..) ,
DOMNodeListK ,
toDOMNodeList ,
noDOMNodeList ,
dOMNodeListGetLength ,
dOMNodeListItem ,
DOMNodeListLengthPropertyInfo ,
getDOMNodeListLength ,
) 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.WebKit2WebExtension.Types
import GI.WebKit2WebExtension.Callbacks
import qualified GI.GObject as GObject
newtype DOMNodeList = DOMNodeList (ForeignPtr DOMNodeList)
foreign import ccall "webkit_dom_node_list_get_type"
c_webkit_dom_node_list_get_type :: IO GType
type instance ParentTypes DOMNodeList = DOMNodeListParentTypes
type DOMNodeListParentTypes = '[DOMObject, GObject.Object]
instance GObject DOMNodeList where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_webkit_dom_node_list_get_type
class GObject o => DOMNodeListK o
instance (GObject o, IsDescendantOf DOMNodeList o) => DOMNodeListK o
toDOMNodeList :: DOMNodeListK o => o -> IO DOMNodeList
toDOMNodeList = unsafeCastTo DOMNodeList
noDOMNodeList :: Maybe DOMNodeList
noDOMNodeList = Nothing
getDOMNodeListLength :: (MonadIO m, DOMNodeListK o) => o -> m Word64
getDOMNodeListLength obj = liftIO $ getObjectPropertyUInt64 obj "length"
data DOMNodeListLengthPropertyInfo
instance AttrInfo DOMNodeListLengthPropertyInfo where
type AttrAllowedOps DOMNodeListLengthPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMNodeListLengthPropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMNodeListLengthPropertyInfo = DOMNodeListK
type AttrGetType DOMNodeListLengthPropertyInfo = Word64
type AttrLabel DOMNodeListLengthPropertyInfo = "DOMNodeList::length"
attrGet _ = getDOMNodeListLength
attrSet _ = undefined
attrConstruct _ = undefined
type instance AttributeList DOMNodeList = DOMNodeListAttributeList
type DOMNodeListAttributeList = ('[ '("core-object", DOMObjectCoreObjectPropertyInfo), '("length", DOMNodeListLengthPropertyInfo)] :: [(Symbol, *)])
type instance SignalList DOMNodeList = DOMNodeListSignalList
type DOMNodeListSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "webkit_dom_node_list_get_length" webkit_dom_node_list_get_length ::
Ptr DOMNodeList ->
IO Word64
dOMNodeListGetLength ::
(MonadIO m, DOMNodeListK a) =>
a ->
m Word64
dOMNodeListGetLength _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_node_list_get_length _obj'
touchManagedPtr _obj
return result
foreign import ccall "webkit_dom_node_list_item" webkit_dom_node_list_item ::
Ptr DOMNodeList ->
Word64 ->
IO (Ptr DOMNode)
dOMNodeListItem ::
(MonadIO m, DOMNodeListK a) =>
a ->
Word64 ->
m DOMNode
dOMNodeListItem _obj index = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_node_list_item _obj' index
checkUnexpectedReturnNULL "webkit_dom_node_list_item" result
result' <- (newObject DOMNode) result
touchManagedPtr _obj
return result'