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

-- * Exported types
    DOMGamepadList(..)                      ,
    IsDOMGamepadList                        ,
    toDOMGamepadList                        ,
    noDOMGamepadList                        ,


 -- * Methods
-- ** getLength #method:getLength#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DOMGamepadListGetLengthMethodInfo       ,
#endif
    dOMGamepadListGetLength                 ,


-- ** item #method:item#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DOMGamepadListItemMethodInfo            ,
#endif
    dOMGamepadListItem                      ,




 -- * Properties
-- ** length #attr:length#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DOMGamepadListLengthPropertyInfo        ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    dOMGamepadListLength                    ,
#endif
    getDOMGamepadListLength                 ,




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

newtype DOMGamepadList = DOMGamepadList (ManagedPtr DOMGamepadList)
foreign import ccall "webkit_dom_gamepad_list_get_type"
    c_webkit_dom_gamepad_list_get_type :: IO GType

instance GObject DOMGamepadList where
    gobjectType _ = c_webkit_dom_gamepad_list_get_type
    

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

toDOMGamepadList :: (MonadIO m, IsDOMGamepadList o) => o -> m DOMGamepadList
toDOMGamepadList = liftIO . unsafeCastTo DOMGamepadList

noDOMGamepadList :: Maybe DOMGamepadList
noDOMGamepadList = Nothing

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

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

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

#endif

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

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

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DOMGamepadListLengthPropertyInfo
instance AttrInfo DOMGamepadListLengthPropertyInfo where
    type AttrAllowedOps DOMGamepadListLengthPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMGamepadListLengthPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMGamepadListLengthPropertyInfo = IsDOMGamepadList
    type AttrGetType DOMGamepadListLengthPropertyInfo = CULong
    type AttrLabel DOMGamepadListLengthPropertyInfo = "length"
    type AttrOrigin DOMGamepadListLengthPropertyInfo = DOMGamepadList
    attrGet _ = getDOMGamepadListLength
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList DOMGamepadList
type instance O.AttributeList DOMGamepadList = DOMGamepadListAttributeList
type DOMGamepadListAttributeList = ('[ '("coreObject", WebKit.DOMObject.DOMObjectCoreObjectPropertyInfo), '("length", DOMGamepadListLengthPropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
dOMGamepadListLength :: AttrLabelProxy "length"
dOMGamepadListLength = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type instance O.SignalList DOMGamepadList = DOMGamepadListSignalList
type DOMGamepadListSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

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

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

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DOMGamepadListGetLengthMethodInfo
instance (signature ~ (m CULong), MonadIO m, IsDOMGamepadList a) => O.MethodInfo DOMGamepadListGetLengthMethodInfo a signature where
    overloadedMethod _ = dOMGamepadListGetLength

#endif

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

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

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

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DOMGamepadListItemMethodInfo
instance (signature ~ (CULong -> m WebKit.DOMGamepad.DOMGamepad), MonadIO m, IsDOMGamepadList a) => O.MethodInfo DOMGamepadListItemMethodInfo a signature where
    overloadedMethod _ = dOMGamepadListItem

#endif