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

-- * Exported types
    DOMCSSRuleList(..)                      ,
    IsDOMCSSRuleList                        ,
    toDOMCSSRuleList                        ,
    noDOMCSSRuleList                        ,


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

#if ENABLE_OVERLOADING
    DOMCSSRuleListGetLengthMethodInfo       ,
#endif
    dOMCSSRuleListGetLength                 ,


-- ** item #method:item#

#if ENABLE_OVERLOADING
    DOMCSSRuleListItemMethodInfo            ,
#endif
    dOMCSSRuleListItem                      ,




 -- * Properties
-- ** length #attr:length#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    DOMCSSRuleListLengthPropertyInfo        ,
#endif
#if ENABLE_OVERLOADING
    dOMCSSRuleListLength                    ,
#endif
    getDOMCSSRuleListLength                 ,




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

-- | Memory-managed wrapper type.
newtype DOMCSSRuleList = DOMCSSRuleList (ManagedPtr DOMCSSRuleList)
foreign import ccall "webkit_dom_css_rule_list_get_type"
    c_webkit_dom_css_rule_list_get_type :: IO GType

instance GObject DOMCSSRuleList where
    gobjectType = c_webkit_dom_css_rule_list_get_type


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

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

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

-- | A convenience alias for `Nothing` :: `Maybe` `DOMCSSRuleList`.
noDOMCSSRuleList :: Maybe DOMCSSRuleList
noDOMCSSRuleList = Nothing

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

instance (info ~ ResolveDOMCSSRuleListMethod t DOMCSSRuleList, O.MethodInfo info DOMCSSRuleList p) => OL.IsLabel t (DOMCSSRuleList -> 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' dOMCSSRuleList #length
@
-}
getDOMCSSRuleListLength :: (MonadIO m, IsDOMCSSRuleList o) => o -> m CULong
getDOMCSSRuleListLength obj = liftIO $ B.Properties.getObjectPropertyULong obj "length"

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

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

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

#endif

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

#endif

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

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

#if ENABLE_OVERLOADING
data DOMCSSRuleListGetLengthMethodInfo
instance (signature ~ (m CULong), MonadIO m, IsDOMCSSRuleList a) => O.MethodInfo DOMCSSRuleListGetLengthMethodInfo a signature where
    overloadedMethod _ = dOMCSSRuleListGetLength

#endif

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

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

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

#if ENABLE_OVERLOADING
data DOMCSSRuleListItemMethodInfo
instance (signature ~ (CULong -> m WebKit2WebExtension.DOMCSSRule.DOMCSSRule), MonadIO m, IsDOMCSSRuleList a) => O.MethodInfo DOMCSSRuleListItemMethodInfo a signature where
    overloadedMethod _ = dOMCSSRuleListItem

#endif