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

-- * Exported types
    DOMPropertyNodeList(..)                 ,
    IsDOMPropertyNodeList                   ,
    toDOMPropertyNodeList                   ,
    noDOMPropertyNodeList                   ,


 -- * Methods
-- ** getLength #method:getLength#
    dOMPropertyNodeListGetLength            ,


-- ** item #method:item#
    dOMPropertyNodeListItem                 ,




 -- * Properties
-- ** length #attr:length#
    DOMPropertyNodeListLengthPropertyInfo   ,
    dOMPropertyNodeListLength               ,
    getDOMPropertyNodeListLength            ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.WebKit.Objects.DOMNode as WebKit.DOMNode
import {-# SOURCE #-} qualified GI.WebKit.Objects.DOMNodeList as WebKit.DOMNodeList
import {-# SOURCE #-} qualified GI.WebKit.Objects.DOMObject as WebKit.DOMObject

newtype DOMPropertyNodeList = DOMPropertyNodeList (ManagedPtr DOMPropertyNodeList)
foreign import ccall "webkit_dom_property_node_list_get_type"
    c_webkit_dom_property_node_list_get_type :: IO GType

instance GObject DOMPropertyNodeList where
    gobjectType _ = c_webkit_dom_property_node_list_get_type
    

class GObject o => IsDOMPropertyNodeList o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError DOMPropertyNodeList a) =>
    IsDOMPropertyNodeList a
#endif
instance IsDOMPropertyNodeList DOMPropertyNodeList
instance WebKit.DOMNodeList.IsDOMNodeList DOMPropertyNodeList
instance WebKit.DOMObject.IsDOMObject DOMPropertyNodeList
instance GObject.Object.IsObject DOMPropertyNodeList

toDOMPropertyNodeList :: IsDOMPropertyNodeList o => o -> IO DOMPropertyNodeList
toDOMPropertyNodeList = unsafeCastTo DOMPropertyNodeList

noDOMPropertyNodeList :: Maybe DOMPropertyNodeList
noDOMPropertyNodeList = Nothing

type family ResolveDOMPropertyNodeListMethod (t :: Symbol) (o :: *) :: * where
    ResolveDOMPropertyNodeListMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDOMPropertyNodeListMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDOMPropertyNodeListMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDOMPropertyNodeListMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDOMPropertyNodeListMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDOMPropertyNodeListMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDOMPropertyNodeListMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDOMPropertyNodeListMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDOMPropertyNodeListMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDOMPropertyNodeListMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveDOMPropertyNodeListMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveDOMPropertyNodeListMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDOMPropertyNodeListMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDOMPropertyNodeListMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDOMPropertyNodeListMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDOMPropertyNodeListMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDOMPropertyNodeListMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDOMPropertyNodeListMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDOMPropertyNodeListMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDOMPropertyNodeListMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDOMPropertyNodeListMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDOMPropertyNodeListMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDOMPropertyNodeListMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveDOMPropertyNodeListMethod t DOMPropertyNodeList, O.MethodInfo info DOMPropertyNodeList p) => O.IsLabelProxy t (DOMPropertyNodeList -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDOMPropertyNodeListMethod t DOMPropertyNodeList, O.MethodInfo info DOMPropertyNodeList p) => O.IsLabel t (DOMPropertyNodeList -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

-- VVV Prop "length"
   -- Type: TBasicType TULong
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

getDOMPropertyNodeListLength :: (MonadIO m, IsDOMPropertyNodeList o) => o -> m CULong
getDOMPropertyNodeListLength obj = liftIO $ getObjectPropertyULong obj "length"

data DOMPropertyNodeListLengthPropertyInfo
instance AttrInfo DOMPropertyNodeListLengthPropertyInfo where
    type AttrAllowedOps DOMPropertyNodeListLengthPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMPropertyNodeListLengthPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMPropertyNodeListLengthPropertyInfo = IsDOMPropertyNodeList
    type AttrGetType DOMPropertyNodeListLengthPropertyInfo = CULong
    type AttrLabel DOMPropertyNodeListLengthPropertyInfo = "length"
    type AttrOrigin DOMPropertyNodeListLengthPropertyInfo = DOMPropertyNodeList
    attrGet _ = getDOMPropertyNodeListLength
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

instance O.HasAttributeList DOMPropertyNodeList
type instance O.AttributeList DOMPropertyNodeList = DOMPropertyNodeListAttributeList
type DOMPropertyNodeListAttributeList = ('[ '("coreObject", WebKit.DOMObject.DOMObjectCoreObjectPropertyInfo), '("length", DOMPropertyNodeListLengthPropertyInfo)] :: [(Symbol, *)])

dOMPropertyNodeListLength :: AttrLabelProxy "length"
dOMPropertyNodeListLength = AttrLabelProxy

type instance O.SignalList DOMPropertyNodeList = DOMPropertyNodeListSignalList
type DOMPropertyNodeListSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method DOMPropertyNodeList::get_length
-- method type : MemberFunction
-- Args : [Arg {argCName = "self", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #WebKitDOMPropertyNodeList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TULong)
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_property_node_list_get_length" webkit_dom_property_node_list_get_length :: 
    Ptr () ->                               -- self : TBasicType TPtr
    IO CULong

{-# DEPRECATED dOMPropertyNodeListGetLength ["(Since version 2.2)"] #-}
{- |
The PropertyNodeList object has been removed from WebKit, this function does nothing.
-}
dOMPropertyNodeListGetLength ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Ptr ()
    {- ^ /@self@/: A @/WebKitDOMPropertyNodeList/@ -}
    -> m CULong
    {- ^ __Returns:__ A @/gulong/@ -}
dOMPropertyNodeListGetLength self = liftIO $ do
    result <- webkit_dom_property_node_list_get_length self
    return result

-- method DOMPropertyNodeList::item
-- method type : MemberFunction
-- Args : [Arg {argCName = "self", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "A #WebKitDOMPropertyNodeList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "index", argType = TBasicType TULong, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #gulong", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit", name = "DOMNode"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_property_node_list_item" webkit_dom_property_node_list_item :: 
    Ptr () ->                               -- self : TBasicType TPtr
    CULong ->                               -- index : TBasicType TULong
    IO (Ptr WebKit.DOMNode.DOMNode)

{-# DEPRECATED dOMPropertyNodeListItem ["(Since version 2.2)"] #-}
{- |
The PropertyNodeList object has been removed from WebKit, this function does nothing.
-}
dOMPropertyNodeListItem ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Ptr ()
    {- ^ /@self@/: A @/WebKitDOMPropertyNodeList/@ -}
    -> CULong
    {- ^ /@index@/: A @/gulong/@ -}
    -> m WebKit.DOMNode.DOMNode
    {- ^ __Returns:__ a 'GI.WebKit.Objects.DOMNode.DOMNode' -}
dOMPropertyNodeListItem self index = liftIO $ do
    result <- webkit_dom_property_node_list_item self index
    checkUnexpectedReturnNULL "dOMPropertyNodeListItem" result
    result' <- (newObject WebKit.DOMNode.DOMNode) result
    return result'