{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

/No description available in the introspection data./
-}

module GI.WebKit2WebExtension.Objects.DOMClientRectList
    ( 

-- * Exported types
    DOMClientRectList(..)                   ,
    IsDOMClientRectList                     ,
    toDOMClientRectList                     ,
    noDOMClientRectList                     ,


 -- * Methods
-- ** getLength #method:getLength#

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DOMClientRectListGetLengthMethodInfo    ,
#endif
    dOMClientRectListGetLength              ,


-- ** item #method:item#

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DOMClientRectListItemMethodInfo         ,
#endif
    dOMClientRectListItem                   ,




 -- * Properties
-- ** length #attr:length#
{- | /No description available in the introspection data./
-}
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    DOMClientRectListLengthPropertyInfo     ,
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    dOMClientRectListLength                 ,
#endif
    getDOMClientRectListLength              ,




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

-- | Memory-managed wrapper type.
newtype DOMClientRectList = DOMClientRectList (ManagedPtr DOMClientRectList)
foreign import ccall "webkit_dom_client_rect_list_get_type"
    c_webkit_dom_client_rect_list_get_type :: IO GType

instance GObject DOMClientRectList where
    gobjectType _ = c_webkit_dom_client_rect_list_get_type
    

-- | Type class for types which can be safely cast to `DOMClientRectList`, for instance with `toDOMClientRectList`.
class GObject o => IsDOMClientRectList o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError DOMClientRectList a) =>
    IsDOMClientRectList a
#endif
instance IsDOMClientRectList DOMClientRectList
instance WebKit2WebExtension.DOMObject.IsDOMObject DOMClientRectList
instance GObject.Object.IsObject DOMClientRectList

-- | Cast to `DOMClientRectList`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toDOMClientRectList :: (MonadIO m, IsDOMClientRectList o) => o -> m DOMClientRectList
toDOMClientRectList = liftIO . unsafeCastTo DOMClientRectList

-- | A convenience alias for `Nothing` :: `Maybe` `DOMClientRectList`.
noDOMClientRectList :: Maybe DOMClientRectList
noDOMClientRectList = Nothing

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

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

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

{- |
Get the value of the “@length@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' dOMClientRectList #length
@
-}
getDOMClientRectListLength :: (MonadIO m, IsDOMClientRectList o) => o -> m CULong
getDOMClientRectListLength obj = liftIO $ getObjectPropertyULong obj "length"

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

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

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

#endif

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

#endif

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

{- |
Returns the number of 'GI.WebKit2WebExtension.Objects.DOMClientRect.DOMClientRect' objects that /@self@/ contains.

@since 2.18
-}
dOMClientRectListGetLength ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMClientRectList a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMClientRectList.DOMClientRectList' -}
    -> m CULong
    {- ^ __Returns:__ A @/gulong/@ -}
dOMClientRectListGetLength self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_client_rect_list_get_length self'
    touchManagedPtr self
    return result

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

#endif

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

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

{- |
Returns the 'GI.WebKit2WebExtension.Objects.DOMClientRect.DOMClientRect' object that /@self@/ contains at /@index@/.

@since 2.18
-}
dOMClientRectListItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMClientRectList a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMClientRectList.DOMClientRectList' -}
    -> CULong
    {- ^ /@index@/: A @/gulong/@ -}
    -> m WebKit2WebExtension.DOMClientRect.DOMClientRect
    {- ^ __Returns:__ A 'GI.WebKit2WebExtension.Objects.DOMClientRect.DOMClientRect' -}
dOMClientRectListItem self index = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_client_rect_list_item self' index
    checkUnexpectedReturnNULL "dOMClientRectListItem" result
    result' <- (newObject WebKit2WebExtension.DOMClientRect.DOMClientRect) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DOMClientRectListItemMethodInfo
instance (signature ~ (CULong -> m WebKit2WebExtension.DOMClientRect.DOMClientRect), MonadIO m, IsDOMClientRectList a) => O.MethodInfo DOMClientRectListItemMethodInfo a signature where
    overloadedMethod _ = dOMClientRectListItem

#endif