{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.HTMLImageElement
(setName, getName, setAlign, getAlign, setAlt, getAlt, setBorder,
getBorder, setCrossOrigin, getCrossOrigin, getCrossOriginUnsafe,
getCrossOriginUnchecked, setHeight, getHeight, setHspace,
getHspace, setIsMap, getIsMap, setLongDesc, getLongDesc, setSrc,
getSrc, setSrcset, getSrcset, setSizes, getSizes, getCurrentSrc,
setUseMap, getUseMap, setVspace, getVspace, setWidth, getWidth,
getComplete, setLowsrc, getLowsrc, getNaturalHeight,
getNaturalWidth, getX, getY, HTMLImageElement(..),
gTypeHTMLImageElement)
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, unsafeEventNameAsync)
import JSDOM.Enums
setName ::
(MonadDOM m, ToJSString val) => HTMLImageElement -> val -> m ()
setName self val = liftDOM (self ^. jss "name" (toJSVal val))
getName ::
(MonadDOM m, FromJSString result) => HTMLImageElement -> m result
getName self = liftDOM ((self ^. js "name") >>= fromJSValUnchecked)
setAlign ::
(MonadDOM m, ToJSString val) => HTMLImageElement -> val -> m ()
setAlign self val = liftDOM (self ^. jss "align" (toJSVal val))
getAlign ::
(MonadDOM m, FromJSString result) => HTMLImageElement -> m result
getAlign self
= liftDOM ((self ^. js "align") >>= fromJSValUnchecked)
setAlt ::
(MonadDOM m, ToJSString val) => HTMLImageElement -> val -> m ()
setAlt self val = liftDOM (self ^. jss "alt" (toJSVal val))
getAlt ::
(MonadDOM m, FromJSString result) => HTMLImageElement -> m result
getAlt self = liftDOM ((self ^. js "alt") >>= fromJSValUnchecked)
setBorder ::
(MonadDOM m, ToJSString val) => HTMLImageElement -> val -> m ()
setBorder self val = liftDOM (self ^. jss "border" (toJSVal val))
getBorder ::
(MonadDOM m, FromJSString result) => HTMLImageElement -> m result
getBorder self
= liftDOM ((self ^. js "border") >>= fromJSValUnchecked)
setCrossOrigin ::
(MonadDOM m, ToJSString val) =>
HTMLImageElement -> Maybe val -> m ()
setCrossOrigin self val
= liftDOM (self ^. jss "crossOrigin" (toJSVal val))
getCrossOrigin ::
(MonadDOM m, FromJSString result) =>
HTMLImageElement -> m (Maybe result)
getCrossOrigin self
= liftDOM ((self ^. js "crossOrigin") >>= fromMaybeJSString)
getCrossOriginUnsafe ::
(MonadDOM m, HasCallStack, FromJSString result) =>
HTMLImageElement -> m result
getCrossOriginUnsafe self
= liftDOM
(((self ^. js "crossOrigin") >>= fromMaybeJSString) >>=
maybe (Prelude.error "Nothing to return") return)
getCrossOriginUnchecked ::
(MonadDOM m, FromJSString result) => HTMLImageElement -> m result
getCrossOriginUnchecked self
= liftDOM ((self ^. js "crossOrigin") >>= fromJSValUnchecked)
setHeight :: (MonadDOM m) => HTMLImageElement -> Word -> m ()
setHeight self val = liftDOM (self ^. jss "height" (toJSVal val))
getHeight :: (MonadDOM m) => HTMLImageElement -> m Word
getHeight self
= liftDOM (round <$> ((self ^. js "height") >>= valToNumber))
setHspace :: (MonadDOM m) => HTMLImageElement -> Word -> m ()
setHspace self val = liftDOM (self ^. jss "hspace" (toJSVal val))
getHspace :: (MonadDOM m) => HTMLImageElement -> m Word
getHspace self
= liftDOM (round <$> ((self ^. js "hspace") >>= valToNumber))
setIsMap :: (MonadDOM m) => HTMLImageElement -> Bool -> m ()
setIsMap self val = liftDOM (self ^. jss "isMap" (toJSVal val))
getIsMap :: (MonadDOM m) => HTMLImageElement -> m Bool
getIsMap self = liftDOM ((self ^. js "isMap") >>= valToBool)
setLongDesc ::
(MonadDOM m, ToJSString val) => HTMLImageElement -> val -> m ()
setLongDesc self val
= liftDOM (self ^. jss "longDesc" (toJSVal val))
getLongDesc ::
(MonadDOM m, FromJSString result) => HTMLImageElement -> m result
getLongDesc self
= liftDOM ((self ^. js "longDesc") >>= fromJSValUnchecked)
setSrc ::
(MonadDOM m, ToJSString val) => HTMLImageElement -> val -> m ()
setSrc self val = liftDOM (self ^. jss "src" (toJSVal val))
getSrc ::
(MonadDOM m, FromJSString result) => HTMLImageElement -> m result
getSrc self = liftDOM ((self ^. js "src") >>= fromJSValUnchecked)
setSrcset ::
(MonadDOM m, ToJSString val) => HTMLImageElement -> val -> m ()
setSrcset self val = liftDOM (self ^. jss "srcset" (toJSVal val))
getSrcset ::
(MonadDOM m, FromJSString result) => HTMLImageElement -> m result
getSrcset self
= liftDOM ((self ^. js "srcset") >>= fromJSValUnchecked)
setSizes ::
(MonadDOM m, ToJSString val) => HTMLImageElement -> val -> m ()
setSizes self val = liftDOM (self ^. jss "sizes" (toJSVal val))
getSizes ::
(MonadDOM m, FromJSString result) => HTMLImageElement -> m result
getSizes self
= liftDOM ((self ^. js "sizes") >>= fromJSValUnchecked)
getCurrentSrc ::
(MonadDOM m, FromJSString result) => HTMLImageElement -> m result
getCurrentSrc self
= liftDOM ((self ^. js "currentSrc") >>= fromJSValUnchecked)
setUseMap ::
(MonadDOM m, ToJSString val) => HTMLImageElement -> val -> m ()
setUseMap self val = liftDOM (self ^. jss "useMap" (toJSVal val))
getUseMap ::
(MonadDOM m, FromJSString result) => HTMLImageElement -> m result
getUseMap self
= liftDOM ((self ^. js "useMap") >>= fromJSValUnchecked)
setVspace :: (MonadDOM m) => HTMLImageElement -> Word -> m ()
setVspace self val = liftDOM (self ^. jss "vspace" (toJSVal val))
getVspace :: (MonadDOM m) => HTMLImageElement -> m Word
getVspace self
= liftDOM (round <$> ((self ^. js "vspace") >>= valToNumber))
setWidth :: (MonadDOM m) => HTMLImageElement -> Word -> m ()
setWidth self val = liftDOM (self ^. jss "width" (toJSVal val))
getWidth :: (MonadDOM m) => HTMLImageElement -> m Word
getWidth self
= liftDOM (round <$> ((self ^. js "width") >>= valToNumber))
getComplete :: (MonadDOM m) => HTMLImageElement -> m Bool
getComplete self = liftDOM ((self ^. js "complete") >>= valToBool)
setLowsrc ::
(MonadDOM m, ToJSString val) => HTMLImageElement -> val -> m ()
setLowsrc self val = liftDOM (self ^. jss "lowsrc" (toJSVal val))
getLowsrc ::
(MonadDOM m, FromJSString result) => HTMLImageElement -> m result
getLowsrc self
= liftDOM ((self ^. js "lowsrc") >>= fromJSValUnchecked)
getNaturalHeight :: (MonadDOM m) => HTMLImageElement -> m Int
getNaturalHeight self
= liftDOM
(round <$> ((self ^. js "naturalHeight") >>= valToNumber))
getNaturalWidth :: (MonadDOM m) => HTMLImageElement -> m Int
getNaturalWidth self
= liftDOM (round <$> ((self ^. js "naturalWidth") >>= valToNumber))
getX :: (MonadDOM m) => HTMLImageElement -> m Int
getX self = liftDOM (round <$> ((self ^. js "x") >>= valToNumber))
getY :: (MonadDOM m) => HTMLImageElement -> m Int
getY self = liftDOM (round <$> ((self ^. js "y") >>= valToNumber))