module JSDOM.Generated.CSSStyleDeclaration
(getPropertyValue, getPropertyCSSValue, removeProperty,
getPropertyPriority, setProperty, item, getPropertyShorthand,
isPropertyImplicit, setCssText, getCssText, getLength,
getParentRule, CSSStyleDeclaration, castToCSSStyleDeclaration,
gTypeCSSStyleDeclaration)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Read, Eq, Ord, Maybe(..))
import Data.Typeable (Typeable)
import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, new, array)
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
getPropertyValue ::
(MonadDOM m, ToJSString propertyName, FromJSString result) =>
CSSStyleDeclaration -> propertyName -> m (Maybe result)
getPropertyValue self propertyName
= liftDOM
((self ^. jsf "getPropertyValue" [toJSVal propertyName]) >>=
fromMaybeJSString)
getPropertyCSSValue ::
(MonadDOM m, ToJSString propertyName) =>
CSSStyleDeclaration -> propertyName -> m (Maybe CSSValue)
getPropertyCSSValue self propertyName
= liftDOM
((self ^. jsf "getPropertyCSSValue" [toJSVal propertyName]) >>=
fromJSVal)
removeProperty ::
(MonadDOM m, ToJSString propertyName, FromJSString result) =>
CSSStyleDeclaration -> propertyName -> m (Maybe result)
removeProperty self propertyName
= liftDOM
((self ^. jsf "removeProperty" [toJSVal propertyName]) >>=
fromMaybeJSString)
getPropertyPriority ::
(MonadDOM m, ToJSString propertyName, FromJSString result) =>
CSSStyleDeclaration -> propertyName -> m (Maybe result)
getPropertyPriority self propertyName
= liftDOM
((self ^. jsf "getPropertyPriority" [toJSVal propertyName]) >>=
fromMaybeJSString)
setProperty ::
(MonadDOM m, ToJSString propertyName, ToJSString value,
ToJSString priority) =>
CSSStyleDeclaration ->
propertyName -> Maybe value -> priority -> m ()
setProperty self propertyName value priority
= liftDOM
(void
(self ^. jsf "setProperty"
[toJSVal propertyName, toJSVal value, toJSVal priority]))
item ::
(MonadDOM m, FromJSString result) =>
CSSStyleDeclaration -> Word -> m result
item self index
= liftDOM
((self ^. jsf "item" [toJSVal index]) >>= fromJSValUnchecked)
getPropertyShorthand ::
(MonadDOM m, ToJSString propertyName, FromJSString result) =>
CSSStyleDeclaration -> propertyName -> m (Maybe result)
getPropertyShorthand self propertyName
= liftDOM
((self ^. jsf "getPropertyShorthand" [toJSVal propertyName]) >>=
fromMaybeJSString)
isPropertyImplicit ::
(MonadDOM m, ToJSString propertyName) =>
CSSStyleDeclaration -> propertyName -> m Bool
isPropertyImplicit self propertyName
= liftDOM
((self ^. jsf "isPropertyImplicit" [toJSVal propertyName]) >>=
valToBool)
setCssText ::
(MonadDOM m, ToJSString val) =>
CSSStyleDeclaration -> Maybe val -> m ()
setCssText self val = liftDOM (self ^. jss "cssText" (toJSVal val))
getCssText ::
(MonadDOM m, FromJSString result) =>
CSSStyleDeclaration -> m (Maybe result)
getCssText self
= liftDOM ((self ^. js "cssText") >>= fromMaybeJSString)
getLength :: (MonadDOM m) => CSSStyleDeclaration -> m Word
getLength self
= liftDOM (round <$> ((self ^. js "length") >>= valToNumber))
getParentRule ::
(MonadDOM m) => CSSStyleDeclaration -> m (Maybe CSSRule)
getParentRule self
= liftDOM ((self ^. js "parentRule") >>= fromJSVal)