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

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


 -- * Methods
-- ** addRule #method:addRule#
    DOMCSSStyleSheetAddRuleMethodInfo       ,
    dOMCSSStyleSheetAddRule                 ,


-- ** deleteRule #method:deleteRule#
    DOMCSSStyleSheetDeleteRuleMethodInfo    ,
    dOMCSSStyleSheetDeleteRule              ,


-- ** getCssRules #method:getCssRules#
    DOMCSSStyleSheetGetCssRulesMethodInfo   ,
    dOMCSSStyleSheetGetCssRules             ,


-- ** getOwnerRule #method:getOwnerRule#
    DOMCSSStyleSheetGetOwnerRuleMethodInfo  ,
    dOMCSSStyleSheetGetOwnerRule            ,


-- ** getRules #method:getRules#
    DOMCSSStyleSheetGetRulesMethodInfo      ,
    dOMCSSStyleSheetGetRules                ,


-- ** insertRule #method:insertRule#
    DOMCSSStyleSheetInsertRuleMethodInfo    ,
    dOMCSSStyleSheetInsertRule              ,


-- ** removeRule #method:removeRule#
    DOMCSSStyleSheetRemoveRuleMethodInfo    ,
    dOMCSSStyleSheetRemoveRule              ,




 -- * Properties
-- ** cssRules #attr:cssRules#
    DOMCSSStyleSheetCssRulesPropertyInfo    ,
    dOMCSSStyleSheetCssRules                ,
    getDOMCSSStyleSheetCssRules             ,


-- ** ownerRule #attr:ownerRule#
    DOMCSSStyleSheetOwnerRulePropertyInfo   ,
    dOMCSSStyleSheetOwnerRule               ,
    getDOMCSSStyleSheetOwnerRule            ,


-- ** rules #attr:rules#
    DOMCSSStyleSheetRulesPropertyInfo       ,
    dOMCSSStyleSheetRules                   ,
    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.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.DOMCSSRuleList as WebKit2WebExtension.DOMCSSRuleList
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMObject as WebKit2WebExtension.DOMObject
import {-# SOURCE #-} qualified GI.WebKit2WebExtension.Objects.DOMStyleSheet as WebKit2WebExtension.DOMStyleSheet

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
    

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

toDOMCSSStyleSheet :: IsDOMCSSStyleSheet o => o -> IO DOMCSSStyleSheet
toDOMCSSStyleSheet = unsafeCastTo DOMCSSStyleSheet

noDOMCSSStyleSheet :: Maybe DOMCSSStyleSheet
noDOMCSSStyleSheet = Nothing

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

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

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

getDOMCSSStyleSheetCssRules :: (MonadIO m, IsDOMCSSStyleSheet o) => o -> m (Maybe WebKit2WebExtension.DOMCSSRuleList.DOMCSSRuleList)
getDOMCSSStyleSheetCssRules obj = liftIO $ getObjectPropertyObject obj "css-rules" WebKit2WebExtension.DOMCSSRuleList.DOMCSSRuleList

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

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

getDOMCSSStyleSheetOwnerRule :: (MonadIO m, IsDOMCSSStyleSheet o) => o -> m (Maybe WebKit2WebExtension.DOMCSSRule.DOMCSSRule)
getDOMCSSStyleSheetOwnerRule obj = liftIO $ getObjectPropertyObject obj "owner-rule" WebKit2WebExtension.DOMCSSRule.DOMCSSRule

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

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

getDOMCSSStyleSheetRules :: (MonadIO m, IsDOMCSSStyleSheet o) => o -> m (Maybe WebKit2WebExtension.DOMCSSRuleList.DOMCSSRuleList)
getDOMCSSStyleSheetRules obj = liftIO $ getObjectPropertyObject obj "rules" WebKit2WebExtension.DOMCSSRuleList.DOMCSSRuleList

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

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, *)])

dOMCSSStyleSheetCssRules :: AttrLabelProxy "cssRules"
dOMCSSStyleSheetCssRules = AttrLabelProxy

dOMCSSStyleSheetOwnerRule :: AttrLabelProxy "ownerRule"
dOMCSSStyleSheetOwnerRule = AttrLabelProxy

dOMCSSStyleSheetRules :: AttrLabelProxy "rules"
dOMCSSStyleSheetRules = AttrLabelProxy

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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