{- |
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.WebKit2WebExtension.Objects.DOMFileList
    ( 

-- * Exported types
    DOMFileList(..)                         ,
    IsDOMFileList                           ,
    toDOMFileList                           ,
    noDOMFileList                           ,


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


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




 -- * Properties
-- ** length #attr:length#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DOMFileListLengthPropertyInfo           ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    dOMFileListLength                       ,
#endif
    getDOMFileListLength                    ,




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

newtype DOMFileList = DOMFileList (ManagedPtr DOMFileList)
foreign import ccall "webkit_dom_file_list_get_type"
    c_webkit_dom_file_list_get_type :: IO GType

instance GObject DOMFileList where
    gobjectType _ = c_webkit_dom_file_list_get_type
    

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

toDOMFileList :: (MonadIO m, IsDOMFileList o) => o -> m DOMFileList
toDOMFileList = liftIO . unsafeCastTo DOMFileList

noDOMFileList :: Maybe DOMFileList
noDOMFileList = Nothing

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

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

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDOMFileListMethod t DOMFileList, O.MethodInfo info DOMFileList p) => O.IsLabel t (DOMFileList -> 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)

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

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

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList DOMFileList
type instance O.AttributeList DOMFileList = DOMFileListAttributeList
type DOMFileListAttributeList = ('[ '("coreObject", WebKit2WebExtension.DOMObject.DOMObjectCoreObjectPropertyInfo), '("length", DOMFileListLengthPropertyInfo)] :: [(Symbol, *)])
#endif

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

#endif

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

#endif

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

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

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

#endif

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

foreign import ccall "webkit_dom_file_list_item" webkit_dom_file_list_item :: 
    Ptr DOMFileList ->                      -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMFileList"})
    CULong ->                               -- index : TBasicType TULong
    IO (Ptr WebKit2WebExtension.DOMFile.DOMFile)

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

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DOMFileListItemMethodInfo
instance (signature ~ (CULong -> m WebKit2WebExtension.DOMFile.DOMFile), MonadIO m, IsDOMFileList a) => O.MethodInfo DOMFileListItemMethodInfo a signature where
    overloadedMethod _ = dOMFileListItem

#endif