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

-- * Exported types
    DOMCSSStyleSheet(..)                    ,
    IsDOMCSSStyleSheet                      ,
    toDOMCSSStyleSheet                      ,
    noDOMCSSStyleSheet                      ,


 -- * Methods
-- ** addRule #method:addRule#

#if ENABLE_OVERLOADING
    DOMCSSStyleSheetAddRuleMethodInfo       ,
#endif
    dOMCSSStyleSheetAddRule                 ,


-- ** deleteRule #method:deleteRule#

#if ENABLE_OVERLOADING
    DOMCSSStyleSheetDeleteRuleMethodInfo    ,
#endif
    dOMCSSStyleSheetDeleteRule              ,


-- ** getCssRules #method:getCssRules#

#if ENABLE_OVERLOADING
    DOMCSSStyleSheetGetCssRulesMethodInfo   ,
#endif
    dOMCSSStyleSheetGetCssRules             ,


-- ** getOwnerRule #method:getOwnerRule#

#if ENABLE_OVERLOADING
    DOMCSSStyleSheetGetOwnerRuleMethodInfo  ,
#endif
    dOMCSSStyleSheetGetOwnerRule            ,


-- ** getRules #method:getRules#

#if ENABLE_OVERLOADING
    DOMCSSStyleSheetGetRulesMethodInfo      ,
#endif
    dOMCSSStyleSheetGetRules                ,


-- ** insertRule #method:insertRule#

#if ENABLE_OVERLOADING
    DOMCSSStyleSheetInsertRuleMethodInfo    ,
#endif
    dOMCSSStyleSheetInsertRule              ,


-- ** removeRule #method:removeRule#

#if ENABLE_OVERLOADING
    DOMCSSStyleSheetRemoveRuleMethodInfo    ,
#endif
    dOMCSSStyleSheetRemoveRule              ,




 -- * Properties
-- ** cssRules #attr:cssRules#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    DOMCSSStyleSheetCssRulesPropertyInfo    ,
#endif
#if ENABLE_OVERLOADING
    dOMCSSStyleSheetCssRules                ,
#endif
    getDOMCSSStyleSheetCssRules             ,


-- ** ownerRule #attr:ownerRule#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    DOMCSSStyleSheetOwnerRulePropertyInfo   ,
#endif
#if ENABLE_OVERLOADING
    dOMCSSStyleSheetOwnerRule               ,
#endif
    getDOMCSSStyleSheetOwnerRule            ,


-- ** rules #attr:rules#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    DOMCSSStyleSheetRulesPropertyInfo       ,
#endif
#if ENABLE_OVERLOADING
    dOMCSSStyleSheetRules                   ,
#endif
    getDOMCSSStyleSheetRules                ,




    ) 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.DOMCSSRuleList as WebKit2WebExtension.DOMCSSRuleList
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 DOMCSSStyleSheet = DOMCSSStyleSheet (ManagedPtr DOMCSSStyleSheet)
foreign import ccall "webkit_dom_css_style_sheet_get_type"
    c_webkit_dom_css_style_sheet_get_type :: IO GType

instance GObject DOMCSSStyleSheet where
    gobjectType = c_webkit_dom_css_style_sheet_get_type


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

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

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

-- | A convenience alias for `Nothing` :: `Maybe` `DOMCSSStyleSheet`.
noDOMCSSStyleSheet :: Maybe DOMCSSStyleSheet
noDOMCSSStyleSheet = Nothing

#if ENABLE_OVERLOADING
type family ResolveDOMCSSStyleSheetMethod (t :: Symbol) (o :: *) :: * where
    ResolveDOMCSSStyleSheetMethod "addRule" o = DOMCSSStyleSheetAddRuleMethodInfo
    ResolveDOMCSSStyleSheetMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDOMCSSStyleSheetMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDOMCSSStyleSheetMethod "deleteRule" o = DOMCSSStyleSheetDeleteRuleMethodInfo
    ResolveDOMCSSStyleSheetMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDOMCSSStyleSheetMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDOMCSSStyleSheetMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveDOMCSSStyleSheetMethod "insertRule" o = DOMCSSStyleSheetInsertRuleMethodInfo
    ResolveDOMCSSStyleSheetMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDOMCSSStyleSheetMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDOMCSSStyleSheetMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDOMCSSStyleSheetMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDOMCSSStyleSheetMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDOMCSSStyleSheetMethod "removeRule" o = DOMCSSStyleSheetRemoveRuleMethodInfo
    ResolveDOMCSSStyleSheetMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDOMCSSStyleSheetMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDOMCSSStyleSheetMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDOMCSSStyleSheetMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDOMCSSStyleSheetMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDOMCSSStyleSheetMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDOMCSSStyleSheetMethod "getContentType" o = WebKit2WebExtension.DOMStyleSheet.DOMStyleSheetGetContentTypeMethodInfo
    ResolveDOMCSSStyleSheetMethod "getCssRules" o = DOMCSSStyleSheetGetCssRulesMethodInfo
    ResolveDOMCSSStyleSheetMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDOMCSSStyleSheetMethod "getDisabled" o = WebKit2WebExtension.DOMStyleSheet.DOMStyleSheetGetDisabledMethodInfo
    ResolveDOMCSSStyleSheetMethod "getHref" o = WebKit2WebExtension.DOMStyleSheet.DOMStyleSheetGetHrefMethodInfo
    ResolveDOMCSSStyleSheetMethod "getMedia" o = WebKit2WebExtension.DOMStyleSheet.DOMStyleSheetGetMediaMethodInfo
    ResolveDOMCSSStyleSheetMethod "getOwnerNode" o = WebKit2WebExtension.DOMStyleSheet.DOMStyleSheetGetOwnerNodeMethodInfo
    ResolveDOMCSSStyleSheetMethod "getOwnerRule" o = DOMCSSStyleSheetGetOwnerRuleMethodInfo
    ResolveDOMCSSStyleSheetMethod "getParentStyleSheet" o = WebKit2WebExtension.DOMStyleSheet.DOMStyleSheetGetParentStyleSheetMethodInfo
    ResolveDOMCSSStyleSheetMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDOMCSSStyleSheetMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDOMCSSStyleSheetMethod "getRules" o = DOMCSSStyleSheetGetRulesMethodInfo
    ResolveDOMCSSStyleSheetMethod "getTitle" o = WebKit2WebExtension.DOMStyleSheet.DOMStyleSheetGetTitleMethodInfo
    ResolveDOMCSSStyleSheetMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDOMCSSStyleSheetMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveDOMCSSStyleSheetMethod "setDisabled" o = WebKit2WebExtension.DOMStyleSheet.DOMStyleSheetSetDisabledMethodInfo
    ResolveDOMCSSStyleSheetMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDOMCSSStyleSheetMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveDOMCSSStyleSheetMethod t DOMCSSStyleSheet, O.MethodInfo info DOMCSSStyleSheet p) => OL.IsLabel t (DOMCSSStyleSheet -> 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 "css-rules"
   -- Type: TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSRuleList"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

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

@
'Data.GI.Base.Attributes.get' dOMCSSStyleSheet #cssRules
@
-}
getDOMCSSStyleSheetCssRules :: (MonadIO m, IsDOMCSSStyleSheet o) => o -> m (Maybe WebKit2WebExtension.DOMCSSRuleList.DOMCSSRuleList)
getDOMCSSStyleSheetCssRules obj = liftIO $ B.Properties.getObjectPropertyObject obj "css-rules" WebKit2WebExtension.DOMCSSRuleList.DOMCSSRuleList

#if ENABLE_OVERLOADING
data DOMCSSStyleSheetCssRulesPropertyInfo
instance AttrInfo DOMCSSStyleSheetCssRulesPropertyInfo where
    type AttrAllowedOps DOMCSSStyleSheetCssRulesPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DOMCSSStyleSheetCssRulesPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMCSSStyleSheetCssRulesPropertyInfo = IsDOMCSSStyleSheet
    type AttrGetType DOMCSSStyleSheetCssRulesPropertyInfo = (Maybe WebKit2WebExtension.DOMCSSRuleList.DOMCSSRuleList)
    type AttrLabel DOMCSSStyleSheetCssRulesPropertyInfo = "css-rules"
    type AttrOrigin DOMCSSStyleSheetCssRulesPropertyInfo = DOMCSSStyleSheet
    attrGet _ = getDOMCSSStyleSheetCssRules
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

-- VVV Prop "owner-rule"
   -- Type: TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSRule"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

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

@
'Data.GI.Base.Attributes.get' dOMCSSStyleSheet #ownerRule
@
-}
getDOMCSSStyleSheetOwnerRule :: (MonadIO m, IsDOMCSSStyleSheet o) => o -> m (Maybe WebKit2WebExtension.DOMCSSRule.DOMCSSRule)
getDOMCSSStyleSheetOwnerRule obj = liftIO $ B.Properties.getObjectPropertyObject obj "owner-rule" WebKit2WebExtension.DOMCSSRule.DOMCSSRule

#if ENABLE_OVERLOADING
data DOMCSSStyleSheetOwnerRulePropertyInfo
instance AttrInfo DOMCSSStyleSheetOwnerRulePropertyInfo where
    type AttrAllowedOps DOMCSSStyleSheetOwnerRulePropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DOMCSSStyleSheetOwnerRulePropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMCSSStyleSheetOwnerRulePropertyInfo = IsDOMCSSStyleSheet
    type AttrGetType DOMCSSStyleSheetOwnerRulePropertyInfo = (Maybe WebKit2WebExtension.DOMCSSRule.DOMCSSRule)
    type AttrLabel DOMCSSStyleSheetOwnerRulePropertyInfo = "owner-rule"
    type AttrOrigin DOMCSSStyleSheetOwnerRulePropertyInfo = DOMCSSStyleSheet
    attrGet _ = getDOMCSSStyleSheetOwnerRule
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

-- VVV Prop "rules"
   -- Type: TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSRuleList"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

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

@
'Data.GI.Base.Attributes.get' dOMCSSStyleSheet #rules
@
-}
getDOMCSSStyleSheetRules :: (MonadIO m, IsDOMCSSStyleSheet o) => o -> m (Maybe WebKit2WebExtension.DOMCSSRuleList.DOMCSSRuleList)
getDOMCSSStyleSheetRules obj = liftIO $ B.Properties.getObjectPropertyObject obj "rules" WebKit2WebExtension.DOMCSSRuleList.DOMCSSRuleList

#if ENABLE_OVERLOADING
data DOMCSSStyleSheetRulesPropertyInfo
instance AttrInfo DOMCSSStyleSheetRulesPropertyInfo where
    type AttrAllowedOps DOMCSSStyleSheetRulesPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DOMCSSStyleSheetRulesPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMCSSStyleSheetRulesPropertyInfo = IsDOMCSSStyleSheet
    type AttrGetType DOMCSSStyleSheetRulesPropertyInfo = (Maybe WebKit2WebExtension.DOMCSSRuleList.DOMCSSRuleList)
    type AttrLabel DOMCSSStyleSheetRulesPropertyInfo = "rules"
    type AttrOrigin DOMCSSStyleSheetRulesPropertyInfo = DOMCSSStyleSheet
    attrGet _ = getDOMCSSStyleSheetRules
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList DOMCSSStyleSheet
type instance O.AttributeList DOMCSSStyleSheet = DOMCSSStyleSheetAttributeList
type DOMCSSStyleSheetAttributeList = ('[ '("coreObject", WebKit2WebExtension.DOMObject.DOMObjectCoreObjectPropertyInfo), '("cssRules", DOMCSSStyleSheetCssRulesPropertyInfo), '("disabled", WebKit2WebExtension.DOMStyleSheet.DOMStyleSheetDisabledPropertyInfo), '("href", WebKit2WebExtension.DOMStyleSheet.DOMStyleSheetHrefPropertyInfo), '("media", WebKit2WebExtension.DOMStyleSheet.DOMStyleSheetMediaPropertyInfo), '("ownerNode", WebKit2WebExtension.DOMStyleSheet.DOMStyleSheetOwnerNodePropertyInfo), '("ownerRule", DOMCSSStyleSheetOwnerRulePropertyInfo), '("parentStyleSheet", WebKit2WebExtension.DOMStyleSheet.DOMStyleSheetParentStyleSheetPropertyInfo), '("rules", DOMCSSStyleSheetRulesPropertyInfo), '("title", WebKit2WebExtension.DOMStyleSheet.DOMStyleSheetTitlePropertyInfo), '("type", WebKit2WebExtension.DOMStyleSheet.DOMStyleSheetTypePropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
dOMCSSStyleSheetCssRules :: AttrLabelProxy "cssRules"
dOMCSSStyleSheetCssRules = AttrLabelProxy

dOMCSSStyleSheetOwnerRule :: AttrLabelProxy "ownerRule"
dOMCSSStyleSheetOwnerRule = AttrLabelProxy

dOMCSSStyleSheetRules :: AttrLabelProxy "rules"
dOMCSSStyleSheetRules = AttrLabelProxy

#endif

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

#endif

-- method DOMCSSStyleSheet::add_rule
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSStyleSheet"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMCSSStyleSheet", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "selector", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #gchar", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "style", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #gchar", 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 (TBasicType TLong)
-- throws : True
-- Skip return : False

foreign import ccall "webkit_dom_css_style_sheet_add_rule" webkit_dom_css_style_sheet_add_rule ::
    Ptr DOMCSSStyleSheet ->                 -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSStyleSheet"})
    CString ->                              -- selector : TBasicType TUTF8
    CString ->                              -- style : TBasicType TUTF8
    CULong ->                               -- index : TBasicType TULong
    Ptr (Ptr GError) ->                     -- error
    IO CLong

{-# DEPRECATED dOMCSSStyleSheetAddRule ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
{- |
/No description available in the introspection data./
-}
dOMCSSStyleSheetAddRule ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMCSSStyleSheet a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMCSSStyleSheet.DOMCSSStyleSheet' -}
    -> T.Text
    {- ^ /@selector@/: A @/gchar/@ -}
    -> T.Text
    {- ^ /@style@/: A @/gchar/@ -}
    -> CULong
    {- ^ /@index@/: A @/gulong/@ -}
    -> m CLong
    {- ^ __Returns:__ A @/glong/@ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dOMCSSStyleSheetAddRule self selector style index = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    selector' <- textToCString selector
    style' <- textToCString style
    onException (do
        result <- propagateGError $ webkit_dom_css_style_sheet_add_rule self' selector' style' index
        touchManagedPtr self
        freeMem selector'
        freeMem style'
        return result
     ) (do
        freeMem selector'
        freeMem style'
     )

#if ENABLE_OVERLOADING
data DOMCSSStyleSheetAddRuleMethodInfo
instance (signature ~ (T.Text -> T.Text -> CULong -> m CLong), MonadIO m, IsDOMCSSStyleSheet a) => O.MethodInfo DOMCSSStyleSheetAddRuleMethodInfo a signature where
    overloadedMethod _ = dOMCSSStyleSheetAddRule

#endif

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

foreign import ccall "webkit_dom_css_style_sheet_delete_rule" webkit_dom_css_style_sheet_delete_rule ::
    Ptr DOMCSSStyleSheet ->                 -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSStyleSheet"})
    CULong ->                               -- index : TBasicType TULong
    Ptr (Ptr GError) ->                     -- error
    IO ()

{-# DEPRECATED dOMCSSStyleSheetDeleteRule ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
{- |
/No description available in the introspection data./
-}
dOMCSSStyleSheetDeleteRule ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMCSSStyleSheet a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMCSSStyleSheet.DOMCSSStyleSheet' -}
    -> CULong
    {- ^ /@index@/: A @/gulong/@ -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dOMCSSStyleSheetDeleteRule self index = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    onException (do
        propagateGError $ webkit_dom_css_style_sheet_delete_rule self' index
        touchManagedPtr self
        return ()
     ) (do
        return ()
     )

#if ENABLE_OVERLOADING
data DOMCSSStyleSheetDeleteRuleMethodInfo
instance (signature ~ (CULong -> m ()), MonadIO m, IsDOMCSSStyleSheet a) => O.MethodInfo DOMCSSStyleSheetDeleteRuleMethodInfo a signature where
    overloadedMethod _ = dOMCSSStyleSheetDeleteRule

#endif

-- method DOMCSSStyleSheet::get_css_rules
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSStyleSheet"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMCSSStyleSheet", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSRuleList"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_css_style_sheet_get_css_rules" webkit_dom_css_style_sheet_get_css_rules ::
    Ptr DOMCSSStyleSheet ->                 -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSStyleSheet"})
    IO (Ptr WebKit2WebExtension.DOMCSSRuleList.DOMCSSRuleList)

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

#if ENABLE_OVERLOADING
data DOMCSSStyleSheetGetCssRulesMethodInfo
instance (signature ~ (m WebKit2WebExtension.DOMCSSRuleList.DOMCSSRuleList), MonadIO m, IsDOMCSSStyleSheet a) => O.MethodInfo DOMCSSStyleSheetGetCssRulesMethodInfo a signature where
    overloadedMethod _ = dOMCSSStyleSheetGetCssRules

#endif

-- method DOMCSSStyleSheet::get_owner_rule
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSStyleSheet"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMCSSStyleSheet", 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_style_sheet_get_owner_rule" webkit_dom_css_style_sheet_get_owner_rule ::
    Ptr DOMCSSStyleSheet ->                 -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSStyleSheet"})
    IO (Ptr WebKit2WebExtension.DOMCSSRule.DOMCSSRule)

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

#if ENABLE_OVERLOADING
data DOMCSSStyleSheetGetOwnerRuleMethodInfo
instance (signature ~ (m WebKit2WebExtension.DOMCSSRule.DOMCSSRule), MonadIO m, IsDOMCSSStyleSheet a) => O.MethodInfo DOMCSSStyleSheetGetOwnerRuleMethodInfo a signature where
    overloadedMethod _ = dOMCSSStyleSheetGetOwnerRule

#endif

-- method DOMCSSStyleSheet::get_rules
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSStyleSheet"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMCSSStyleSheet", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSRuleList"}))
-- throws : False
-- Skip return : False

foreign import ccall "webkit_dom_css_style_sheet_get_rules" webkit_dom_css_style_sheet_get_rules ::
    Ptr DOMCSSStyleSheet ->                 -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSStyleSheet"})
    IO (Ptr WebKit2WebExtension.DOMCSSRuleList.DOMCSSRuleList)

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

#if ENABLE_OVERLOADING
data DOMCSSStyleSheetGetRulesMethodInfo
instance (signature ~ (m WebKit2WebExtension.DOMCSSRuleList.DOMCSSRuleList), MonadIO m, IsDOMCSSStyleSheet a) => O.MethodInfo DOMCSSStyleSheetGetRulesMethodInfo a signature where
    overloadedMethod _ = dOMCSSStyleSheetGetRules

#endif

-- method DOMCSSStyleSheet::insert_rule
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSStyleSheet"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMCSSStyleSheet", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "rule", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #gchar", 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 (TBasicType TULong)
-- throws : True
-- Skip return : False

foreign import ccall "webkit_dom_css_style_sheet_insert_rule" webkit_dom_css_style_sheet_insert_rule ::
    Ptr DOMCSSStyleSheet ->                 -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSStyleSheet"})
    CString ->                              -- rule : TBasicType TUTF8
    CULong ->                               -- index : TBasicType TULong
    Ptr (Ptr GError) ->                     -- error
    IO CULong

{-# DEPRECATED dOMCSSStyleSheetInsertRule ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
{- |
/No description available in the introspection data./
-}
dOMCSSStyleSheetInsertRule ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMCSSStyleSheet a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMCSSStyleSheet.DOMCSSStyleSheet' -}
    -> T.Text
    {- ^ /@rule@/: A @/gchar/@ -}
    -> CULong
    {- ^ /@index@/: A @/gulong/@ -}
    -> m CULong
    {- ^ __Returns:__ A @/gulong/@ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dOMCSSStyleSheetInsertRule self rule index = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    rule' <- textToCString rule
    onException (do
        result <- propagateGError $ webkit_dom_css_style_sheet_insert_rule self' rule' index
        touchManagedPtr self
        freeMem rule'
        return result
     ) (do
        freeMem rule'
     )

#if ENABLE_OVERLOADING
data DOMCSSStyleSheetInsertRuleMethodInfo
instance (signature ~ (T.Text -> CULong -> m CULong), MonadIO m, IsDOMCSSStyleSheet a) => O.MethodInfo DOMCSSStyleSheetInsertRuleMethodInfo a signature where
    overloadedMethod _ = dOMCSSStyleSheetInsertRule

#endif

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

foreign import ccall "webkit_dom_css_style_sheet_remove_rule" webkit_dom_css_style_sheet_remove_rule ::
    Ptr DOMCSSStyleSheet ->                 -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSStyleSheet"})
    CULong ->                               -- index : TBasicType TULong
    Ptr (Ptr GError) ->                     -- error
    IO ()

{-# DEPRECATED dOMCSSStyleSheetRemoveRule ["(Since version 2.22)","Use JavaScriptCore API instead"] #-}
{- |
/No description available in the introspection data./
-}
dOMCSSStyleSheetRemoveRule ::
    (B.CallStack.HasCallStack, MonadIO m, IsDOMCSSStyleSheet a) =>
    a
    {- ^ /@self@/: A 'GI.WebKit2WebExtension.Objects.DOMCSSStyleSheet.DOMCSSStyleSheet' -}
    -> CULong
    {- ^ /@index@/: A @/gulong/@ -}
    -> m ()
    {- ^ /(Can throw 'Data.GI.Base.GError.GError')/ -}
dOMCSSStyleSheetRemoveRule self index = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    onException (do
        propagateGError $ webkit_dom_css_style_sheet_remove_rule self' index
        touchManagedPtr self
        return ()
     ) (do
        return ()
     )

#if ENABLE_OVERLOADING
data DOMCSSStyleSheetRemoveRuleMethodInfo
instance (signature ~ (CULong -> m ()), MonadIO m, IsDOMCSSStyleSheet a) => O.MethodInfo DOMCSSStyleSheetRemoveRuleMethodInfo a signature where
    overloadedMethod _ = dOMCSSStyleSheetRemoveRule

#endif