module JSDOM.Generated.CSSRule
(pattern UNKNOWN_RULE, pattern STYLE_RULE, pattern CHARSET_RULE,
pattern IMPORT_RULE, pattern MEDIA_RULE, pattern FONT_FACE_RULE,
pattern PAGE_RULE, pattern KEYFRAMES_RULE, pattern KEYFRAME_RULE,
pattern NAMESPACE_RULE, pattern SUPPORTS_RULE,
pattern WEBKIT_VIEWPORT_RULE, pattern WEBKIT_REGION_RULE,
pattern WEBKIT_KEYFRAMES_RULE, pattern WEBKIT_KEYFRAME_RULE,
getType, setCssText, getCssText, getCssTextUnsafe,
getCssTextUnchecked, getParentStyleSheet,
getParentStyleSheetUnsafe, getParentStyleSheetUnchecked,
getParentRule, getParentRuleUnsafe, getParentRuleUnchecked,
CSSRule(..), gTypeCSSRule, IsCSSRule, toCSSRule)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Read, Eq, Ord, Maybe(..))
import qualified Prelude (error)
import Data.Typeable (Typeable)
import Data.Traversable (mapM)
import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, asyncFunction, new, array, jsUndefined, (!), (!!))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import JSDOM.Types
import Control.Applicative ((<$>))
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import JSDOM.EventTargetClosures (EventName, unsafeEventName)
import JSDOM.Enums
pattern UNKNOWN_RULE = 0
pattern STYLE_RULE = 1
pattern CHARSET_RULE = 2
pattern IMPORT_RULE = 3
pattern MEDIA_RULE = 4
pattern FONT_FACE_RULE = 5
pattern PAGE_RULE = 6
pattern KEYFRAMES_RULE = 7
pattern KEYFRAME_RULE = 8
pattern NAMESPACE_RULE = 10
pattern SUPPORTS_RULE = 12
pattern WEBKIT_VIEWPORT_RULE = 15
pattern WEBKIT_REGION_RULE = 16
pattern WEBKIT_KEYFRAMES_RULE = 7
pattern WEBKIT_KEYFRAME_RULE = 8
getType :: (MonadDOM m, IsCSSRule self) => self -> m Word
getType self
= liftDOM
(round <$> (((toCSSRule self) ^. js "type") >>= valToNumber))
setCssText ::
(MonadDOM m, IsCSSRule self, ToJSString val) =>
self -> Maybe val -> m ()
setCssText self val
= liftDOM ((toCSSRule self) ^. jss "cssText" (toJSVal val))
getCssText ::
(MonadDOM m, IsCSSRule self, FromJSString result) =>
self -> m (Maybe result)
getCssText self
= liftDOM (((toCSSRule self) ^. js "cssText") >>= fromJSVal)
getCssTextUnsafe ::
(MonadDOM m, IsCSSRule self, HasCallStack, FromJSString result) =>
self -> m result
getCssTextUnsafe self
= liftDOM
((((toCSSRule self) ^. js "cssText") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getCssTextUnchecked ::
(MonadDOM m, IsCSSRule self, FromJSString result) =>
self -> m result
getCssTextUnchecked self
= liftDOM
(((toCSSRule self) ^. js "cssText") >>= fromJSValUnchecked)
getParentStyleSheet ::
(MonadDOM m, IsCSSRule self) => self -> m (Maybe CSSStyleSheet)
getParentStyleSheet self
= liftDOM
(((toCSSRule self) ^. js "parentStyleSheet") >>= fromJSVal)
getParentStyleSheetUnsafe ::
(MonadDOM m, IsCSSRule self, HasCallStack) =>
self -> m CSSStyleSheet
getParentStyleSheetUnsafe self
= liftDOM
((((toCSSRule self) ^. js "parentStyleSheet") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getParentStyleSheetUnchecked ::
(MonadDOM m, IsCSSRule self) => self -> m CSSStyleSheet
getParentStyleSheetUnchecked self
= liftDOM
(((toCSSRule self) ^. js "parentStyleSheet") >>=
fromJSValUnchecked)
getParentRule ::
(MonadDOM m, IsCSSRule self) => self -> m (Maybe CSSRule)
getParentRule self
= liftDOM (((toCSSRule self) ^. js "parentRule") >>= fromJSVal)
getParentRuleUnsafe ::
(MonadDOM m, IsCSSRule self, HasCallStack) => self -> m CSSRule
getParentRuleUnsafe self
= liftDOM
((((toCSSRule self) ^. js "parentRule") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getParentRuleUnchecked ::
(MonadDOM m, IsCSSRule self) => self -> m CSSRule
getParentRuleUnchecked self
= liftDOM
(((toCSSRule self) ^. js "parentRule") >>= fromJSValUnchecked)