{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.HTMLElement
(newHTMLElement, click, focus, blur, setTitle, getTitle, setLang,
getLang, setTranslate, getTranslate, setDir, getDir, getDataset,
setHidden, getHidden, setTabIndex, getTabIndex, setAccessKey,
getAccessKey, setDraggable, getDraggable, setSpellcheck,
getSpellcheck, setInnerText, getInnerText, setContentEditable,
getContentEditable, getIsContentEditable, getOffsetParent,
getOffsetParentUnsafe, getOffsetParentUnchecked, getOffsetTop,
getOffsetLeft, getOffsetWidth, getOffsetHeight, setOuterText,
getOuterText, setAutocorrect, getAutocorrect, setAutocapitalize,
getAutocapitalize, setWebkitdropzone, getWebkitdropzone,
HTMLElement(..), gTypeHTMLElement, IsHTMLElement, toHTMLElement)
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
newHTMLElement :: (MonadDOM m) => m HTMLElement
newHTMLElement
= liftDOM (HTMLElement <$> new (jsg "HTMLElement") ())
click :: (MonadDOM m, IsHTMLElement self) => self -> m ()
click self
= liftDOM (void ((toHTMLElement self) ^. jsf "click" ()))
focus :: (MonadDOM m, IsHTMLElement self) => self -> m ()
focus self
= liftDOM (void ((toHTMLElement self) ^. jsf "focus" ()))
blur :: (MonadDOM m, IsHTMLElement self) => self -> m ()
blur self = liftDOM (void ((toHTMLElement self) ^. jsf "blur" ()))
setTitle ::
(MonadDOM m, IsHTMLElement self, ToJSString val) =>
self -> val -> m ()
setTitle self val
= liftDOM ((toHTMLElement self) ^. jss "title" (toJSVal val))
getTitle ::
(MonadDOM m, IsHTMLElement self, FromJSString result) =>
self -> m result
getTitle self
= liftDOM
(((toHTMLElement self) ^. js "title") >>= fromJSValUnchecked)
setLang ::
(MonadDOM m, IsHTMLElement self, ToJSString val) =>
self -> val -> m ()
setLang self val
= liftDOM ((toHTMLElement self) ^. jss "lang" (toJSVal val))
getLang ::
(MonadDOM m, IsHTMLElement self, FromJSString result) =>
self -> m result
getLang self
= liftDOM
(((toHTMLElement self) ^. js "lang") >>= fromJSValUnchecked)
setTranslate ::
(MonadDOM m, IsHTMLElement self) => self -> Bool -> m ()
setTranslate self val
= liftDOM ((toHTMLElement self) ^. jss "translate" (toJSVal val))
getTranslate :: (MonadDOM m, IsHTMLElement self) => self -> m Bool
getTranslate self
= liftDOM (((toHTMLElement self) ^. js "translate") >>= valToBool)
setDir ::
(MonadDOM m, IsHTMLElement self, ToJSString val) =>
self -> val -> m ()
setDir self val
= liftDOM ((toHTMLElement self) ^. jss "dir" (toJSVal val))
getDir ::
(MonadDOM m, IsHTMLElement self, FromJSString result) =>
self -> m result
getDir self
= liftDOM
(((toHTMLElement self) ^. js "dir") >>= fromJSValUnchecked)
getDataset ::
(MonadDOM m, IsHTMLElement self) => self -> m DOMStringMap
getDataset self
= liftDOM
(((toHTMLElement self) ^. js "dataset") >>= fromJSValUnchecked)
setHidden ::
(MonadDOM m, IsHTMLElement self) => self -> Bool -> m ()
setHidden self val
= liftDOM ((toHTMLElement self) ^. jss "hidden" (toJSVal val))
getHidden :: (MonadDOM m, IsHTMLElement self) => self -> m Bool
getHidden self
= liftDOM (((toHTMLElement self) ^. js "hidden") >>= valToBool)
setTabIndex ::
(MonadDOM m, IsHTMLElement self) => self -> Int -> m ()
setTabIndex self val
= liftDOM ((toHTMLElement self) ^. jss "tabIndex" (toJSVal val))
getTabIndex :: (MonadDOM m, IsHTMLElement self) => self -> m Int
getTabIndex self
= liftDOM
(round <$>
(((toHTMLElement self) ^. js "tabIndex") >>= valToNumber))
setAccessKey ::
(MonadDOM m, IsHTMLElement self, ToJSString val) =>
self -> val -> m ()
setAccessKey self val
= liftDOM ((toHTMLElement self) ^. jss "accessKey" (toJSVal val))
getAccessKey ::
(MonadDOM m, IsHTMLElement self, FromJSString result) =>
self -> m result
getAccessKey self
= liftDOM
(((toHTMLElement self) ^. js "accessKey") >>= fromJSValUnchecked)
setDraggable ::
(MonadDOM m, IsHTMLElement self) => self -> Bool -> m ()
setDraggable self val
= liftDOM ((toHTMLElement self) ^. jss "draggable" (toJSVal val))
getDraggable :: (MonadDOM m, IsHTMLElement self) => self -> m Bool
getDraggable self
= liftDOM (((toHTMLElement self) ^. js "draggable") >>= valToBool)
setSpellcheck ::
(MonadDOM m, IsHTMLElement self) => self -> Bool -> m ()
setSpellcheck self val
= liftDOM ((toHTMLElement self) ^. jss "spellcheck" (toJSVal val))
getSpellcheck :: (MonadDOM m, IsHTMLElement self) => self -> m Bool
getSpellcheck self
= liftDOM (((toHTMLElement self) ^. js "spellcheck") >>= valToBool)
setInnerText ::
(MonadDOM m, IsHTMLElement self, ToJSString val) =>
self -> val -> m ()
setInnerText self val
= liftDOM ((toHTMLElement self) ^. jss "innerText" (toJSVal val))
getInnerText ::
(MonadDOM m, IsHTMLElement self, FromJSString result) =>
self -> m result
getInnerText self
= liftDOM
(((toHTMLElement self) ^. js "innerText") >>= fromJSValUnchecked)
setContentEditable ::
(MonadDOM m, IsHTMLElement self, ToJSString val) =>
self -> val -> m ()
setContentEditable self val
= liftDOM
((toHTMLElement self) ^. jss "contentEditable" (toJSVal val))
getContentEditable ::
(MonadDOM m, IsHTMLElement self, FromJSString result) =>
self -> m result
getContentEditable self
= liftDOM
(((toHTMLElement self) ^. js "contentEditable") >>=
fromJSValUnchecked)
getIsContentEditable ::
(MonadDOM m, IsHTMLElement self) => self -> m Bool
getIsContentEditable self
= liftDOM
(((toHTMLElement self) ^. js "isContentEditable") >>= valToBool)
getOffsetParent ::
(MonadDOM m, IsHTMLElement self) => self -> m (Maybe Element)
getOffsetParent self
= liftDOM
(((toHTMLElement self) ^. js "offsetParent") >>= fromJSVal)
getOffsetParentUnsafe ::
(MonadDOM m, IsHTMLElement self, HasCallStack) => self -> m Element
getOffsetParentUnsafe self
= liftDOM
((((toHTMLElement self) ^. js "offsetParent") >>= fromJSVal) >>=
maybe (Prelude.error "Nothing to return") return)
getOffsetParentUnchecked ::
(MonadDOM m, IsHTMLElement self) => self -> m Element
getOffsetParentUnchecked self
= liftDOM
(((toHTMLElement self) ^. js "offsetParent") >>=
fromJSValUnchecked)
getOffsetTop ::
(MonadDOM m, IsHTMLElement self) => self -> m Double
getOffsetTop self
= liftDOM
(((toHTMLElement self) ^. js "offsetTop") >>= valToNumber)
getOffsetLeft ::
(MonadDOM m, IsHTMLElement self) => self -> m Double
getOffsetLeft self
= liftDOM
(((toHTMLElement self) ^. js "offsetLeft") >>= valToNumber)
getOffsetWidth ::
(MonadDOM m, IsHTMLElement self) => self -> m Double
getOffsetWidth self
= liftDOM
(((toHTMLElement self) ^. js "offsetWidth") >>= valToNumber)
getOffsetHeight ::
(MonadDOM m, IsHTMLElement self) => self -> m Double
getOffsetHeight self
= liftDOM
(((toHTMLElement self) ^. js "offsetHeight") >>= valToNumber)
setOuterText ::
(MonadDOM m, IsHTMLElement self, ToJSString val) =>
self -> val -> m ()
setOuterText self val
= liftDOM ((toHTMLElement self) ^. jss "outerText" (toJSVal val))
getOuterText ::
(MonadDOM m, IsHTMLElement self, FromJSString result) =>
self -> m result
getOuterText self
= liftDOM
(((toHTMLElement self) ^. js "outerText") >>= fromJSValUnchecked)
setAutocorrect ::
(MonadDOM m, IsHTMLElement self) => self -> Bool -> m ()
setAutocorrect self val
= liftDOM ((toHTMLElement self) ^. jss "autocorrect" (toJSVal val))
getAutocorrect ::
(MonadDOM m, IsHTMLElement self) => self -> m Bool
getAutocorrect self
= liftDOM
(((toHTMLElement self) ^. js "autocorrect") >>= valToBool)
setAutocapitalize ::
(MonadDOM m, IsHTMLElement self, ToJSString val) =>
self -> val -> m ()
setAutocapitalize self val
= liftDOM
((toHTMLElement self) ^. jss "autocapitalize" (toJSVal val))
getAutocapitalize ::
(MonadDOM m, IsHTMLElement self, FromJSString result) =>
self -> m result
getAutocapitalize self
= liftDOM
(((toHTMLElement self) ^. js "autocapitalize") >>=
fromJSValUnchecked)
setWebkitdropzone ::
(MonadDOM m, IsHTMLElement self, ToJSString val) =>
self -> val -> m ()
setWebkitdropzone self val
= liftDOM
((toHTMLElement self) ^. jss "webkitdropzone" (toJSVal val))
getWebkitdropzone ::
(MonadDOM m, IsHTMLElement self, FromJSString result) =>
self -> m result
getWebkitdropzone self
= liftDOM
(((toHTMLElement self) ^. js "webkitdropzone") >>=
fromJSValUnchecked)