module GI.WebKit.Objects.DOMStyleSheet
(
DOMStyleSheet(..) ,
DOMStyleSheetK ,
toDOMStyleSheet ,
noDOMStyleSheet ,
dOMStyleSheetGetDisabled ,
dOMStyleSheetGetHref ,
dOMStyleSheetGetMedia ,
dOMStyleSheetGetOwnerNode ,
dOMStyleSheetGetParentStyleSheet ,
dOMStyleSheetGetTitle ,
dOMStyleSheetSetDisabled ,
DOMStyleSheetDisabledPropertyInfo ,
constructDOMStyleSheetDisabled ,
getDOMStyleSheetDisabled ,
setDOMStyleSheetDisabled ,
DOMStyleSheetHrefPropertyInfo ,
getDOMStyleSheetHref ,
DOMStyleSheetMediaPropertyInfo ,
getDOMStyleSheetMedia ,
DOMStyleSheetOwnerNodePropertyInfo ,
getDOMStyleSheetOwnerNode ,
DOMStyleSheetParentStyleSheetPropertyInfo,
getDOMStyleSheetParentStyleSheet ,
DOMStyleSheetTitlePropertyInfo ,
getDOMStyleSheetTitle ,
DOMStyleSheetTypePropertyInfo ,
getDOMStyleSheetType ,
) 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 DOMStyleSheet = DOMStyleSheet (ForeignPtr DOMStyleSheet)
foreign import ccall "webkit_dom_style_sheet_get_type"
c_webkit_dom_style_sheet_get_type :: IO GType
type instance ParentTypes DOMStyleSheet = DOMStyleSheetParentTypes
type DOMStyleSheetParentTypes = '[DOMObject, GObject.Object]
instance GObject DOMStyleSheet where
gobjectIsInitiallyUnowned _ = False
gobjectType _ = c_webkit_dom_style_sheet_get_type
class GObject o => DOMStyleSheetK o
instance (GObject o, IsDescendantOf DOMStyleSheet o) => DOMStyleSheetK o
toDOMStyleSheet :: DOMStyleSheetK o => o -> IO DOMStyleSheet
toDOMStyleSheet = unsafeCastTo DOMStyleSheet
noDOMStyleSheet :: Maybe DOMStyleSheet
noDOMStyleSheet = Nothing
getDOMStyleSheetDisabled :: (MonadIO m, DOMStyleSheetK o) => o -> m Bool
getDOMStyleSheetDisabled obj = liftIO $ getObjectPropertyBool obj "disabled"
setDOMStyleSheetDisabled :: (MonadIO m, DOMStyleSheetK o) => o -> Bool -> m ()
setDOMStyleSheetDisabled obj val = liftIO $ setObjectPropertyBool obj "disabled" val
constructDOMStyleSheetDisabled :: Bool -> IO ([Char], GValue)
constructDOMStyleSheetDisabled val = constructObjectPropertyBool "disabled" val
data DOMStyleSheetDisabledPropertyInfo
instance AttrInfo DOMStyleSheetDisabledPropertyInfo where
type AttrAllowedOps DOMStyleSheetDisabledPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint DOMStyleSheetDisabledPropertyInfo = (~) Bool
type AttrBaseTypeConstraint DOMStyleSheetDisabledPropertyInfo = DOMStyleSheetK
type AttrGetType DOMStyleSheetDisabledPropertyInfo = Bool
type AttrLabel DOMStyleSheetDisabledPropertyInfo = "DOMStyleSheet::disabled"
attrGet _ = getDOMStyleSheetDisabled
attrSet _ = setDOMStyleSheetDisabled
attrConstruct _ = constructDOMStyleSheetDisabled
getDOMStyleSheetHref :: (MonadIO m, DOMStyleSheetK o) => o -> m T.Text
getDOMStyleSheetHref obj = liftIO $ getObjectPropertyString obj "href"
data DOMStyleSheetHrefPropertyInfo
instance AttrInfo DOMStyleSheetHrefPropertyInfo where
type AttrAllowedOps DOMStyleSheetHrefPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMStyleSheetHrefPropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMStyleSheetHrefPropertyInfo = DOMStyleSheetK
type AttrGetType DOMStyleSheetHrefPropertyInfo = T.Text
type AttrLabel DOMStyleSheetHrefPropertyInfo = "DOMStyleSheet::href"
attrGet _ = getDOMStyleSheetHref
attrSet _ = undefined
attrConstruct _ = undefined
getDOMStyleSheetMedia :: (MonadIO m, DOMStyleSheetK o) => o -> m DOMMediaList
getDOMStyleSheetMedia obj = liftIO $ getObjectPropertyObject obj "media" DOMMediaList
data DOMStyleSheetMediaPropertyInfo
instance AttrInfo DOMStyleSheetMediaPropertyInfo where
type AttrAllowedOps DOMStyleSheetMediaPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMStyleSheetMediaPropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMStyleSheetMediaPropertyInfo = DOMStyleSheetK
type AttrGetType DOMStyleSheetMediaPropertyInfo = DOMMediaList
type AttrLabel DOMStyleSheetMediaPropertyInfo = "DOMStyleSheet::media"
attrGet _ = getDOMStyleSheetMedia
attrSet _ = undefined
attrConstruct _ = undefined
getDOMStyleSheetOwnerNode :: (MonadIO m, DOMStyleSheetK o) => o -> m DOMNode
getDOMStyleSheetOwnerNode obj = liftIO $ getObjectPropertyObject obj "owner-node" DOMNode
data DOMStyleSheetOwnerNodePropertyInfo
instance AttrInfo DOMStyleSheetOwnerNodePropertyInfo where
type AttrAllowedOps DOMStyleSheetOwnerNodePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMStyleSheetOwnerNodePropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMStyleSheetOwnerNodePropertyInfo = DOMStyleSheetK
type AttrGetType DOMStyleSheetOwnerNodePropertyInfo = DOMNode
type AttrLabel DOMStyleSheetOwnerNodePropertyInfo = "DOMStyleSheet::owner-node"
attrGet _ = getDOMStyleSheetOwnerNode
attrSet _ = undefined
attrConstruct _ = undefined
getDOMStyleSheetParentStyleSheet :: (MonadIO m, DOMStyleSheetK o) => o -> m DOMStyleSheet
getDOMStyleSheetParentStyleSheet obj = liftIO $ getObjectPropertyObject obj "parent-style-sheet" DOMStyleSheet
data DOMStyleSheetParentStyleSheetPropertyInfo
instance AttrInfo DOMStyleSheetParentStyleSheetPropertyInfo where
type AttrAllowedOps DOMStyleSheetParentStyleSheetPropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMStyleSheetParentStyleSheetPropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMStyleSheetParentStyleSheetPropertyInfo = DOMStyleSheetK
type AttrGetType DOMStyleSheetParentStyleSheetPropertyInfo = DOMStyleSheet
type AttrLabel DOMStyleSheetParentStyleSheetPropertyInfo = "DOMStyleSheet::parent-style-sheet"
attrGet _ = getDOMStyleSheetParentStyleSheet
attrSet _ = undefined
attrConstruct _ = undefined
getDOMStyleSheetTitle :: (MonadIO m, DOMStyleSheetK o) => o -> m T.Text
getDOMStyleSheetTitle obj = liftIO $ getObjectPropertyString obj "title"
data DOMStyleSheetTitlePropertyInfo
instance AttrInfo DOMStyleSheetTitlePropertyInfo where
type AttrAllowedOps DOMStyleSheetTitlePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMStyleSheetTitlePropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMStyleSheetTitlePropertyInfo = DOMStyleSheetK
type AttrGetType DOMStyleSheetTitlePropertyInfo = T.Text
type AttrLabel DOMStyleSheetTitlePropertyInfo = "DOMStyleSheet::title"
attrGet _ = getDOMStyleSheetTitle
attrSet _ = undefined
attrConstruct _ = undefined
getDOMStyleSheetType :: (MonadIO m, DOMStyleSheetK o) => o -> m T.Text
getDOMStyleSheetType obj = liftIO $ getObjectPropertyString obj "type"
data DOMStyleSheetTypePropertyInfo
instance AttrInfo DOMStyleSheetTypePropertyInfo where
type AttrAllowedOps DOMStyleSheetTypePropertyInfo = '[ 'AttrGet]
type AttrSetTypeConstraint DOMStyleSheetTypePropertyInfo = (~) ()
type AttrBaseTypeConstraint DOMStyleSheetTypePropertyInfo = DOMStyleSheetK
type AttrGetType DOMStyleSheetTypePropertyInfo = T.Text
type AttrLabel DOMStyleSheetTypePropertyInfo = "DOMStyleSheet::type"
attrGet _ = getDOMStyleSheetType
attrSet _ = undefined
attrConstruct _ = undefined
type instance AttributeList DOMStyleSheet = DOMStyleSheetAttributeList
type DOMStyleSheetAttributeList = ('[ '("core-object", DOMObjectCoreObjectPropertyInfo), '("disabled", DOMStyleSheetDisabledPropertyInfo), '("href", DOMStyleSheetHrefPropertyInfo), '("media", DOMStyleSheetMediaPropertyInfo), '("owner-node", DOMStyleSheetOwnerNodePropertyInfo), '("parent-style-sheet", DOMStyleSheetParentStyleSheetPropertyInfo), '("title", DOMStyleSheetTitlePropertyInfo), '("type", DOMStyleSheetTypePropertyInfo)] :: [(Symbol, *)])
type instance SignalList DOMStyleSheet = DOMStyleSheetSignalList
type DOMStyleSheetSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])
foreign import ccall "webkit_dom_style_sheet_get_disabled" webkit_dom_style_sheet_get_disabled ::
Ptr DOMStyleSheet ->
IO CInt
dOMStyleSheetGetDisabled ::
(MonadIO m, DOMStyleSheetK a) =>
a ->
m Bool
dOMStyleSheetGetDisabled _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_style_sheet_get_disabled _obj'
let result' = (/= 0) result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_dom_style_sheet_get_href" webkit_dom_style_sheet_get_href ::
Ptr DOMStyleSheet ->
IO CString
dOMStyleSheetGetHref ::
(MonadIO m, DOMStyleSheetK a) =>
a ->
m T.Text
dOMStyleSheetGetHref _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_style_sheet_get_href _obj'
checkUnexpectedReturnNULL "webkit_dom_style_sheet_get_href" result
result' <- cstringToText result
freeMem result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_dom_style_sheet_get_media" webkit_dom_style_sheet_get_media ::
Ptr DOMStyleSheet ->
IO (Ptr DOMMediaList)
dOMStyleSheetGetMedia ::
(MonadIO m, DOMStyleSheetK a) =>
a ->
m DOMMediaList
dOMStyleSheetGetMedia _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_style_sheet_get_media _obj'
checkUnexpectedReturnNULL "webkit_dom_style_sheet_get_media" result
result' <- (wrapObject DOMMediaList) result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_dom_style_sheet_get_owner_node" webkit_dom_style_sheet_get_owner_node ::
Ptr DOMStyleSheet ->
IO (Ptr DOMNode)
dOMStyleSheetGetOwnerNode ::
(MonadIO m, DOMStyleSheetK a) =>
a ->
m DOMNode
dOMStyleSheetGetOwnerNode _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_style_sheet_get_owner_node _obj'
checkUnexpectedReturnNULL "webkit_dom_style_sheet_get_owner_node" result
result' <- (newObject DOMNode) result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_dom_style_sheet_get_parent_style_sheet" webkit_dom_style_sheet_get_parent_style_sheet ::
Ptr DOMStyleSheet ->
IO (Ptr DOMStyleSheet)
dOMStyleSheetGetParentStyleSheet ::
(MonadIO m, DOMStyleSheetK a) =>
a ->
m DOMStyleSheet
dOMStyleSheetGetParentStyleSheet _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_style_sheet_get_parent_style_sheet _obj'
checkUnexpectedReturnNULL "webkit_dom_style_sheet_get_parent_style_sheet" result
result' <- (wrapObject DOMStyleSheet) result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_dom_style_sheet_get_title" webkit_dom_style_sheet_get_title ::
Ptr DOMStyleSheet ->
IO CString
dOMStyleSheetGetTitle ::
(MonadIO m, DOMStyleSheetK a) =>
a ->
m T.Text
dOMStyleSheetGetTitle _obj = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
result <- webkit_dom_style_sheet_get_title _obj'
checkUnexpectedReturnNULL "webkit_dom_style_sheet_get_title" result
result' <- cstringToText result
freeMem result
touchManagedPtr _obj
return result'
foreign import ccall "webkit_dom_style_sheet_set_disabled" webkit_dom_style_sheet_set_disabled ::
Ptr DOMStyleSheet ->
CInt ->
IO ()
dOMStyleSheetSetDisabled ::
(MonadIO m, DOMStyleSheetK a) =>
a ->
Bool ->
m ()
dOMStyleSheetSetDisabled _obj value = liftIO $ do
let _obj' = unsafeManagedPtrCastPtr _obj
let value' = (fromIntegral . fromEnum) value
webkit_dom_style_sheet_set_disabled _obj' value'
touchManagedPtr _obj
return ()