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

-- * Exported types
    DOMCSSRule(..)                          ,
    IsDOMCSSRule                            ,
    toDOMCSSRule                            ,
    noDOMCSSRule                            ,


 -- * Methods
-- ** getCssText #method:getCssText#

#if ENABLE_OVERLOADING
    DOMCSSRuleGetCssTextMethodInfo          ,
#endif
    dOMCSSRuleGetCssText                    ,


-- ** getParentRule #method:getParentRule#

#if ENABLE_OVERLOADING
    DOMCSSRuleGetParentRuleMethodInfo       ,
#endif
    dOMCSSRuleGetParentRule                 ,


-- ** getParentStyleSheet #method:getParentStyleSheet#

#if ENABLE_OVERLOADING
    DOMCSSRuleGetParentStyleSheetMethodInfo ,
#endif
    dOMCSSRuleGetParentStyleSheet           ,


-- ** getRuleType #method:getRuleType#

#if ENABLE_OVERLOADING
    DOMCSSRuleGetRuleTypeMethodInfo         ,
#endif
    dOMCSSRuleGetRuleType                   ,


-- ** setCssText #method:setCssText#

#if ENABLE_OVERLOADING
    DOMCSSRuleSetCssTextMethodInfo          ,
#endif
    dOMCSSRuleSetCssText                    ,




 -- * Properties
-- ** cssText #attr:cssText#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    DOMCSSRuleCssTextPropertyInfo           ,
#endif
    clearDOMCSSRuleCssText                  ,
    constructDOMCSSRuleCssText              ,
#if ENABLE_OVERLOADING
    dOMCSSRuleCssText                       ,
#endif
    getDOMCSSRuleCssText                    ,
    setDOMCSSRuleCssText                    ,


-- ** parentRule #attr:parentRule#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    DOMCSSRuleParentRulePropertyInfo        ,
#endif
#if ENABLE_OVERLOADING
    dOMCSSRuleParentRule                    ,
#endif
    getDOMCSSRuleParentRule                 ,


-- ** parentStyleSheet #attr:parentStyleSheet#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    DOMCSSRuleParentStyleSheetPropertyInfo  ,
#endif
#if ENABLE_OVERLOADING
    dOMCSSRuleParentStyleSheet              ,
#endif
    getDOMCSSRuleParentStyleSheet           ,


-- ** type #attr:type#
{- | /No description available in the introspection data./
-}
#if ENABLE_OVERLOADING
    DOMCSSRuleTypePropertyInfo              ,
#endif
#if ENABLE_OVERLOADING
    dOMCSSRuleType                          ,
#endif
    getDOMCSSRuleType                       ,




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

-- | Memory-managed wrapper type.
newtype DOMCSSRule = DOMCSSRule (ManagedPtr DOMCSSRule)
foreign import ccall "webkit_dom_css_rule_get_type"
    c_webkit_dom_css_rule_get_type :: IO GType

instance GObject DOMCSSRule where
    gobjectType = c_webkit_dom_css_rule_get_type


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

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

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

-- | A convenience alias for `Nothing` :: `Maybe` `DOMCSSRule`.
noDOMCSSRule :: Maybe DOMCSSRule
noDOMCSSRule = Nothing

#if ENABLE_OVERLOADING
type family ResolveDOMCSSRuleMethod (t :: Symbol) (o :: *) :: * where
    ResolveDOMCSSRuleMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveDOMCSSRuleMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveDOMCSSRuleMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveDOMCSSRuleMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveDOMCSSRuleMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveDOMCSSRuleMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveDOMCSSRuleMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveDOMCSSRuleMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveDOMCSSRuleMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveDOMCSSRuleMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveDOMCSSRuleMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveDOMCSSRuleMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveDOMCSSRuleMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveDOMCSSRuleMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveDOMCSSRuleMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveDOMCSSRuleMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveDOMCSSRuleMethod "getCssText" o = DOMCSSRuleGetCssTextMethodInfo
    ResolveDOMCSSRuleMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveDOMCSSRuleMethod "getParentRule" o = DOMCSSRuleGetParentRuleMethodInfo
    ResolveDOMCSSRuleMethod "getParentStyleSheet" o = DOMCSSRuleGetParentStyleSheetMethodInfo
    ResolveDOMCSSRuleMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveDOMCSSRuleMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveDOMCSSRuleMethod "getRuleType" o = DOMCSSRuleGetRuleTypeMethodInfo
    ResolveDOMCSSRuleMethod "setCssText" o = DOMCSSRuleSetCssTextMethodInfo
    ResolveDOMCSSRuleMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveDOMCSSRuleMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveDOMCSSRuleMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveDOMCSSRuleMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveDOMCSSRuleMethod t DOMCSSRule, O.MethodInfo info DOMCSSRule p) => OL.IsLabel t (DOMCSSRule -> 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-text"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

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

@
'Data.GI.Base.Attributes.get' dOMCSSRule #cssText
@
-}
getDOMCSSRuleCssText :: (MonadIO m, IsDOMCSSRule o) => o -> m (Maybe T.Text)
getDOMCSSRuleCssText obj = liftIO $ B.Properties.getObjectPropertyString obj "css-text"

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

@
'Data.GI.Base.Attributes.set' dOMCSSRule [ #cssText 'Data.GI.Base.Attributes.:=' value ]
@
-}
setDOMCSSRuleCssText :: (MonadIO m, IsDOMCSSRule o) => o -> T.Text -> m ()
setDOMCSSRuleCssText obj val = liftIO $ B.Properties.setObjectPropertyString obj "css-text" (Just val)

{- |
Construct a `GValueConstruct` with valid value for the “@css-text@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructDOMCSSRuleCssText :: (IsDOMCSSRule o) => T.Text -> IO (GValueConstruct o)
constructDOMCSSRuleCssText val = B.Properties.constructObjectPropertyString "css-text" (Just val)

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

@
'Data.GI.Base.Attributes.clear' #cssText
@
-}
clearDOMCSSRuleCssText :: (MonadIO m, IsDOMCSSRule o) => o -> m ()
clearDOMCSSRuleCssText obj = liftIO $ B.Properties.setObjectPropertyString obj "css-text" (Nothing :: Maybe T.Text)

#if ENABLE_OVERLOADING
data DOMCSSRuleCssTextPropertyInfo
instance AttrInfo DOMCSSRuleCssTextPropertyInfo where
    type AttrAllowedOps DOMCSSRuleCssTextPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DOMCSSRuleCssTextPropertyInfo = (~) T.Text
    type AttrBaseTypeConstraint DOMCSSRuleCssTextPropertyInfo = IsDOMCSSRule
    type AttrGetType DOMCSSRuleCssTextPropertyInfo = (Maybe T.Text)
    type AttrLabel DOMCSSRuleCssTextPropertyInfo = "css-text"
    type AttrOrigin DOMCSSRuleCssTextPropertyInfo = DOMCSSRule
    attrGet _ = getDOMCSSRuleCssText
    attrSet _ = setDOMCSSRuleCssText
    attrConstruct _ = constructDOMCSSRuleCssText
    attrClear _ = clearDOMCSSRuleCssText
#endif

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

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

@
'Data.GI.Base.Attributes.get' dOMCSSRule #parentRule
@
-}
getDOMCSSRuleParentRule :: (MonadIO m, IsDOMCSSRule o) => o -> m (Maybe DOMCSSRule)
getDOMCSSRuleParentRule obj = liftIO $ B.Properties.getObjectPropertyObject obj "parent-rule" DOMCSSRule

#if ENABLE_OVERLOADING
data DOMCSSRuleParentRulePropertyInfo
instance AttrInfo DOMCSSRuleParentRulePropertyInfo where
    type AttrAllowedOps DOMCSSRuleParentRulePropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DOMCSSRuleParentRulePropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMCSSRuleParentRulePropertyInfo = IsDOMCSSRule
    type AttrGetType DOMCSSRuleParentRulePropertyInfo = (Maybe DOMCSSRule)
    type AttrLabel DOMCSSRuleParentRulePropertyInfo = "parent-rule"
    type AttrOrigin DOMCSSRuleParentRulePropertyInfo = DOMCSSRule
    attrGet _ = getDOMCSSRuleParentRule
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

-- VVV Prop "parent-style-sheet"
   -- Type: TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSStyleSheet"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

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

@
'Data.GI.Base.Attributes.get' dOMCSSRule #parentStyleSheet
@
-}
getDOMCSSRuleParentStyleSheet :: (MonadIO m, IsDOMCSSRule o) => o -> m (Maybe WebKit2WebExtension.DOMCSSStyleSheet.DOMCSSStyleSheet)
getDOMCSSRuleParentStyleSheet obj = liftIO $ B.Properties.getObjectPropertyObject obj "parent-style-sheet" WebKit2WebExtension.DOMCSSStyleSheet.DOMCSSStyleSheet

#if ENABLE_OVERLOADING
data DOMCSSRuleParentStyleSheetPropertyInfo
instance AttrInfo DOMCSSRuleParentStyleSheetPropertyInfo where
    type AttrAllowedOps DOMCSSRuleParentStyleSheetPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint DOMCSSRuleParentStyleSheetPropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMCSSRuleParentStyleSheetPropertyInfo = IsDOMCSSRule
    type AttrGetType DOMCSSRuleParentStyleSheetPropertyInfo = (Maybe WebKit2WebExtension.DOMCSSStyleSheet.DOMCSSStyleSheet)
    type AttrLabel DOMCSSRuleParentStyleSheetPropertyInfo = "parent-style-sheet"
    type AttrOrigin DOMCSSRuleParentStyleSheetPropertyInfo = DOMCSSRule
    attrGet _ = getDOMCSSRuleParentStyleSheet
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

-- VVV Prop "type"
   -- Type: TBasicType TUInt
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

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

@
'Data.GI.Base.Attributes.get' dOMCSSRule #type
@
-}
getDOMCSSRuleType :: (MonadIO m, IsDOMCSSRule o) => o -> m Word32
getDOMCSSRuleType obj = liftIO $ B.Properties.getObjectPropertyUInt32 obj "type"

#if ENABLE_OVERLOADING
data DOMCSSRuleTypePropertyInfo
instance AttrInfo DOMCSSRuleTypePropertyInfo where
    type AttrAllowedOps DOMCSSRuleTypePropertyInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint DOMCSSRuleTypePropertyInfo = (~) ()
    type AttrBaseTypeConstraint DOMCSSRuleTypePropertyInfo = IsDOMCSSRule
    type AttrGetType DOMCSSRuleTypePropertyInfo = Word32
    type AttrLabel DOMCSSRuleTypePropertyInfo = "type"
    type AttrOrigin DOMCSSRuleTypePropertyInfo = DOMCSSRule
    attrGet _ = getDOMCSSRuleType
    attrSet _ = undefined
    attrConstruct _ = undefined
    attrClear _ = undefined
#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList DOMCSSRule
type instance O.AttributeList DOMCSSRule = DOMCSSRuleAttributeList
type DOMCSSRuleAttributeList = ('[ '("coreObject", WebKit2WebExtension.DOMObject.DOMObjectCoreObjectPropertyInfo), '("cssText", DOMCSSRuleCssTextPropertyInfo), '("parentRule", DOMCSSRuleParentRulePropertyInfo), '("parentStyleSheet", DOMCSSRuleParentStyleSheetPropertyInfo), '("type", DOMCSSRuleTypePropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
dOMCSSRuleCssText :: AttrLabelProxy "cssText"
dOMCSSRuleCssText = AttrLabelProxy

dOMCSSRuleParentRule :: AttrLabelProxy "parentRule"
dOMCSSRuleParentRule = AttrLabelProxy

dOMCSSRuleParentStyleSheet :: AttrLabelProxy "parentStyleSheet"
dOMCSSRuleParentStyleSheet = AttrLabelProxy

dOMCSSRuleType :: AttrLabelProxy "type"
dOMCSSRuleType = AttrLabelProxy

#endif

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

#endif

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

foreign import ccall "webkit_dom_css_rule_get_css_text" webkit_dom_css_rule_get_css_text ::
    Ptr DOMCSSRule ->                       -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSRule"})
    IO CString

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

#if ENABLE_OVERLOADING
data DOMCSSRuleGetCssTextMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDOMCSSRule a) => O.MethodInfo DOMCSSRuleGetCssTextMethodInfo a signature where
    overloadedMethod _ = dOMCSSRuleGetCssText

#endif

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

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

#if ENABLE_OVERLOADING
data DOMCSSRuleGetParentRuleMethodInfo
instance (signature ~ (m DOMCSSRule), MonadIO m, IsDOMCSSRule a) => O.MethodInfo DOMCSSRuleGetParentRuleMethodInfo a signature where
    overloadedMethod _ = dOMCSSRuleGetParentRule

#endif

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

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

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

#if ENABLE_OVERLOADING
data DOMCSSRuleGetParentStyleSheetMethodInfo
instance (signature ~ (m WebKit2WebExtension.DOMCSSStyleSheet.DOMCSSStyleSheet), MonadIO m, IsDOMCSSRule a) => O.MethodInfo DOMCSSRuleGetParentStyleSheetMethodInfo a signature where
    overloadedMethod _ = dOMCSSRuleGetParentStyleSheet

#endif

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

foreign import ccall "webkit_dom_css_rule_get_rule_type" webkit_dom_css_rule_get_rule_type ::
    Ptr DOMCSSRule ->                       -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSRule"})
    IO Word16

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

#if ENABLE_OVERLOADING
data DOMCSSRuleGetRuleTypeMethodInfo
instance (signature ~ (m Word16), MonadIO m, IsDOMCSSRule a) => O.MethodInfo DOMCSSRuleGetRuleTypeMethodInfo a signature where
    overloadedMethod _ = dOMCSSRuleGetRuleType

#endif

-- method DOMCSSRule::set_css_text
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "self", argType = TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSRule"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #WebKitDOMCSSRule", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", 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}]
-- Lengths : []
-- returnType : Nothing
-- throws : True
-- Skip return : False

foreign import ccall "webkit_dom_css_rule_set_css_text" webkit_dom_css_rule_set_css_text ::
    Ptr DOMCSSRule ->                       -- self : TInterface (Name {namespace = "WebKit2WebExtension", name = "DOMCSSRule"})
    CString ->                              -- value : TBasicType TUTF8
    Ptr (Ptr GError) ->                     -- error
    IO ()

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

#if ENABLE_OVERLOADING
data DOMCSSRuleSetCssTextMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsDOMCSSRule a) => O.MethodInfo DOMCSSRuleSetCssTextMethodInfo a signature where
    overloadedMethod _ = dOMCSSRuleSetCssText

#endif