module GI.WebKit.Objects.DOMHTMLCollection
(
DOMHTMLCollection(..) ,
DOMHTMLCollectionK ,
toDOMHTMLCollection ,
noDOMHTMLCollection ,
dOMHTMLCollectionGetLength ,
dOMHTMLCollectionItem ,
dOMHTMLCollectionNamedItem ,
DOMHTMLCollectionLengthPropertyInfo ,
getDOMHTMLCollectionLength ,
) 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 DOMHTMLCollection = DOMHTMLCollection (ForeignPtr DOMHTMLCollection)
foreign import ccall "webkit_dom_html_collection_get_type"
c_webkit_dom_html_collection_get_type :: IO GType
type instance ParentTypes DOMHTMLCollection = DOMHTMLCollectionParentTypes
type DOMHTMLCollectionParentTypes = '[DOMObject, GObject.Object]
instance GObject DOMHTMLCollection where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_webkit_dom_html_collection_get_type
class GObject o => DOMHTMLCollectionK o
instance (GObject o, IsDescendantOf DOMHTMLCollection o) => DOMHTMLCollectionK o
toDOMHTMLCollection :: DOMHTMLCollectionK o => o -> IO DOMHTMLCollection
toDOMHTMLCollection = unsafeCastTo DOMHTMLCollection
noDOMHTMLCollection :: Maybe DOMHTMLCollection
noDOMHTMLCollection = Nothing
getDOMHTMLCollectionLength :: (MonadIO m, DOMHTMLCollectionK o) => o -> m Word64
getDOMHTMLCollectionLength obj = liftIO $ getObjectPropertyUInt64 obj "length"
data DOMHTMLCollectionLengthPropertyInfo
instance AttrInfo DOMHTMLCollectionLengthPropertyInfo where
type AttrAllowedOps DOMHTMLCollectionLengthPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMHTMLCollectionLengthPropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMHTMLCollectionLengthPropertyInfo = DOMHTMLCollectionK
type AttrGetType DOMHTMLCollectionLengthPropertyInfo = Word64
type AttrLabel DOMHTMLCollectionLengthPropertyInfo = "DOMHTMLCollection::length"
attrGet _ = getDOMHTMLCollectionLength
attrSet _ = undefined
attrConstruct _ = undefined
type instance AttributeList DOMHTMLCollection = DOMHTMLCollectionAttributeList
type DOMHTMLCollectionAttributeList = ('[ '("core-object", DOMObjectCoreObjectPropertyInfo), '("length", DOMHTMLCollectionLengthPropertyInfo)] :: [(Symbol, *)])
type instance SignalList DOMHTMLCollection = DOMHTMLCollectionSignalList
type DOMHTMLCollectionSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "webkit_dom_html_collection_get_length" webkit_dom_html_collection_get_length ::
Ptr DOMHTMLCollection ->
IO Word64
dOMHTMLCollectionGetLength ::
(MonadIO m, DOMHTMLCollectionK a) =>
a ->
m Word64
dOMHTMLCollectionGetLength _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_html_collection_get_length _obj'
touchManagedPtr _obj
return result
foreign import ccall "webkit_dom_html_collection_item" webkit_dom_html_collection_item ::
Ptr DOMHTMLCollection ->
Word64 ->
IO (Ptr DOMNode)
dOMHTMLCollectionItem ::
(MonadIO m, DOMHTMLCollectionK a) =>
a ->
Word64 ->
m DOMNode
dOMHTMLCollectionItem _obj index = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_html_collection_item _obj' index
checkUnexpectedReturnNULL "webkit_dom_html_collection_item" result
result' <- (newObject DOMNode) result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_dom_html_collection_named_item" webkit_dom_html_collection_named_item ::
Ptr DOMHTMLCollection ->
CString ->
IO (Ptr DOMNode)
dOMHTMLCollectionNamedItem ::
(MonadIO m, DOMHTMLCollectionK a) =>
a ->
T.Text ->
m DOMNode
dOMHTMLCollectionNamedItem _obj name = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
name' <- textToCString name
result <- webkit_dom_html_collection_named_item _obj' name'
checkUnexpectedReturnNULL "webkit_dom_html_collection_named_item" result
result' <- (newObject DOMNode) result
touchManagedPtr _obj
freeMem name'
return result'