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

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

#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
       && !defined(__HADDOCK_VERSION__))

module GI.WebKit2WebExtension.Objects.DOMClientRectList
    (

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


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

#if ENABLE_OVERLOADING
    DOMClientRectListGetLengthMethodInfo    ,
#endif
    dOMClientRectListGetLength              ,


-- ** item #method:item#

#if ENABLE_OVERLOADING
    DOMClientRectListItemMethodInfo         ,
#endif
    dOMClientRectListItem                   ,




 -- * Properties
-- ** length #attr:length#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    DOMClientRectListLengthPropertyInfo     ,
#endif
#if ENABLE_OVERLOADING
    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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
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 GHC.OverloadedLabels as OL

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, O.IsDescendantOf DOMClientRectList o) => IsDOMClientRectList o
instance (GObject o, O.IsDescendantOf DOMClientRectList o) => IsDOMClientRectList o

instance O.HasParentTypes DOMClientRectList
type instance O.ParentTypes DOMClientRectList = '[WebKit2WebExtension.DOMObject.DOMObject, GObject.Object.Object]

-- | 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 ENABLE_OVERLOADING
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 "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) => OL.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

-- 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 $ B.Properties.getObjectPropertyULong obj "length"

#if ENABLE_OVERLOADING
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 ENABLE_OVERLOADING
instance O.HasAttributeList DOMClientRectList
type instance O.AttributeList DOMClientRectList = DOMClientRectListAttributeList
type DOMClientRectListAttributeList = ('[ '("coreObject", WebKit2WebExtension.DOMObject.DOMObjectCoreObjectPropertyInfo), '("length", DOMClientRectListLengthPropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
dOMClientRectListLength :: AttrLabelProxy "length"
dOMClientRectListLength = AttrLabelProxy

#endif

#if ENABLE_OVERLOADING
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

{-# DEPRECATED dOMClientRectListGetLength ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
{- |
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 ENABLE_OVERLOADING
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)

{-# DEPRECATED dOMClientRectListItem ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
{- |
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' <- (wrapObject WebKit2WebExtension.DOMClientRect.DOMClientRect) result
    touchManagedPtr self
    return result'

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

#endif