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

-- * Exported types
    DOMPerformanceEntryList(..)             ,
    IsDOMPerformanceEntryList               ,
    toDOMPerformanceEntryList               ,
    noDOMPerformanceEntryList               ,


 -- * Methods
-- ** getLength #method:getLength#
    DOMPerformanceEntryListGetLengthMethodInfo,
    dOMPerformanceEntryListGetLength        ,


-- ** item #method:item#
    DOMPerformanceEntryListItemMethodInfo   ,
    dOMPerformanceEntryListItem             ,




 -- * Properties
-- ** length #attr:length#
    DOMPerformanceEntryListLengthPropertyInfo,
    dOMPerformanceEntryListLength           ,
    getDOMPerformanceEntryListLength        ,




    ) 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.DOMObject as WebKit.DOMObject
import {-# SOURCE #-} qualified GI.WebKit.Objects.DOMPerformanceEntry as WebKit.DOMPerformanceEntry

newtype DOMPerformanceEntryList = DOMPerformanceEntryList (ManagedPtr DOMPerformanceEntryList)
foreign import ccall "webkit_dom_performance_entry_list_get_type"
    c_webkit_dom_performance_entry_list_get_type :: IO GType

instance GObject DOMPerformanceEntryList where
    gobjectType _ = c_webkit_dom_performance_entry_list_get_type
    

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

toDOMPerformanceEntryList :: IsDOMPerformanceEntryList o => o -> IO DOMPerformanceEntryList
toDOMPerformanceEntryList = unsafeCastTo DOMPerformanceEntryList

noDOMPerformanceEntryList :: Maybe DOMPerformanceEntryList
noDOMPerformanceEntryList = Nothing

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

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

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

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

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

data DOMPerformanceEntryListLengthPropertyInfo
instance AttrInfo DOMPerformanceEntryListLengthPropertyInfo where
    type AttrAllowedOps DOMPerformanceEntryListLengthPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMPerformanceEntryListLengthPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMPerformanceEntryListLengthPropertyInfo = IsDOMPerformanceEntryList
    type AttrGetType DOMPerformanceEntryListLengthPropertyInfo = CULong
    type AttrLabel DOMPerformanceEntryListLengthPropertyInfo = "length"
    type AttrOrigin DOMPerformanceEntryListLengthPropertyInfo = DOMPerformanceEntryList
    attrGet _ = getDOMPerformanceEntryListLength
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined

instance O.HasAttributeList DOMPerformanceEntryList
type instance O.AttributeList DOMPerformanceEntryList = DOMPerformanceEntryListAttributeList
type DOMPerformanceEntryListAttributeList = ('[ '("coreObject", WebKit.DOMObject.DOMObjectCoreObjectPropertyInfo), '("length", DOMPerformanceEntryListLengthPropertyInfo)] :: [(Symbol, *)])

dOMPerformanceEntryListLength :: AttrLabelProxy "length"
dOMPerformanceEntryListLength = AttrLabelProxy

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

-- method DOMPerformanceEntryList::get_length
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit", name = "DOMPerformanceEntryList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMPerformanceEntryList", 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_performance_entry_list_get_length" webkit_dom_performance_entry_list_get_length :: 
    Ptr DOMPerformanceEntryList ->          -- self : TInterface (Name {namespace = "WebKit", name = "DOMPerformanceEntryList"})
    IO CULong

{- |
/No description available in the introspection data./
-}
dOMPerformanceEntryListGetLength ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMPerformanceEntryList a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit.Objects.DOMPerformanceEntryList.DOMPerformanceEntryList' -}
    -> m CULong
    {- ^ __Returns:__ A @/gulong/@ -}
dOMPerformanceEntryListGetLength self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_performance_entry_list_get_length self'
    touchManagedPtr self
    return result

data DOMPerformanceEntryListGetLengthMethodInfo
instance (signature ~ (m CULong), MonadIO m, IsDOMPerformanceEntryList a) => O.MethodInfo DOMPerformanceEntryListGetLengthMethodInfo a signature where
    overloadedMethod _ = dOMPerformanceEntryListGetLength

-- method DOMPerformanceEntryList::item
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit", name = "DOMPerformanceEntryList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMPerformanceEntryList", 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 = "DOMPerformanceEntry"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_performance_entry_list_item" webkit_dom_performance_entry_list_item :: 
    Ptr DOMPerformanceEntryList ->          -- self : TInterface (Name {namespace = "WebKit", name = "DOMPerformanceEntryList"})
    CULong ->                               -- index : TBasicType TULong
    IO (Ptr WebKit.DOMPerformanceEntry.DOMPerformanceEntry)

{- |
/No description available in the introspection data./
-}
dOMPerformanceEntryListItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMPerformanceEntryList a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit.Objects.DOMPerformanceEntryList.DOMPerformanceEntryList' -}
    -> CULong
    {- ^ /@index@/: A @/gulong/@ -}
    -> m WebKit.DOMPerformanceEntry.DOMPerformanceEntry
    {- ^ __Returns:__ A 'GI.WebKit.Objects.DOMPerformanceEntry.DOMPerformanceEntry' -}
dOMPerformanceEntryListItem self index = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_performance_entry_list_item self' index
    checkUnexpectedReturnNULL "dOMPerformanceEntryListItem" result
    result' <- (wrapObject WebKit.DOMPerformanceEntry.DOMPerformanceEntry) result
    touchManagedPtr self
    return result'

data DOMPerformanceEntryListItemMethodInfo
instance (signature ~ (CULong -> m WebKit.DOMPerformanceEntry.DOMPerformanceEntry), MonadIO m, IsDOMPerformanceEntryList a) => O.MethodInfo DOMPerformanceEntryListItemMethodInfo a signature where
    overloadedMethod _ = dOMPerformanceEntryListItem