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

-- * Exported types
    DOMStyleSheetList(..)                   ,
    IsDOMStyleSheetList                     ,
    toDOMStyleSheetList                     ,
    noDOMStyleSheetList                     ,


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

#if ENABLE_OVERLOADING
    DOMStyleSheetListGetLengthMethodInfo    ,
#endif
    dOMStyleSheetListGetLength              ,


-- ** item #method:item#

#if ENABLE_OVERLOADING
    DOMStyleSheetListItemMethodInfo         ,
#endif
    dOMStyleSheetListItem                   ,




 -- * Properties
-- ** length #attr:length#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    DOMStyleSheetListLengthPropertyInfo     ,
#endif
#if ENABLE_OVERLOADING
    dOMStyleSheetListLength                 ,
#endif
    getDOMStyleSheetListLength              ,




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

-- | Memory-managed wrapper type.
newtype DOMStyleSheetList = DOMStyleSheetList (ManagedPtr DOMStyleSheetList)
foreign import ccall "webkit_dom_style_sheet_list_get_type"
    c_webkit_dom_style_sheet_list_get_type :: IO GType

instance GObject DOMStyleSheetList where
    gobjectType = c_webkit_dom_style_sheet_list_get_type


-- | Type class for types which can be safely cast to `DOMStyleSheetList`, for instance with `toDOMStyleSheetList`.
class (GObject o, O.IsDescendantOf DOMStyleSheetList o) => IsDOMStyleSheetList o
instance (GObject o, O.IsDescendantOf DOMStyleSheetList o) => IsDOMStyleSheetList o

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

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

-- | A convenience alias for `Nothing` :: `Maybe` `DOMStyleSheetList`.
noDOMStyleSheetList :: Maybe DOMStyleSheetList
noDOMStyleSheetList = Nothing

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

instance (info ~ ResolveDOMStyleSheetListMethod t DOMStyleSheetList, O.MethodInfo info DOMStyleSheetList p) => OL.IsLabel t (DOMStyleSheetList -> 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' dOMStyleSheetList #length
@
-}
getDOMStyleSheetListLength :: (MonadIO m, IsDOMStyleSheetList o) => o -> m CULong
getDOMStyleSheetListLength obj = liftIO $ B.Properties.getObjectPropertyULong obj "length"

#if ENABLE_OVERLOADING
data DOMStyleSheetListLengthPropertyInfo
instance AttrInfo DOMStyleSheetListLengthPropertyInfo where
    type AttrAllowedOps DOMStyleSheetListLengthPropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMStyleSheetListLengthPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMStyleSheetListLengthPropertyInfo = IsDOMStyleSheetList
    type AttrGetType DOMStyleSheetListLengthPropertyInfo = CULong
    type AttrLabel DOMStyleSheetListLengthPropertyInfo = "length"
    type AttrOrigin DOMStyleSheetListLengthPropertyInfo = DOMStyleSheetList
    attrGet _ = getDOMStyleSheetListLength
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList DOMStyleSheetList
type instance O.AttributeList DOMStyleSheetList = DOMStyleSheetListAttributeList
type DOMStyleSheetListAttributeList = ('[ '("coreObject", WebKit2WebExtension.DOMObject.DOMObjectCoreObjectPropertyInfo), '("length", DOMStyleSheetListLengthPropertyInfo)] :: [(Symbol, *)])
#endif

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

#endif

#if ENABLE_OVERLOADING
type instance O.SignalList DOMStyleSheetList = DOMStyleSheetListSignalList
type DOMStyleSheetListSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

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

{-# DEPRECATED dOMStyleSheetListGetLength ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
{- |
/No description available in the introspection data./
-}
dOMStyleSheetListGetLength ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMStyleSheetList a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMStyleSheetList.DOMStyleSheetList' -}
    -> m CULong
    {- ^ __Returns:__ A @/gulong/@ -}
dOMStyleSheetListGetLength self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_style_sheet_list_get_length self'
    touchManagedPtr self
    return result

#if ENABLE_OVERLOADING
data DOMStyleSheetListGetLengthMethodInfo
instance (signature ~ (m CULong), MonadIO m, IsDOMStyleSheetList a) => O.MethodInfo DOMStyleSheetListGetLengthMethodInfo a signature where
    overloadedMethod _ = dOMStyleSheetListGetLength

#endif

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

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

{-# DEPRECATED dOMStyleSheetListItem ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
{- |
/No description available in the introspection data./
-}
dOMStyleSheetListItem ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMStyleSheetList a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMStyleSheetList.DOMStyleSheetList' -}
    -> CULong
    {- ^ /@index@/: A @/gulong/@ -}
    -> m WebKit2WebExtension.DOMStyleSheet.DOMStyleSheet
    {- ^ __Returns:__ A 'GI.WebKit2WebExtension.Objects.DOMStyleSheet.DOMStyleSheet' -}
dOMStyleSheetListItem self index = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- webkit_dom_style_sheet_list_item self' index
    checkUnexpectedReturnNULL "dOMStyleSheetListItem" result
    result' <- (wrapObject WebKit2WebExtension.DOMStyleSheet.DOMStyleSheet) result
    touchManagedPtr self
    return result'

#if ENABLE_OVERLOADING
data DOMStyleSheetListItemMethodInfo
instance (signature ~ (CULong -> m WebKit2WebExtension.DOMStyleSheet.DOMStyleSheet), MonadIO m, IsDOMStyleSheetList a) => O.MethodInfo DOMStyleSheetListItemMethodInfo a signature where
    overloadedMethod _ = dOMStyleSheetListItem

#endif