module GI.WebKit.Objects.DOMCSSStyleSheet
(
DOMCSSStyleSheet(..) ,
DOMCSSStyleSheetK ,
toDOMCSSStyleSheet ,
noDOMCSSStyleSheet ,
dOMCSSStyleSheetAddRule ,
dOMCSSStyleSheetDeleteRule ,
dOMCSSStyleSheetGetCssRules ,
dOMCSSStyleSheetGetOwnerRule ,
dOMCSSStyleSheetGetRules ,
dOMCSSStyleSheetInsertRule ,
dOMCSSStyleSheetRemoveRule ,
DOMCSSStyleSheetCssRulesPropertyInfo ,
getDOMCSSStyleSheetCssRules ,
DOMCSSStyleSheetOwnerRulePropertyInfo ,
getDOMCSSStyleSheetOwnerRule ,
DOMCSSStyleSheetRulesPropertyInfo ,
getDOMCSSStyleSheetRules ,
) where
import Prelude ()
import Data.GI.Base.ShortPrelude
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import GI.WebKit.Types
import GI.WebKit.Callbacks
import qualified GI.GObject as GObject
newtype DOMCSSStyleSheet = DOMCSSStyleSheet (ForeignPtr DOMCSSStyleSheet)
foreign import ccall "webkit_dom_css_style_sheet_get_type"
c_webkit_dom_css_style_sheet_get_type :: IO GType
type instance ParentTypes DOMCSSStyleSheet = DOMCSSStyleSheetParentTypes
type DOMCSSStyleSheetParentTypes = '[DOMStyleSheet, DOMObject, GObject.Object]
instance GObject DOMCSSStyleSheet where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_webkit_dom_css_style_sheet_get_type
class GObject o => DOMCSSStyleSheetK o
instance (GObject o, IsDescendantOf DOMCSSStyleSheet o) => DOMCSSStyleSheetK o
toDOMCSSStyleSheet :: DOMCSSStyleSheetK o => o -> IO DOMCSSStyleSheet
toDOMCSSStyleSheet = unsafeCastTo DOMCSSStyleSheet
noDOMCSSStyleSheet :: Maybe DOMCSSStyleSheet
noDOMCSSStyleSheet = Nothing
getDOMCSSStyleSheetCssRules :: (MonadIO m, DOMCSSStyleSheetK o) => o -> m DOMCSSRuleList
getDOMCSSStyleSheetCssRules obj = liftIO $ getObjectPropertyObject obj "css-rules" DOMCSSRuleList
data DOMCSSStyleSheetCssRulesPropertyInfo
instance AttrInfo DOMCSSStyleSheetCssRulesPropertyInfo where
type AttrAllowedOps DOMCSSStyleSheetCssRulesPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMCSSStyleSheetCssRulesPropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMCSSStyleSheetCssRulesPropertyInfo = DOMCSSStyleSheetK
type AttrGetType DOMCSSStyleSheetCssRulesPropertyInfo = DOMCSSRuleList
type AttrLabel DOMCSSStyleSheetCssRulesPropertyInfo = "DOMCSSStyleSheet::css-rules"
attrGet _ = getDOMCSSStyleSheetCssRules
attrSet _ = undefined
attrConstruct _ = undefined
getDOMCSSStyleSheetOwnerRule :: (MonadIO m, DOMCSSStyleSheetK o) => o -> m DOMCSSRule
getDOMCSSStyleSheetOwnerRule obj = liftIO $ getObjectPropertyObject obj "owner-rule" DOMCSSRule
data DOMCSSStyleSheetOwnerRulePropertyInfo
instance AttrInfo DOMCSSStyleSheetOwnerRulePropertyInfo where
type AttrAllowedOps DOMCSSStyleSheetOwnerRulePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMCSSStyleSheetOwnerRulePropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMCSSStyleSheetOwnerRulePropertyInfo = DOMCSSStyleSheetK
type AttrGetType DOMCSSStyleSheetOwnerRulePropertyInfo = DOMCSSRule
type AttrLabel DOMCSSStyleSheetOwnerRulePropertyInfo = "DOMCSSStyleSheet::owner-rule"
attrGet _ = getDOMCSSStyleSheetOwnerRule
attrSet _ = undefined
attrConstruct _ = undefined
getDOMCSSStyleSheetRules :: (MonadIO m, DOMCSSStyleSheetK o) => o -> m DOMCSSRuleList
getDOMCSSStyleSheetRules obj = liftIO $ getObjectPropertyObject obj "rules" DOMCSSRuleList
data DOMCSSStyleSheetRulesPropertyInfo
instance AttrInfo DOMCSSStyleSheetRulesPropertyInfo where
type AttrAllowedOps DOMCSSStyleSheetRulesPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMCSSStyleSheetRulesPropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMCSSStyleSheetRulesPropertyInfo = DOMCSSStyleSheetK
type AttrGetType DOMCSSStyleSheetRulesPropertyInfo = DOMCSSRuleList
type AttrLabel DOMCSSStyleSheetRulesPropertyInfo = "DOMCSSStyleSheet::rules"
attrGet _ = getDOMCSSStyleSheetRules
attrSet _ = undefined
attrConstruct _ = undefined
type instance AttributeList DOMCSSStyleSheet = DOMCSSStyleSheetAttributeList
type DOMCSSStyleSheetAttributeList = ('[ '("core-object", DOMObjectCoreObjectPropertyInfo), '("css-rules", DOMCSSStyleSheetCssRulesPropertyInfo), '("disabled", DOMStyleSheetDisabledPropertyInfo), '("href", DOMStyleSheetHrefPropertyInfo), '("media", DOMStyleSheetMediaPropertyInfo), '("owner-node", DOMStyleSheetOwnerNodePropertyInfo), '("owner-rule", DOMCSSStyleSheetOwnerRulePropertyInfo), '("parent-style-sheet", DOMStyleSheetParentStyleSheetPropertyInfo), '("rules", DOMCSSStyleSheetRulesPropertyInfo), '("title", DOMStyleSheetTitlePropertyInfo), '("type", DOMStyleSheetTypePropertyInfo)] :: [(Symbol, *)])
type instance SignalList DOMCSSStyleSheet = DOMCSSStyleSheetSignalList
type DOMCSSStyleSheetSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "webkit_dom_css_style_sheet_add_rule" webkit_dom_css_style_sheet_add_rule ::
Ptr DOMCSSStyleSheet ->
CString ->
CString ->
Word64 ->
Ptr (Ptr GError) ->
IO Int64
dOMCSSStyleSheetAddRule ::
(MonadIO m, DOMCSSStyleSheetK a) =>
a ->
T.Text ->
T.Text ->
Word64 ->
m Int64
dOMCSSStyleSheetAddRule _obj selector style index = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
selector' <- textToCString selector
style' <- textToCString style
onException (do
result <- propagateGError $ webkit_dom_css_style_sheet_add_rule _obj' selector' style' index
touchManagedPtr _obj
freeMem selector'
freeMem style'
return result
) (do
freeMem selector'
freeMem style'
)
foreign import ccall "webkit_dom_css_style_sheet_delete_rule" webkit_dom_css_style_sheet_delete_rule ::
Ptr DOMCSSStyleSheet ->
Word64 ->
Ptr (Ptr GError) ->
IO ()
dOMCSSStyleSheetDeleteRule ::
(MonadIO m, DOMCSSStyleSheetK a) =>
a ->
Word64 ->
m ()
dOMCSSStyleSheetDeleteRule _obj index = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
onException (do
propagateGError $ webkit_dom_css_style_sheet_delete_rule _obj' index
touchManagedPtr _obj
return ()
) (do
return ()
)
foreign import ccall "webkit_dom_css_style_sheet_get_css_rules" webkit_dom_css_style_sheet_get_css_rules ::
Ptr DOMCSSStyleSheet ->
IO (Ptr DOMCSSRuleList)
dOMCSSStyleSheetGetCssRules ::
(MonadIO m, DOMCSSStyleSheetK a) =>
a ->
m DOMCSSRuleList
dOMCSSStyleSheetGetCssRules _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_css_style_sheet_get_css_rules _obj'
checkUnexpectedReturnNULL "webkit_dom_css_style_sheet_get_css_rules" result
result' <- (wrapObject DOMCSSRuleList) result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_dom_css_style_sheet_get_owner_rule" webkit_dom_css_style_sheet_get_owner_rule ::
Ptr DOMCSSStyleSheet ->
IO (Ptr DOMCSSRule)
dOMCSSStyleSheetGetOwnerRule ::
(MonadIO m, DOMCSSStyleSheetK a) =>
a ->
m DOMCSSRule
dOMCSSStyleSheetGetOwnerRule _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_css_style_sheet_get_owner_rule _obj'
checkUnexpectedReturnNULL "webkit_dom_css_style_sheet_get_owner_rule" result
result' <- (wrapObject DOMCSSRule) result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_dom_css_style_sheet_get_rules" webkit_dom_css_style_sheet_get_rules ::
Ptr DOMCSSStyleSheet ->
IO (Ptr DOMCSSRuleList)
dOMCSSStyleSheetGetRules ::
(MonadIO m, DOMCSSStyleSheetK a) =>
a ->
m DOMCSSRuleList
dOMCSSStyleSheetGetRules _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_css_style_sheet_get_rules _obj'
checkUnexpectedReturnNULL "webkit_dom_css_style_sheet_get_rules" result
result' <- (wrapObject DOMCSSRuleList) result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_dom_css_style_sheet_insert_rule" webkit_dom_css_style_sheet_insert_rule ::
Ptr DOMCSSStyleSheet ->
CString ->
Word64 ->
Ptr (Ptr GError) ->
IO Word64
dOMCSSStyleSheetInsertRule ::
(MonadIO m, DOMCSSStyleSheetK a) =>
a ->
T.Text ->
Word64 ->
m Word64
dOMCSSStyleSheetInsertRule _obj rule index = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
rule' <- textToCString rule
onException (do
result <- propagateGError $ webkit_dom_css_style_sheet_insert_rule _obj' rule' index
touchManagedPtr _obj
freeMem rule'
return result
) (do
freeMem rule'
)
foreign import ccall "webkit_dom_css_style_sheet_remove_rule" webkit_dom_css_style_sheet_remove_rule ::
Ptr DOMCSSStyleSheet ->
Word64 ->
Ptr (Ptr GError) ->
IO ()
dOMCSSStyleSheetRemoveRule ::
(MonadIO m, DOMCSSStyleSheetK a) =>
a ->
Word64 ->
m ()
dOMCSSStyleSheetRemoveRule _obj index = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
onException (do
propagateGError $ webkit_dom_css_style_sheet_remove_rule _obj' index
touchManagedPtr _obj
return ()
) (do
return ()
)