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

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


 -- * Methods
-- ** getLength #method:getLength#
    DOMCSSRuleListGetLengthMethodInfo       ,
    dOMCSSRuleListGetLength                 ,


-- ** item #method:item#
    DOMCSSRuleListItemMethodInfo            ,
    dOMCSSRuleListItem                      ,




 -- * Properties
-- ** length #attr:length#
    DOMCSSRuleListLengthPropertyInfo        ,
    dOMCSSRuleListLength                    ,
    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.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.DOMCSSRule as WebKit2WebExtension.DOMCSSRule
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMObject as WebKit2WebExtension.DOMObject

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
    

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

toDOMCSSRuleList :: IsDOMCSSRuleList o => o -> IO DOMCSSRuleList
toDOMCSSRuleList = unsafeCastTo DOMCSSRuleList

noDOMCSSRuleList :: Maybe DOMCSSRuleList
noDOMCSSRuleList = Nothing

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 "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 "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveDOMCSSRuleListMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    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) => O.IsLabelProxy t (DOMCSSRuleList -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDOMCSSRuleListMethod t DOMCSSRuleList, O.MethodInfo info DOMCSSRuleList p) => O.IsLabel t (DOMCSSRuleList -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

-- VVV Prop "length"
   -- Type: TBasicType TULong
   -- Flags: [PropertyReadable]
   -- Nullable: (Just False,Nothing)

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

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

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

dOMCSSRuleListLength :: AttrLabelProxy "length"
dOMCSSRuleListLength = AttrLabelProxy

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

-- 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

{- |
/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

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

-- 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)

{- |
/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'

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